Quantcast
Channel: Gazebo: Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 7017

Read IMU sensor from a plugin

$
0
0
Hello, I made a model of a robot and I added and IMU sensor to it in the sdf file as follow: 0 0 0 0 0 01100.0 I'm controlling my robot using a plugin I wrote and everything is working fine, but I would like to read the IMU sensor data inside my plugin's code. I know that I can subscribe to the topic of the IMU ("~/gazebo/default/imu_sensor/imu") and read from there, but I'm wondering how can I get from code an instance of the IMU sensor object and read the IMU like I read the pose of the model. Basically my question is: How can I read the IMU data using an instance of an IMU object in the model? I guess should be something like below, but I don't know how to glue everything together yet. ImuSensor imu; double acc = imu.GetLinearAcceleration();

Viewing all articles
Browse latest Browse all 7017

Trending Articles