Robotics StackExchange | Archived questions

IMU-Data from *.bag-File

Hey there,

I'm sitting here since hours and can't get the information i want to. How I'm trying to: First of all: I'm using Matlab and the Toolbox for ROS. I have a File which is called "xyz.bag" and i want to save the startTime, the angularvelocity, linearacceleration and the rostime in some variables of a new struct.

I tried it like this:

bag.Rosbag = rosbag('xyz.bag');

bag.imutopic = select(bag.Rosbag, 'Topic', 'vectornav/IMU');

imu_data = read_imudata_from_rosbag(bag)

function imu_data=read_imudata_from_rosbag(bag)
  imu_data.startTime = ???    <-- tried with bag.Rosbag.StartTime (hadn't worked up to yet) and a lot more function like readMessages an so on
  imu_data.angularvelocity = ???  <-- how to get this one? 
  imu_data.linearacceleration = ??? <--- <-- how to get this one? 
  imu_data.rostime = ??? <--- <-- how to get this one?
end

Could you help me to get a solution for it? I'm really trying to understand it but i don't know how to get further. It's frustrating no to get any step further.

Thank you very much for every help.

Asked by exitus85 on 2023-01-06 10:29:58 UTC

Comments

Answers

The message type published on that topic is usually sensor_msgs/Imu. If you have ros installed, the Terminal command

rosmsg info sensor_msgs/Imu

will display the format of that message (field names). If you don't have ros installed, you can do a web search for the information.

Asked by Mike Scheutzow on 2023-01-08 10:05:35 UTC

Comments

Thanks for that answer. I will give it a try and keep you informed.

Asked by exitus85 on 2023-01-09 12:57:32 UTC

If you just want to see this data, you can use the online option: https://foxglove.dev/

You can also check out possible conversions to other formats, which may be easier for you.

Asked by ljaniec on 2023-01-08 12:05:11 UTC

Comments

Thank you, i will have a look to this address.

Asked by exitus85 on 2023-01-09 13:15:43 UTC