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

Revision history [back]

In your model for the kinect you need to create a fixed joint between the link that represents you model and the frame_id being published by the kinect node.

for example: <link name="kinect_link"> <visual> <geometry> <box size="0.064 0.121 0.0381"/> </geometry> <material name="Blue"/> </visual> <inertial> <mass value="0.0001"/> <origin xyz="0 0 0"/> <inertia ixx="0.0001" ixy="0.0" ixz="0.0" iyy="0.0001" iyz="0.0" izz="0.0001"/> </inertial> </link> <link name="kinect_link"> <visual> <geometry> <box size="0.064 0.121 0.0381"/> </geometry> <material name="Blue"/> </visual> <inertial> <mass value="0.0001"/> <origin xyz="0 0 0"/> <inertia ixx="0.0001" ixy="0.0" ixz="0.0" iyy="0.0001" iyz="0.0" izz="0.0001"/> </inertial> </link>

    <joint name="kinect_depth_joint" type="fixed">
      <origin xyz="0 0.028 0" rpy="0 0 0" />
      <parent link="kinect_link" />
      <child link="kinect_depth_frame" />
    </joint>

    <link name="kinect_depth_frame">
      <inertial>
          <mass value="0.0001" />
          <origin xyz="0 0 0" />
          <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
                   iyy="0.0001" iyz="0.0" 
                   izz="0.0001" />
      </inertial>
    </link>

    <joint name="depth_optical_joint" type="fixed">
      <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
      <parent link="kinect_depth_frame" />
      <child link="kinect_depth_optical_frame" />
    </joint>

    <link name="kinect_depth_optical_frame">
      <inertial>
          <mass value="0.0001" />
          <origin xyz="0 0 0" />
          <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
                   iyy="0.0001" iyz="0.0" 
                   izz="0.0001" />
      </inertial>
    </link>

Then based on the above urdf launch the kinect node with the following parameteres:

  <node pkg="openni_camera" type="openni_node" name="openni_camera" output="screen" respawn="true" >
    <param name="device_type" value="1" />
    <param name="registration_type" value="1" />
    <param name="point_cloud_resolution" value="1" />
    <param name="openni_depth_optical_frame" value="kinect_depth_optical_frame" />
    <param name="openni_rgb_optical_frame" value="kinect_rgb_optical_frame" />
    <param name="image_input_format" value="5" />
    <rosparam command="load" file="$(find openni_camera)/info/openni_params.yaml" />
  </node>

In your model for the kinect you need to create a fixed joint between the link that represents you model and the frame_id being published by the kinect node.

for example: example:

<link name="kinect_link"> <visual> <geometry> <box size="0.064 0.121 0.0381"/> </geometry> <material name="Blue"/> </visual> <inertial> <mass value="0.0001"/> <origin xyz="0 0 0"/> <inertia ixx="0.0001" ixy="0.0" ixz="0.0" iyy="0.0001" iyz="0.0" izz="0.0001"/> </inertial> </link> <link name="kinect_link"> <visual> <geometry> <box size="0.064 0.121 0.0381"/> </geometry> <material name="Blue"/> </visual> <inertial> <mass value="0.0001"/> <origin xyz="0 0 0"/> <inertia ixx="0.0001" ixy="0.0" ixz="0.0" iyy="0.0001" iyz="0.0" izz="0.0001"/> </inertial> </link>

 <joint name="kinect_depth_joint" type="fixed">
   <origin xyz="0 0.028 0" rpy="0 0 0" />
   <parent link="kinect_link" />
   <child link="kinect_depth_frame" />
 </joint>

 <link name="kinect_depth_frame">
   <inertial>
       <mass value="0.0001" />
       <origin xyz="0 0 0" />
       <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
                iyy="0.0001" iyz="0.0" 
                izz="0.0001" />
   </inertial>
 </link>

 <joint name="depth_optical_joint" type="fixed">
   <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
   <parent link="kinect_depth_frame" />
   <child link="kinect_depth_optical_frame" />
 </joint>

 <link name="kinect_depth_optical_frame">
   <inertial>
       <mass value="0.0001" />
       <origin xyz="0 0 0" />
       <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
                iyy="0.0001" iyz="0.0" 
                izz="0.0001" />
   </inertial>
 </link>

Then based on the above urdf launch the kinect node with the following parameteres:

  <node pkg="openni_camera" type="openni_node" name="openni_camera" output="screen" respawn="true" >
    <param name="device_type" value="1" />
    <param name="registration_type" value="1" />
    <param name="point_cloud_resolution" value="1" />
    <param name="openni_depth_optical_frame" value="kinect_depth_optical_frame" />
    <param name="openni_rgb_optical_frame" value="kinect_rgb_optical_frame" />
    <param name="image_input_format" value="5" />
    <rosparam command="load" file="$(find openni_camera)/info/openni_params.yaml" />
  </node>

In your model for the kinect you need to create a fixed joint between the link that represents you model and the frame_id being published by the kinect node.

for example:

<link name="kinect_link">
   <visual>
     <geometry>
       <box size="0.064 0.121 0.0381"/>
    0.0381" />
    </geometry>
     <material name="Blue"/>
    name="Blue" />
  </visual>
   <inertial>
       <mass value="0.0001"/>
    value="0.0001" />
      <origin xyz="0 0 0"/>
    0" />
      <inertia ixx="0.0001" ixy="0.0" ixz="0.0" ixz="0.0"
               iyy="0.0001" iyz="0.0" izz="0.0001"/>
    
               izz="0.0001" />
  </inertial>
 </link>
  <link name="kinect_link">
   <visual>
     <geometry>
       <box size="0.064 0.121 0.0381"/>
    0.0381" />
    </geometry>
     <material name="Blue"/>
    name="Blue" />
  </visual>
   <inertial>
       <mass value="0.0001"/>
    value="0.0001" />
      <origin xyz="0 0 0"/>
    0" />
      <inertia ixx="0.0001" ixy="0.0" ixz="0.0" ixz="0.0"
               iyy="0.0001" iyz="0.0" izz="0.0001"/>
    
               izz="0.0001" />
  </inertial>
    </link>

</link>

<joint name="kinect_depth_joint" type="fixed">
  <origin xyz="0 0.028 0" rpy="0 0 0" />
  <parent link="kinect_link" />
  <child link="kinect_depth_frame" />
</joint>

<link name="kinect_depth_frame">
  <inertial>
      <mass value="0.0001" />
      <origin xyz="0 0 0" />
      <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
               iyy="0.0001" iyz="0.0" 
               izz="0.0001" />
  </inertial>
</link>

<joint name="depth_optical_joint" type="fixed">
  <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
  <parent link="kinect_depth_frame" />
  <child link="kinect_depth_optical_frame" />
</joint>

<link name="kinect_depth_optical_frame">
  <inertial>
      <mass value="0.0001" />
      <origin xyz="0 0 0" />
      <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
               iyy="0.0001" iyz="0.0" 
               izz="0.0001" />
  </inertial>
</link>

Then based on the above urdf launch the kinect node with the following parameteres:

  <node pkg="openni_camera" type="openni_node" name="openni_camera" output="screen" respawn="true" >
    <param name="device_type" value="1" />
    <param name="registration_type" value="1" />
    <param name="point_cloud_resolution" value="1" />
    <param name="openni_depth_optical_frame" value="kinect_depth_optical_frame" />
    <param name="openni_rgb_optical_frame" value="kinect_rgb_optical_frame" />
    <param name="image_input_format" value="5" />
    <rosparam command="load" file="$(find openni_camera)/info/openni_params.yaml" />
  </node>

In your model for the kinect you need to create a fixed joint between the link that represents you your model and the frame_id being published by the kinect node.

for example:

<link name="kinect_link">
  <visual>
    <geometry>
      <box size="0.064 0.121 0.0381" />
    </geometry>
    <material name="Blue" />
  </visual>
  <inertial>
      <mass value="0.0001" />
      <origin xyz="0 0 0" />
      <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
               iyy="0.0001" iyz="0.0" 
               izz="0.0001" />
  </inertial>
</link>

<link name="kinect_link">
  <visual>
    <geometry>
      <box size="0.064 0.121 0.0381" />
    </geometry>
    <material name="Blue" />
  </visual>
  <inertial>
      <mass value="0.0001" />
      <origin xyz="0 0 0" />
      <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
               iyy="0.0001" iyz="0.0" 
               izz="0.0001" />
  </inertial>
</link>

<joint name="kinect_depth_joint" type="fixed">
  <origin xyz="0 0.028 0" rpy="0 0 0" />
  <parent link="kinect_link" />
  <child link="kinect_depth_frame" />
</joint>

<link name="kinect_depth_frame">
  <inertial>
      <mass value="0.0001" />
      <origin xyz="0 0 0" />
      <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
               iyy="0.0001" iyz="0.0" 
               izz="0.0001" />
  </inertial>
</link>

<joint name="depth_optical_joint" type="fixed">
  <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
  <parent link="kinect_depth_frame" />
  <child link="kinect_depth_optical_frame" />
</joint>

<link name="kinect_depth_optical_frame">
  <inertial>
      <mass value="0.0001" />
      <origin xyz="0 0 0" />
      <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
               iyy="0.0001" iyz="0.0" 
               izz="0.0001" />
  </inertial>
</link>

Then based on the above urdf launch the kinect node with the following parameteres:

  <node pkg="openni_camera" type="openni_node" name="openni_camera" output="screen" respawn="true" >
    <param name="device_type" value="1" />
    <param name="registration_type" value="1" />
    <param name="point_cloud_resolution" value="1" />
    <param name="openni_depth_optical_frame" value="kinect_depth_optical_frame" />
    <param name="openni_rgb_optical_frame" value="kinect_rgb_optical_frame" />
    <param name="image_input_format" value="5" />
    <rosparam command="load" file="$(find openni_camera)/info/openni_params.yaml" />
  </node>

In your model for the kinect you need to create a fixed joint between the link that represents your model and the frame_id being published by the kinect node.

for example:

<link name="kinect_link">
  <visual>
    <geometry>
      <box size="0.064 0.121 0.0381" />
    </geometry>
    <material name="Blue" />
  </visual>
  <inertial>
      <mass value="0.0001" />
      <origin xyz="0 0 0" />
      <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
               iyy="0.0001" iyz="0.0" 
               izz="0.0001" />
  </inertial>
</link>

<link name="kinect_link">
  <visual>
    <geometry>
      <box size="0.064 0.121 0.0381" />
    </geometry>
    <material name="Blue" />
  </visual>
  <inertial>
      <mass value="0.0001" />
      <origin xyz="0 0 0" />
      <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
               iyy="0.0001" iyz="0.0" 
               izz="0.0001" />
  </inertial>
</link>

<joint name="kinect_depth_joint" type="fixed">
  <origin xyz="0 0.028 0" rpy="0 0 0" />
  <parent link="kinect_link" />
  <child link="kinect_depth_frame" />
</joint>

<link name="kinect_depth_frame">
  <inertial>
      <mass value="0.0001" />
      <origin xyz="0 0 0" />
      <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
               iyy="0.0001" iyz="0.0" 
               izz="0.0001" />
  </inertial>
</link>

<joint name="depth_optical_joint" type="fixed">
  <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
  <parent link="kinect_depth_frame" />
  <child link="kinect_depth_optical_frame" />
</joint>

<link name="kinect_depth_optical_frame">
  <inertial>
      <mass value="0.0001" />
      <origin xyz="0 0 0" />
      <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
               iyy="0.0001" iyz="0.0" 
               izz="0.0001" />
  </inertial>
</link>

Then based on the above urdf launch the kinect node with the following parameteres:

  <node pkg="openni_camera" type="openni_node" name="openni_camera" output="screen" respawn="true" >
    <param name="device_type" value="1" />
    <param name="registration_type" value="1" />
    <param name="point_cloud_resolution" value="1" />
    <param name="openni_depth_optical_frame" value="kinect_depth_optical_frame" />
    <param name="openni_rgb_optical_frame" value="kinect_rgb_optical_frame" />
    <param name="image_input_format" value="5" />
    <rosparam command="load" file="$(find openni_camera)/info/openni_params.yaml" />
  </node>