Difference between revisions of "Setting up the ROS Transforms"
(→Navigation Stack Test) |
(→Navigation Stack Test) |
||
Line 91: | Line 91: | ||
Frame: webcam_sensor published by unknown_publisher Average Delay: -0.474375 Max Delay: 0 | Frame: webcam_sensor published by unknown_publisher Average Delay: -0.474375 Max Delay: 0 | ||
− | == map to odom transform == | + | === map to odom transform === |
− | + | See tf_map.launch script above to confirm the z value below | |
rosrun tf tf_echo map odom | rosrun tf tf_echo map odom | ||
At time 1492259778.541 | At time 1492259778.541 | ||
- Translation: [0.000, 0.000, 0.045] | - Translation: [0.000, 0.000, 0.045] | ||
+ | - Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000] | ||
+ | in RPY (radian) [0.000, -0.000, 0.000] | ||
+ | in RPY (degree) [0.000, -0.000, 0.000] | ||
+ | |||
+ | === odom to base_link === | ||
+ | |||
+ | The odom to base_link transform in all zeros at startup. | ||
+ | |||
+ | rosrun tf tf_echo odom base_link | ||
+ | At time 1492260129.428 | ||
+ | - Translation: [0.000, 0.000, 0.000] | ||
+ | - Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000] | ||
+ | in RPY (radian) [0.000, -0.000, 0.000] | ||
+ | in RPY (degree) [0.000, -0.000, 0.000] | ||
+ | |||
+ | === base_link to neato_laser === | ||
+ | |||
+ | See tf_laser.launch for how these were derived. | ||
+ | |||
+ | rosrun tf tf_echo base_link neato_laser | ||
+ | At time 1492260448.546 | ||
+ | - Translation: [0.202, 0.000, 0.111] | ||
+ | - Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000] | ||
+ | in RPY (radian) [0.000, -0.000, 0.000] | ||
+ | in RPY (degree) [0.000, -0.000, 0.000] | ||
+ | |||
+ | === base_link to laser_sensor | ||
+ | |||
+ | This is derived from the URDF and is the same as the base_link to the neato_laser. So I wonder whether the tf_laser.launch script is redundant. They fortunately give the same results. | ||
+ | |||
+ | rosrun tf tf_echo base_link laser_sensor | ||
+ | At time 1492260747.860 | ||
+ | - Translation: [0.202, 0.000, 0.111] | ||
- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000] | - Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000] | ||
in RPY (radian) [0.000, -0.000, 0.000] | in RPY (radian) [0.000, -0.000, 0.000] |
Revision as of 05:56, 15 April 2017
Contents
References
- ROS tf
- Coordinate Frames
- Tutorials
- TF Setup
- Transform Map to Odom
- Transform Odom to Base
- See lesson 5
Base_link to Laser
cat tf_laser.launch
<launch> <node pkg="tf" type="static_transform_publisher" name="base_to_laser" args="0.202 0 0.111 0 0 0 1 base_link neato_laser 100" /> </launch>
See floor_hugger.urdf URDF Representation of Floor Hugger
base_link => extended_base => Laser_layer => laser_sensor x = 0.004 + 0.000 + 0.192 + 0.006 = 0.202 z = 0.021 + 0.018 + 0.011 + 0.061 = 0.111
Odom to Base_link
TBD: Where is this specified? In Odometry?
Map to Odom
cat tf_map.launch
<launch> <node pkg="tf" type="static_transform_publisher" name="odom_to_map" args="0 0 0.045 0 0 0 1.0 map odom 100" /> </launch>
Wheel radius is 45 mm. Calibrate_Phidgets_Odometry#From_Specs
Setup
Terminal 1
roscore
Terminal 2
roslaunch floor_hugger nav.launch
Display Tree
Terminal 3
rosrun tf view_frames evince frames.pdf
Exploration Tools
monitor
Monitor the transforms between frames. See complete tree below.
rosrun tf tf_monitor All Broadcasters: Node: unknown_publisher 96.979 Hz, Average Delay: -0.260119 Max Delay: 0.102549 RESULTS: for all Frames Frames: Frame: base published by unknown_publisher Average Delay: -0.474372 Max Delay: 0 Frame: base_link published by unknown_publisher Average Delay: 0.000405951 Max Delay: 0.00156847 Frame: battery_layer published by unknown_publisher Average Delay: -0.474377 Max Delay: 0 Frame: camera_layer published by unknown_publisher Average Delay: -0.474374 Max Delay: 0 Frame: compute_layer published by unknown_publisher Average Delay: -0.474374 Max Delay: 0 Frame: computer published by unknown_publisher Average Delay: -0.474373 Max Delay: 0 Frame: control_layer published by unknown_publisher Average Delay: -0.474377 Max Delay: 0 Frame: extended_base published by unknown_publisher Average Delay: -0.474378 Max Delay: 0 Frame: laser_layer published by unknown_publisher Average Delay: -0.474373 Max Delay: 0 Frame: laser_sensor published by unknown_publisher Average Delay: -0.474372 Max Delay: 0 Frame: left_wheel published by unknown_publisher Average Delay: -0.474379 Max Delay: 0 Frame: neato_laser published by unknown_publisher Average Delay: -0.0996256 Max Delay: 0 Frame: odom published by unknown_publisher Average Delay: -0.0327469 Max Delay: 0.104149 Frame: right_wheel published by unknown_publisher Average Delay: -0.474377 Max Delay: 0 Frame: usb_hub published by unknown_publisher Average Delay: -0.474375 Max Delay: 0 Frame: webcam_sensor published by unknown_publisher Average Delay: -0.474375 Max Delay: 0
map to odom transform
See tf_map.launch script above to confirm the z value below
rosrun tf tf_echo map odom At time 1492259778.541 - Translation: [0.000, 0.000, 0.045] - Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000] in RPY (radian) [0.000, -0.000, 0.000] in RPY (degree) [0.000, -0.000, 0.000]
odom to base_link
The odom to base_link transform in all zeros at startup.
rosrun tf tf_echo odom base_link At time 1492260129.428 - Translation: [0.000, 0.000, 0.000] - Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000] in RPY (radian) [0.000, -0.000, 0.000] in RPY (degree) [0.000, -0.000, 0.000]
base_link to neato_laser
See tf_laser.launch for how these were derived.
rosrun tf tf_echo base_link neato_laser At time 1492260448.546 - Translation: [0.202, 0.000, 0.111] - Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000] in RPY (radian) [0.000, -0.000, 0.000] in RPY (degree) [0.000, -0.000, 0.000]
=== base_link to laser_sensor
This is derived from the URDF and is the same as the base_link to the neato_laser. So I wonder whether the tf_laser.launch script is redundant. They fortunately give the same results.
rosrun tf tf_echo base_link laser_sensor At time 1492260747.860 - Translation: [0.202, 0.000, 0.111] - Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000] in RPY (radian) [0.000, -0.000, 0.000] in RPY (degree) [0.000, -0.000, 0.000]
Display Complete Tree
Initial Test
Terminal 1
roscore
Terminal 2
Set sim time to false in case it was set to true during gmapping.
rosparam set use_sim_time false roslaunch floor_hugger odometry.launch
Terminal 3
rosrun xv_11_laser_driver neato_laser_publisher _port:=/dev/ttyUSB0 _firmware_version:=2
Terminal 4
roslaunch floor_hugger tf_laser.launch
Terminal 5
roslaunch floor_hugger tf_map.launch
Terminal 6
rosrun tf view_frames evince frames.pdf
Result is a file named frames.pdf.