cyberbotics / webots_ros2

Webots ROS 2 packages
Apache License 2.0
398 stars 147 forks source link

How can I get robot's ground truth pose from webots? #464

Closed bigbigpark closed 2 years ago

bigbigpark commented 2 years ago

I have successfully built and run webots_ros2.

When I type this command,ros2 launch webots_ros2_mavic robot_launch.py image

It worked well. Now I want to get Ground Truth Pose of the Quadrotor as a format of 9-DoF. I know the position(x, y, z) is got from GPS sensor and the linear acceleration & angular velocity from Inertial Measurement Units.

To see what's topic is streaming, ros2 topic list, image

It gives me a correct GPS data, but cannot offer linear_acceleration.. How can I get this?

I mean when I type ros2 topic echo /imu, they print image

omichel commented 2 years ago

This is likely due to the fact that the Mavic2 robot misses an Accelerometer node. It has a Compass, Gyro, InertialUnit (providing only yaw, pitch, roll) and GPS. Adding an Accelerometer to the PROTO file should resolve the issue.

bigbigpark commented 2 years ago

@omichel Thanks for replying. I'm pretty new about webots. Could you give me some guidance?

omichel commented 2 years ago

I would recommend you to follow this tutorial: https://docs.ros.org/en/galactic/Tutorials/Advanced/Simulators/Webots.html