Problem with visulizing mesh object in RVIZ

1,709 views
Skip to first unread message

Quan Peng

unread,
Sep 13, 2013, 5:09:04 PM9/13/13
to moveit...@googlegroups.com
Hi everyone,

I followed the Environment Representation ROS API to add a collision object into planning scene. I created a simple mesh object and pass it to the /collision_object topic to add it. However, I don't know why I cannot visualize it. Following picture showed my problem. I can see the mesh object in current scene objects window, but I cannot see it in Views(the pink object is captured by Kinect).

Thanks for any help and have a good weekend,

Quan

Marcus Liebhardt

unread,
Sep 15, 2013, 9:07:03 PM9/15/13
to Quan Peng, moveit-users
Quan,
I had no problems adding collision objects with meshes to the scene.
When you mark the mesh in the "Current Scene Object", you should see interactive markers showing up for that object in RViz. Can you see them? It might be just the case, that your object is hidden by the robot itself.

Best,
Marcus
--
Marcus Liebhardt 
Control Engineer
Yujin Robot
주소대한민국 서울시 금천구 가산동 345-30 남성프라자 #601, 153-023.
Address: Door #601, Namsung-Plaza, 345-30 Gasan-dong, Guemcheon-gu, Seoul, 153-023, Republic of Korea
Website: http://www.yujinrobot.com
Email: marcus.l...@yujinrobot.com
Phone: +82-70-46577073

Ioan Sucan

unread,
Oct 1, 2013, 8:07:50 AM10/1/13
to Quan Peng, moveit-users
It is also possible that the mesh created does not have enough sides to be visible. Please try to load a mesh from a CAD file or use a primitive shape to see if the problem is with the mesh or rendering.

mfr...@vt.edu

unread,
Jan 30, 2014, 9:22:10 AM1/30/14
to moveit...@googlegroups.com, Quan Peng
Hey all,

I have a problem where I have imported a mesh object via the scene objects tab of the motion planning plug in of RVIZ. I see it in the current scene objects tab, however I do not know what commands in the move_group_interface C++ api would allow my robot to see the mesh object and attach its eef to it. Any advice would help.

Thanks
Mike 

Martin Günther

unread,
Jan 30, 2014, 10:46:04 AM1/30/14
to moveit...@googlegroups.com
On Thu, 30 Jan 2014 06:22:10 -0800 (PST)
mfr...@vt.edu wrote:

> Hey all,
>
> I have a problem where I have imported a mesh object via the scene
> objects tab of the motion planning plug in of RVIZ. I see it in the
> current scene objects tab, however I do not know what commands in the
> move_group_interface C++ api would allow my robot to see the mesh
> object and attach its eef to it. Any advice would help.
>
> Thanks
> Mike

Hi Mike,

One important thing is that after you've loaded the mesh object, you
need to go back to the first tab and click "Publish Current Scene".
After that, you should see the object appear in the output of:

rosservice call /get_planning_scene '{components : {components: 24}}'

(For that to work, you need to add `move_group/MoveGroupGetPlanningSceneService`
to the capabilities in your move_group.launch).

Once that's working, you can use...

group.attachObject("object_name");

...to attach it to your EEF. The object_name is the same as in the RViz gui.

Cheers,
Martin

Sachin Chitta

unread,
Jan 30, 2014, 1:34:22 PM1/30/14
to Martin Günther, moveit-users
You can also use the planning_scene_interface to interact with the objects in the planning scene:

Tutorial here: http://docs.ros.org/api/pr2_moveit_tutorials/html/planning/src/doc/move_group_interface_tutorial.html
(Look for the Adding/Removing Objects and Addding/Detaching Objects section)

Code API:
http://docs.ros.org/hydro/api/moveit_ros_planning_interface/html/classmoveit_1_1planning__interface_1_1PlanningSceneInterface.html

BTW, I am tracking a lot of the discussion here and would be happy to add new API calls to both the move_group_interface and planning_scene_interface as people request them - just open an issue for the same.

Best Regards,
Sachin

mfr...@vt.edu

unread,
Jan 30, 2014, 5:19:38 PM1/30/14
to moveit...@googlegroups.com
Hey Martin,

The first thing I did was import the mesh object and use the publish current scene option. Next I used the command you said to use to see object by using the command rosservice call /get_planning_scene '{components : {components: 24}}' .
What I got was this:

scene: 
  name: ''
  robot_state: 
    joint_state: 
      header: 
        seq: 0
        stamp: 
          secs: 0
          nsecs: 0
        frame_id: ''
      name: []
      position: []
      velocity: []
      effort: []
    multi_dof_joint_state: 
      header: 
        seq: 0
        stamp: 
          secs: 0
          nsecs: 0
        frame_id: ''
      joint_names: []
      transforms: []
      twist: []
      wrench: []
    attached_collision_objects: []
    is_diff: False
  robot_model_name: ''
  fixed_frame_transforms: []
  allowed_collision_matrix: 
    entry_names: []
    entry_values: []
    default_entry_names: []
    default_entry_values: []
  link_padding: []
  link_scale: []
  object_colors: []
  world: 
    collision_objects: 
      - 
        header: 
          seq: 0
          stamp: 
            secs: 0
            nsecs: 0
          frame_id: /base_link
        id: box.stl
        type: 
          key: ''
          db: ''
        primitives: []
        primitive_poses: []
        meshes: 
          - 
            triangles: 
              - 
                vertex_indices: [0, 1, 2]
              - 
                vertex_indices: [2, 3, 0]
              - 
                vertex_indices: [4, 5, 6]
              - 
                vertex_indices: [6, 7, 4]
              - 
                vertex_indices: [0, 4, 7]
              - 
                vertex_indices: [7, 1, 0]
              - 
                vertex_indices: [1, 7, 6]
              - 
                vertex_indices: [6, 2, 1]
              - 
                vertex_indices: [2, 6, 5]
              - 
                vertex_indices: [5, 3, 2]
              - 
                vertex_indices: [4, 0, 3]
              - 
                vertex_indices: [3, 5, 4]
            vertices: 
              - 
                x: 0.0499999783933
                y: 0.049999974668
                z: -0.0500000007451
              - 
                x: 0.0499999783933
                y: -0.0499999783933
                z: -0.0500000007451
              - 
                x: -0.0499999858439
                y: -0.0499999709427
                z: -0.0500000007451
              - 
                x: -0.0499999597669
                y: 0.0499999970198
                z: -0.0500000007451
              - 
                x: 0.0500000007451
                y: 0.0499999523163
                z: 0.0500000007451
              - 
                x: -0.049999974668
                y: 0.0499999783933
                z: 0.0500000007451
              - 
                x: -0.0499999970198
                y: -0.0499999597669
                z: 0.0500000007451
              - 
                x: 0.0499999448657
                y: -0.0500000081956
                z: 0.0500000007451
        mesh_poses: 
          - 
            position: 
              x: -3.9
              y: 0.0
              z: 0.7
            orientation: 
              x: 0.0
              y: 0.0
              z: 0.0
              w: 1.0
        planes: []
        plane_poses: []
        operation: 0
    octomap: 
      header: 
        seq: 0
        stamp: 
          secs: 0
          nsecs: 0
        frame_id: ''
      origin: 
        position: 
          x: 0.0
          y: 0.0
          z: 0.0
        orientation: 
          x: 0.0
          y: 0.0
          z: 0.0
          w: 0.0
      octomap: 
        header: 
          seq: 0
          stamp: 
            secs: 0
            nsecs: 0
          frame_id: ''
        binary: False
        id: ''
        resolution: 0.0
        data: []
  is_diff: False

I was unable to verify if the box mesh I imported was found.

I made sure to add the capability in the move_group.launch file as well.

The next thing I did was I created a rosnode in which I tired to create a client of the getplanningscene service in C++.  I was  trying to output the names of the objects in the world.  However at compile time it said that the service was not a apart of moveit_msgs. So I was wondering if you could tell me which class/library I needed to include in order for the compile time error to go away. I appreciate all the help you have offered and hope to get to a resolution soon. 

Thanks
Mike

mfr...@vt.edu

unread,
Jan 30, 2014, 5:30:17 PM1/30/14
to moveit...@googlegroups.com, Martin Günther
Hey Sachin,

I did use the planning_interface_planningsceneinterface library. This is what I did to try to get the names of the objects using that library:

  std::vector<std:string> world_objects  =planning_scene_interface.getKnownObjectNames();
  This part worked however when I went to print out one of the names of the objects:

 ROS_INFO("%s object",world_objects[0].c.str());  

   I got a segmentation fault at run time, so I am assuming I wasn't asking for the print statement correctly.  

   If I am able to find the names of the objects I still cannot get access to the collision object through this library correct? Such as finding the pose of the box? 

Thanks 
Mike
Reply all
Reply to author
Forward
0 new messages