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

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
2

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

Comments

1

Thanks for clarification, PR was made :) https://github.com/ros-planning/movei...

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

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 planning_scene_interface.py code:

https://docs.ros.org/en/kinetic/api/m...

It only imports from shape_msgs

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

You can add from visualization_msgs to get RGBA

https://github.com/ros/common_msgs/bl...

edit flag offensive delete link more

Question Tools

2 followers

Stats

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

Seen: 216 times

Last updated: Nov 17 '21