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

why is tf frame changing?

asked 2012-08-13 14:40:57 -0600

DavidF gravatar image

updated 2016-10-24 09:00:49 -0600

ngrennan gravatar image

Hallo,

I am using a Kinect mounted on a PR2, ROS Electric and the openni_camera package from the openni_kinect stack. After starting the Kinect driver with

  • rgb_frame id: /openni_rgb_optical_frame and
  • depth_frame_id: /openni_depth_optical_frame

the published clouds both have the frame_id /openni_rgb_optical_frame.

Has someone an explanation for me?

Thanks David

pr2admin@kodiak-c1:/opt/ros/electric/stacks/openni_kinect/openni_camera/launch$ roslaunch openni_camera openni_node.launch

... logging to /u/pr2admin/.ros/log/bf52f8ea-e5a0-11e1-9e5c-001517ebc101/roslaunch-kodiak-c1-11445.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://kodiak-c1:55334/

SUMMARY

PARAMETERS * /rosdistro * /openni_node1/use_indices * /openni_node1/depth_registration * /openni_node1/image_time_offset * /openni_node1/depth_frame_id * /openni_node1/depth_mode * /openni_node1/debayering * /rosversion * /openni_node1/projector_depth_baseline * /openni_node1/rgb_frame_id * /openni_node1/depth_rgb_translation * /openni_node1/depth_time_offset * /openni_node1/image_mode * /openni_node1/shift_offset * /openni_node1/device_id * /openni_node1/depth_rgb_rotation

NODES / openni_node1 (openni_camera/openni_node) kinect_base_link (tf/static_transform_publisher) kinect_base_link1 (tf/static_transform_publisher) kinect_base_link2 (tf/static_transform_publisher) kinect_base_link3 (tf/static_transform_publisher)

auto-starting new master process[master]: started with pid [11471] ROS_MASTER_URI=http://c1:11311

setting /run_id to bf52f8ea-e5a0-11e1-9e5c-001517ebc101 process[rosout-1]: started with pid [11488] started core service [/rosout] process[openni_node1-2]: started with pid [11498] process[kinect_base_link-3]: started with pid [11501] process[kinect_base_link1-4]: started with pid [11502] process[kinect_base_link2-5]: started with pid [11503] process[kinect_base_link3-6]: started with pid [11505] [ INFO] [1344901438.735767926]: [/openni_node1] Number devices connected: 1 [ INFO] [1344901438.736005847]: [/openni_node1] 1. device on bus 002:09 is a Xbox NUI Camera (2ae) from Microsoft (45e) with serial id 'A00365902376048A' [ INFO] [1344901438.738526435]: [/openni_node1] searching for device with index = 1 [ INFO] [1344901438.783217136]: [/openni_node1] Opened 'Xbox NUI Camera' on bus 2:9 with serial number 'A00365902376048A' [ INFO] [1344901438.798280799]: rgb_frame_id = '/openni_rgb_optical_frame' [ INFO] [1344901438.800312236]: depth_frame_id = '/openni_depth_optical_frame'

===

pr2admin@kodiak-c1:~$ rostopic echo /camera/depth/points | grep frame
frame_id: /openni_rgb_optical_frame

pr2admin@kodiak-c1:~$ rostopic echo /camera/rgb/image_color | grep frame frame_id: /openni_rgb_optical_frame

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-08-13 15:04:05 -0600

updated 2012-08-13 15:06:12 -0600

Hi DavidF!

That is an easy one!! If you look into the file $(find openni_camera)/launch/openni_node.launch you will see that the parameter depth_registration is set to true:

<param name="depth_registration" value="true" />

This means that the depth image is being registered with the rgb image (so the pixels in both images represent the exact same points in the real world) and therefore both /camera/rgb/image_color and /camera/depth/points are now expressed in terms of /openni_rgb_optical_frame.

If you set that parameter to false, then /camera/depth/points will have frame_id = /openni_depth_optical_frame as you would expect.

I hope this was helpful. Martin.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-08-13 14:40:57 -0600

Seen: 391 times

Last updated: Aug 13 '12