Ask Your Question
0

Having trouble with making openni_depth_frame a visable child of Baxter's head in Rviz

asked 2017-02-16 20:33:15 -0500

justmein gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-03-09 12:46:26 -0500

imcmahon gravatar image

updated 2017-03-09 12:47:58 -0500

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
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-02-16 20:33:15 -0500

Seen: 74 times

Last updated: Mar 09 '17