diff --git a/src/autopilot.cpp b/src/autopilot.cpp new file mode 100644 index 0000000..4c95b26 --- /dev/null +++ b/src/autopilot.cpp @@ -0,0 +1,24 @@ +#include +#include "std_msgs/String.h" +#include + +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("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; +}