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?
↧