Add the cpp file
This commit is contained in:
parent
ce22facfa4
commit
27e6ab1251
|
|
@ -0,0 +1,24 @@
|
||||||
|
#include <ros/ros.h>
|
||||||
|
#include "std_msgs/String.h"
|
||||||
|
#include <geometry_msgs/Twist.h>
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
ros::init(argc,argv, "autopilot");
|
||||||
|
|
||||||
|
// Subscribe to the cmd_vel topic
|
||||||
|
ros::NodeHandle nh;
|
||||||
|
ros::Publisher cmdVelPub = nh.advertise<geometry_msg::Twist>("cmd_vel",1);
|
||||||
|
|
||||||
|
ros::Rate loopRate(10);
|
||||||
|
|
||||||
|
while(ros::ok())
|
||||||
|
{
|
||||||
|
geometry_msg::Twist msg;
|
||||||
|
msg.angular.z =1;
|
||||||
|
mdVelPub.publish(msg);
|
||||||
|
ros::spinOnce();
|
||||||
|
loopRate.sleep();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue