Ask Your Question

How see all collision objects in rviz?

asked 2012-12-03 02:06:31 -0500

Sanxano gravatar image


I'm working with panning scenes. I have done a "world interface" class in C++. My code works, I can iterate all collision objects and attached collision objects, but I can't see this objects in Rviz.

Well, I have a marker with attached_objects topic, and I can see when an object is attached, but I can't see any collision object.

I have read in a tutorial that said somethin like "Launch the display for known model markers" with: roslaunch planning_environment display_planner_collision_model.launch but this file doesn't exits.

How can I see all the scene object?


edit retag flag offensive close merge delete


In my code, I add some collision objects into the world, and after a get_planning_scene, I can iterate all the objects.

Sanxano gravatar image Sanxano  ( 2012-12-03 02:33:22 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2012-12-21 08:12:17 -0500

dsolomon gravatar image

I don't think there is any direct link between the environment_server and rviz nodes.

When you say that you are adding collision objects to the environment, I assume that you are publishing them on a /collision_object topic; This will add them to the world. If you are adding them by calling set_planning_scene_diff, then they are not permanently added to the world.

So, assuming you are adding them permanently to the world via the /collision_object topic, I think you will need something custom to show them in rviz. I suggest that whatever node you use to publish on /collision_object should also publish a Marker or MarkerArray using the same resource (For example, if you are adding a mesh object for collision, use the same mesh file published to a marker).

I am working on something similar right now, I will try to remember to remember to post some example code when I finish.

edit flag offensive delete link more

answered 2012-12-03 21:17:52 -0500

Sanxano gravatar image

Every time that you add or modifice a collision object (by publishing the topic), you need "refresh" the environment with set_planning_scene:

arm_navigation_msgs::SetPlanningSceneDiff::Request set_planning_scene_diff_req;
arm_navigation_msgs::SetPlanningSceneDiff::Response set_planning_scene_diff_res;

if(publisher == attached_object_pub) {
else {

//Actualiza el environtment
if(!, set_planning_scene_diff_res)) {
   ROS_ERROR("Can't set planning scene");
edit flag offensive delete link more


Please do not create answers for discussion or comments. This is not a forum. Instead, either edit your original post or use the comment functionality.

dornhege gravatar image dornhege  ( 2012-12-03 23:16:21 -0500 )edit

The planning scene reset is actually not necessary for storing, only for resetting the planning scene to the world. I would put the reset call somewhere else as otherwise you would always have to wait for that to finish and in addition you will actually reset the planning scene (which might be undesired).

dornhege gravatar image dornhege  ( 2012-12-03 23:17:39 -0500 )edit

answered 2012-12-03 02:14:43 -0500

dornhege gravatar image

First, where do you iterator over collision_objects? In your code? That has no meaning until the objects are on the environment server.

One way to visualize what is actually stored is to use a PlanningScene display in rviz and call /environment_server/set_planning_scene_diff with an empty diff. This should reset the planning scene to the world and thus the PlanningScene display should give you the world.

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: 2012-12-03 02:06:31 -0500

Seen: 1,600 times

Last updated: Dec 21 '12