Robot self filtering using realtime_urdf_filter with Kinect v2 and ur5

asked 2017-09-13 11:18:58 -0500

budekatude gravatar image

Hi again,

I've been trying to create a collision map of the surroundings (with rtabmap) for a Universal Robot ur5 using a Microsoft Kinect v2 mounted to an elbow close to the end effector of the robot. I am using ROS Indigo and Ubuntu 14.04.

The mapping works fine thanks to the awesome help of this community. The only problem I have at the moment is that whilst recording the close vicinity of the base of the robot, the robot records itself creating map objects in the process. I need to filter those so that further down the road the robot does not treat them as collision objects.

I have found a package called the realtime_urdf_filter that should be able to do exactly that with the help of the urdf file of the robot in question. ( )

I have included code to launch the package in my launch file:

   <!-- Load the URDF , SRDF and other . yaml configuration files on the param server -->
    <include file ="$(find ur5_moveit_config)/launch/planning_context.launch">
        <arg name ="load_robot_description" value ="true"/>

   <!--Filter robot from depth images with realtime urdf filter package-->
    <node pkg="realtime_urdf_filter" type="realtime_urdf_filter" name="realtime_urdf_filter" output="screen">
        <remap from="~input_depth" to="/kinect2/qhd/image_depth_rect"/>
        <remap from="~output_depth" to="/realtime_urdf_filter/robot_filtered" />
        <remap from="~output_mask" to="/urdf_filtered_mask" />
        <rosparam command="load" file="$(find realtime_urdf_filter)/launch/filter_parameters.yaml"/>

The problem is setting up the filter_parameters.yaml correctly:

fixed_frame: /world
camera_frame: /kinect2_rgb_optical_frame
  translation: [-0.09, 0.0, 0.07]
  rotation:    [0.0, 0.0, 0.0, 1.0]
# There is one entry for each URDIF that should be filtered
- model: "robot_description"
  tf_prefix: "/EXAMPLE"
# how far in front of the robot model is still deleted? (e.g. 0.05 = 5cm)
depth_distance_threshold: 0.05
show_gui: false
filter_replace_value: 5.0

I am at a loss at what to put for the model ("robot_description") and for the tf_prefix ("/EXAMPLE).

I've looked into the urdf files for my robot, and have found various names ("ur5" in ur5_robot.urdf.xacro, "ur5_robot" in ur5.urdf.xacro ...) and various prefixes. No combination seems to work though!

The error message I get is: terminate called after throwing an instance of 'std::runtime_error'

Where is the right place to look for those parameters? The package's documentation on Github unfortunately doesn't help me very much neither!

Thanks in advance for your help!

edit retag flag offensive close merge delete