0
$\begingroup$

Rosanswers logo

Using Tully's suggestion, I am displaying a skeleton tracked by openni_tracker in RViz using the TF "Show Axes" option. The only trouble is my skeleton is appearing upside down. My Kinect is the head of my robot and so it is part of my URDF model. I am using Melonee's Kinect URDF code from an earlier posting within my model. Can anyone see from my files below why the skeleton appears upside down? (My Kinect is mounted right-side up on the robot and the point cloud has the correct orientation.)

Here are some of my key launch files:

kinect.launch:

<launch>
  <node pkg="openni_camera" type="openni_node" name="openni_camera" output="scre
en" respawn="true" >
     <!-- this line uses first enumerated device -->
    <param name="device_id" value="#1"/>
    <rosparam command="load" file="$(find openni_camera)/info/openni_params.yaml
" />
    <param name="rgb_frame_id" value="/openni_rgb_optical_frame" />
    <param name="depth_frame_id" value="/openni_depth_optical_frame" />
    <param name="use_indices" value="false" />
    <param name="depth_registration" value="true" />
    <param name="image_mode" value="8" />
    <param name="depth_mode" value="8" />
    <param name="debayering" value="2" />
    <param name="depth_time_offset" value="0" />
    <param name="image_time_offset" value="0" />
  </node>
</launch>

openni_tracker.launch:

<launch>
  <node pkg="openni_tracker" type="openni_tracker" name="openni_tracker" output=
"screen">
    <param name="camera_frame_id" value="/openni_depth_optical_frame" />
    <param name="tf_prefix" value="tracker" />
  </node>
</launch>

urdf.launch:

<launch>                                                                                    
      <param name="robot_description" command="$(find xacro)/xacro.py '$(find pi_demo)/urdf/pi_robot.urdf.xacro'" />                                               
        
      <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />                                                               
      <param name="/use_gui" value="True" />                                        
        
      <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher">                                                                       
        <param name="publish_frequency" value="20.0"/></node>                                                                       
                                                                               
      <node pkg="tf" type="static_transform_publisher" name="world_base_broadcaster" args="0 0 0.0325 0 0 0 /world /base_link 100" />                              
</launch>

And here is the section of my URDF model that I copied from Melonee's post with the only change being that I used "openni" instead of "kinect" in the link and joint names:

<xacro:my_box name="openni_link" lwh="0.06 0.26 0.035" xyz="0 0 0" rpy="0 0 0" mass="0.8" material="Gazebo/FlatBlack">
    <xacro:black />
</xacro:my_box>

<joint name="openni_depth_joint" type="fixed">
  <origin xyz="0 0.018 0" rpy="0 0 0" />
  <parent link="openni_link" />
  <child link="openni_depth_frame" />
</joint>

<link name="openni_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="openni_depth_optical_joint" type="fixed">
  <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
  <parent link="openni_depth_frame" />
  <child link="openni_depth_optical_frame" />
</joint>

<link name="openni_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>

<joint name="openni_rgb_joint" type="fixed">
  <origin xyz="0 -0.005 0" rpy="0 0 0" />
  <parent link="openni_link" />
  <child link="openni_rgb_frame" />
</joint>

<link name="openni_rgb_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="openni_rgb_optical_joint" type="fixed">
  <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
  <parent link="openni_rgb_frame" />
  <child link="openni_rgb_optical_frame" />
</joint>

<link name="openni_rgb_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>

Originally posted by Pi Robot on ROS Answers with karma: 4046 on 2011-04-02

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I believe this has been fixed recently on trunk of openni_kinect. There were several patches from miguelprada to improve the tracker, including this relevant patch:

https://code.ros.org/trac/ros-pkg/ticket/4994


Originally posted by kwc with karma: 12244 on 2011-06-17

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Pi Robot on 2011-06-20:
Thanks Ken--seems to work nicely now!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.