Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 475

How do I write a C++ code to record variable location of robot in rosbag file?

$
0
0
I have written a code to record in rosbag file. But if the rosbag file starts, then the robot does not move because of sequential way of code. Here is that part of code : i=system("rosbag record -a"); while(ros::ok()) { //Declares the message to be sent geometry_msgs::Twist msg; msg.linear.x=3; msg.angular.z=-0.3; //Publish the message pub.publish(msg); //Delays until it is time to send another message rate.sleep(); } I need to record in rosbag file while simultaneously moving the robot, then after sometime close the file. How to do that?

Viewing all articles
Browse latest Browse all 475

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>