Integration of Gazebo kinect plugin with custom robot

asked 2020-03-25 12:02:36 -0500

verena gravatar image


I use ROS kinetic on a VMware virtual machine running Ubuntu 16.04 and Gazebo 7.16.0

I am having some issues while integrating the Gazebo kinect plugin with my custom robot simulation. I installed the kinect plugin properly and checked it with the Turtlebot Gazebo simulation:

roslaunch turtlebot_gazebo turtlebot_world.launch

The camera topics are published and I can view them using rviz.

In the following I use the turtlebot xacros as a reference for integrating the kinect with my custom robot simulation. First, I only spawn the kinect urdf along with the plugin to Gazebo. Here is the corresponding xacro:

<?xml version="1.0" ?>
<robot name="mpo_700" xmlns:xacro="">

  <xacro:include filename="$(find turtlebot_description)/urdf/turtlebot_common_library.urdf.xacro" />
  <xacro:property name="kinect_cam_py" value="-0.0125"/>
  <joint name="camera_rgb_joint" type="fixed">
      <origin xyz="${cam_px} ${kinect_cam_py} ${cam_pz}" rpy="${cam_or} ${cam_op} ${cam_oy}"/>
      <parent link="${parent}"/>
      <child link="camera_rgb_frame" />
    <link name="camera_rgb_frame"/>
<joint name="camera_rgb_optical_joint" type="fixed">
  <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
  <parent link="camera_rgb_frame" />
  <child link="camera_rgb_optical_frame" />
<link name="camera_rgb_optical_frame"/>

<joint name="camera_joint" type="fixed">
  <origin xyz="-0.031 ${-kinect_cam_py} -0.016" rpy="0 0 0"/>
  <parent link="camera_rgb_frame"/>
  <child link="camera_link"/>
  <link name="camera_link">
   <origin xyz="0 0 0" rpy="0 0 ${M_PI/2}"/>
     <mesh filename="package://turtlebot_description/meshes/sensors/kinect.dae"/>
    <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
      <box size="0.07271 0.27794 0.073"/>
    <mass value="0.564" />
    <origin xyz="0 0 0" />
    <inertia ixx="0.003881243" ixy="0.0" ixz="0.0"
             iyy="0.000498940" iyz="0.0"
             izz="0.003879257" />

<!-- The fixed joints & links below are usually published by static_transformers launched by the OpenNi launch 
     files. However, for Gazebo simulation we need them, so we add them here.
     (Hence, don't publish them additionally!) -->
<joint name="camera_depth_joint" type="fixed">
  <origin xyz="0 ${2 * -kinect_cam_py} 0" rpy="0 0 0" />
  <parent link="camera_rgb_frame" />
  <child link="camera_depth_frame" />
<link name="camera_depth_frame"/>

<joint name="camera_depth_optical_joint" type="fixed">
  <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
  <parent link="camera_depth_frame" />
  <child link="camera_depth_optical_frame" />

<link name="camera_depth_optical_frame"/>

    <!-- camera -->
      <gazebo reference="camera_link">
    <sensor type="depth" name="camera1">

             <plugin name="camera_controller" filename="">
            <pointCloudCutoff>0 ...
edit retag flag offensive close merge delete