ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to read Roll and Pitch with Turtlebot3?

asked 2023-06-15 20:36:57 -0500

gabrielc15 gravatar image

I am using the Turtlebot3 with ROS2 Foxy and I can't read the Roll and Pitch, just the Yaw. I'm using this launch: roslaunch turtlebot3_bringup turtlebot3_robot.launch

and the result is: image description

Which is the same result presented at the documentation

I tested, my opencr itself and it really has the gyroscope to read the 3-axis.

So, what I have to do to have access to the Roll and Pitch?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2023-06-16 07:06:53 -0500

Mike Scheutzow gravatar image

updated 2023-06-16 07:11:54 -0500

How to read Roll and Pitch

You obtain these from the IMU sensor. The ros driver typically publishes on a topic named something like /imu/data. By reading the raw sensor data, you are getting the values in the IMU frame. You may need to apply a transformation if you want the values in some other frame (like world or map.)

edit flag offensive delete link more

Comments

Thank you, this is exactly what I was looking for. Just to clarify for future users, the topic is named /imu

gabrielc15 gravatar image gabrielc15  ( 2023-06-19 07:31:40 -0500 )edit
0

answered 2023-06-16 08:16:41 -0500

dcconner gravatar image

The information you want is in the /odom pose.pose.orientation quaternion. There are transforms available to convert the quaternion representation to 3D Euler roll, pitch, yaw. (pay attention to ROS standard order of operations for Euler, ZYX, IIRC)

For simulation you, you would expect 2D flat world would have only yaw, with roll and pitch = 0. In the case shown, only the quaternion z (and w) are non-zero, which is typical for pure rotation about z-axis

edit flag offensive delete link more

Comments

This is what I first tried and didn't work. I'm using the real robot and not simulating. As showed on the image, the /odom topic doesn't have the Roll and Pitch information (what can be confirmed converting from quaternion to euler), just the yaw.

gabrielc15 gravatar image gabrielc15  ( 2023-06-19 07:36:26 -0500 )edit

The quaternion has pitch and roll, it's just they are both 0.0 Now, if the problem is the internal node calculating odometry message is assuming 2D and not calculating pitch and roll, where you are going over inclined terrain and expect roll and pitch, then you need 3D estimation and you should confirm what the TB3 code is doing for odometry. If it assumes 2D, then either you either need to update TB code to do 3D pose estimation, or set up an external kalman filter combining odometry and IMU data as suggested above.

dcconner gravatar image dcconner  ( 2023-06-19 13:23:28 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2023-06-15 20:36:57 -0500

Seen: 82 times

Last updated: Jun 16 '23