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

How to show robot tipping over in Rviz

asked 2016-10-18 13:41:46 -0600

Cerin gravatar image

I've created a URDF model of my robot, linked it to Tf and configured Rviz to show my robot and show joint rotations in realtime when the actual robot moves.

My robot also has an IMU that can measure the yaw, pitch and roll. If I tip over my robot, I want this to be reflected in Rviz. How do you accomplish this? The joints are automatically updated based on the URDF and associated JointState messages, but there's no joint between the robot and the ground. How do I make Rviz tilt the model proportional the angles shown in my IMU messages and/or moving around as the IMU and odometry change?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-10-18 15:26:13 -0600

lucasw gravatar image

The simplest first step is to have a node that subscribes to odometry and imu data and broadcasts the map to base_link transform (or you could have a map-to-odom broadcaster in one node handling odometry and a odom-to-base_link in another that handles the imu).

Take a look at , the python example is a good starting point (instead of zeroing the roll and pitch you would insert your imu roll and pitch).

There is going to be disagreement between your imu yaw and your odometry yaw, you could take one or the other, but the next step is to replace a simple broadcaster with robot_localization

edit flag offensive delete link more


Don't forget to set the fixed frame in rviz to the map or odom frame and the target frame to base_link (or whichever names are being broadcast to tf).

Thomas D gravatar image Thomas D  ( 2016-10-18 16:08:51 -0600 )edit

Question Tools



Asked: 2016-10-18 13:41:46 -0600

Seen: 321 times

Last updated: Oct 18 '16