![Rosanswers logo](https://i.sstatic.net/yuGTR.png)
play bag file using rosbag
robag play xxxxx.bag --clock
it will publish all the topics in bags file.
Write subcriber in your code to get values.
check this for more info
Edit
ros::Subscriber sub = nh.subscribe("imu", 1000, &imuCallback, this);
void Callback(const sensor_msgs::Imu::ConstPtr& msg)
{
double lax = msg->linear_acceleration.x;
double lay = msg->linear_acceleration.y;
double laz= msg->linear_acceleration.z;
}
Originally posted by bvbdort with karma: 3034 on 2015-04-24
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by ozo on 2015-04-24:
Thank you for your answer but my problem is after subscribing how to make this for example double x=linear_acceleration.x;
Comment by bvbdort on 2015-04-24:
check the update
Comment by ozo on 2015-04-24:
Thank you very much. It worked