Ask Your Question

Get object color though python PlanningSceneInterface

asked 2021-11-06 05:07:59 -0500

Mork gravatar image

I have implemented a custom object detection node which publishes a MoveIt planning scene including object colors in the moveit_msgs/PlanningScene.object_colors field. The colored objects are displayed correctly by the RViz MotionPlanning plugin.

However, I cannot find a way to get the object colors through moveit_commander.PlanningSceneInterface in Python. I read through some docs and sources but it looks like there are no methods provided to access the object colors.

Am I overlooking something? As a workaround I could put the color as a string inside the object's database key, but this seems like a hack.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2021-11-17 07:51:25 -0500

fvd gravatar image

You're not missing anything, it's just that no one implemented that function for Python. You can extend the source code and submit a pull request!

edit flag offensive delete link more



Thanks for clarification, PR was made :)

Mork gravatar image Mork  ( 2021-12-12 11:09:34 -0500 )edit

answered 2021-11-17 19:54:34 -0500

osilva gravatar image

Just to complement @fvd it’s necessary to extend the source code:

This is code:

It only imports from shape_msgs

from shape_msgs.msg import SolidPrimitive, Plane, Mesh, MeshTriangle

You can add from visualization_msgs to get RGBA

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2021-11-06 05:07:59 -0500

Seen: 29 times

Last updated: Nov 17 '21