0
$\begingroup$

Rosanswers logo

I'm using a kinect with Baxter. I am having a problem getting baxter to move one of its hands to a humans hand to grab something from it.

In order to track people I am using openni.launch from the package openni_launch openni_tracker from the package openni_tracker.

After I add a tf display to Rviz: I can successfully view the skeleton of a user in rviz when the fixed frame is 'openni_depth_frame'. I can see the model of Baxter if the fixed frame is one of the frames that make up Baxter's tf model.

I wrote a script making 'openni_depth_frame' a child of 'head' (since the kinect is attached to the top of Baxter's head). I have verified that this works by seeing that 'openni_depth_frame' is a child of 'head' in rqt_tf_tree after running this script.

However, I expected to see both the 'openni_depth_frame' frame and the frames that make up the user openni_tracker is tracking at the same time I can see baxter's model. Am I incorrect in thinking that? Or does tf not work that way?


Originally posted by justmein on ROS Answers with karma: 1 on 2017-02-16

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

You'll need to add a static transform between any frame on Baxter and openni_depth_frame. That will tell RViz (and all other ROS tools that use TF) how your camera is attached to the robot. You can invoke the static transform publisher through the commandline:

Usage: static_transform_publisher x y z qx qy qz qw frame_id child_frame_id 
OR 
Usage: static_transform_publisher x y z yaw pitch roll frame_id child_frame_id

for instance:

$ rosrun tf2_ros static_transform_publisher 0.15 0.075 0.5 0.0 0.7854 0.0 /head /openni_depth_frame

Or through a launch file named something like static_depth_tf.launch:

<launch>
     <!-- Users update this value to set transform between camera and robot -->  
     <arg name="camera_link_pose" default="0.15 0.075 0.5 0.0 0.7854 0.0"/>  
     <arg name="camera_link_name" default="/openni_depth_frame"/>  
     <arg name="robot_link_name" default="/head"/>  
     <node pkg="tf2_ros" type="static_transform_publisher" name="camera_link_broadcaster"  
               args="$(arg camera_link_pose) $(arg robot_link_name) $(camera_link_name)" />  
</launch>

And then invoke it with

$ roslaunch static_depth_tf.launch

Originally posted by imcmahon with karma: 790 on 2017-03-09

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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