ros-visualization / rviz

ROS 3D Robot Visualizer
BSD 3-Clause "New" or "Revised" License
840 stars 463 forks source link

Display links' centers of mass #1204

Open aemarkov opened 6 years ago

aemarkov commented 6 years ago

I add visualization of links' centers of mass in RobotModel display type. It adds spheres in intertial origin positions.

Here it is: image (in this example urdf inertial origins is incorrect, don't worry)

You can set visibility of the CoMs and size of the markers.

Do you need this functionality?

jlack1987 commented 5 years ago

I think additionally it would be nice to show inertial approximations with an ellipsoid

chapulina commented 5 years ago

As a reference, Gazebo displays the center of mass as a sphere sized as if it were a ball of lead with the same mass as the link, and the inertia as a box sized as if it were a box of uniform density that has the same inertia as the link.

An example:

visualizations

Here's the CoM calculation. Here's the inertia calculation, which uses ignition::math::MassMatrix3::EquivalentBox

jlack1987 commented 5 years ago

Yeah something similar would be great for the RobotModel. I like that Gazebo shows, would be great if we had something on similar for when we're on hardware

luator commented 4 years ago

Is anyone working on this? It would be a very useful feature. @Garrus007 Did you consider making a pull request with your feature? If not, is the code available somewhere?

aemarkov commented 4 years ago

I have a commit in my old forked repo. But there are several bugs (It can segfault because I forgot to check several parameters). I can update this to the current version of the RViz and create Pull-Request in few days.

But I like @chapulina comment. Maybe we should create more advanced view instead of simple balls with arbitrary set diameter.

rhaschke commented 4 years ago

You are very welcome to provide your solution and update with it with the pointers provided by @chapulina.

yeshasvitirupachuri commented 4 years ago

@Garrus007 do you have any update on this ?

JuliusSustarevas commented 3 years ago

Is there something stopping this? Or just bandwidth? I'd especially be interested int he full center of mass of the whole robot model

briansoe66 commented 3 years ago

@Garrus007 @Yeshasvitvs @JuliusSustarevas I have created a Pull request for ros2 rviz, based on @Garrus007 fork. I would appreciate help testing the implementation. Let me know if you can help and want write access to the fork/branch.

briansoe66 commented 3 years ago

ros2 rviz can now display links' center of mass and inertia, as of commit 2b551f808e8e8c9bd29bc006d06a549c00db4861