CS 378 - Autonomous Vehicles in Traffic I Week 8b - Transformations
Announcements ● I did not go through the 3 single person projects that I were on the slides on Monday ● Any thoughts about groups or projects yet? ○ Please send emails to me if you have any questions ● The rviz problems on the CS machines should now be resolved. ● If rviz crashes out unexpectedly or seg faults, remove ~/. rviz/* ● There seems to be a problem with rosmake art_run on non Oneiric systems. Run it without the --rosdep-install flag for now.
Transformations ● Transformations have typically played an important role in robotics and some computer vision applications ● Important for the idea of sensor registration ● Can be useful for verifying and understanding sensor readings.
Example 1 - Multiple Kinects [http://www.youtube.com/watch?v=5-w7UXCAUJE]
Example 2 - Line Detection (RoboCup) Input from Camera Detection How can we get rid of these spurious readings?
Example 2 (contd) How do we perform this projection? ● Proprioception gives us estimates of all the joints ● Assuming that the contact foot is on the ground - we can calculate the position and orientation of the camera w.r.t. to the ground.
The tf tree - PR2 Different coordinate represent either joints or other significant points of interest on the robot body. You have to define a given joint relative to some other joint or reference point. For instance, the elbow joint will be described relative to the shoulder joint. PR2 Robot [Image taken from http://www.ros.org/wiki/tf]
The tf tree - Marvin
The tf tree - Marvin ● How is this useful to us? ● The tf tree defines the relations between various sensors. ● Say if we want to fill point cloud data with color? ○ Terminal 1 ■ roscore ○ Terminal 2 ■ rosparam set /use_sim_time true ■ rosbag play --clock <bag-file> ○ Terminal 3 ■ rosrun velodyne_pointcloud cloud_node ■ (Remember to remap topics for older bag files) ○ Terminal 4 ■ rosmake rgb_pointcloud ■ rosrun rgb_pointcloud rgb_pointcloud_publisher _image_transport:=compressed
Future Ideas ● Change the tf tree ● (Automated Surveying) Figure out the correct position of the SICK Lidars ● (Automated Surveying) Automated registration of cameras wrt to velodyne ● (Velodyne Calibration) Incorporate pitch and roll determined through the calibration tool into the tf tree.
Onwards then! How to use the tf code? ● Go through the tf tutorials! ● http://www.ros.org/wiki/tf/Tutorials ● Even if you are not implementing tf - I recommend everyone complete the introduction to tf tutorial ○ http://www.ros.org/wiki/tf/Tutorials/Introduction%20to%20tf What does tf provide? ● tf maintains the relationship between coordinate frames in a tree structure buffered in time [http://www.ros.org/wiki/tf] ● It provides functions to transform points, vectors etc. from a coordinate frame to another. ● pcl_tf provides methods for transforming pcl data structures (yay!)
Some basic tf tools ● Viewing the tf tree ○ rosrun tf view_frames ○ evince frames.pdf ● Viewing a particular transformation ○ rosrun tf tf_echo <source_frame> <target_frame> ○ rosrun tf tf_echo /vehicle /velodyne ● Publishing a static transform ○ rosrun tf static_transform_publisher x y z yaw pitch roll frame_id child_frame_id period_in_ms ○ rosrun tf static_transform_publisher 5 0 0 0 0 0 /some_ref /vehicle 100 ● All of these are explained with an example in the introduction to tf tutorial.
Output of view_frames - Marvin
Using tf in code ● Publishing tf information ○ A simple example of publishing tf messages is art_common/src/vehicle_static_tf.cc ○ In this file we publish the same tf tree I showed earlier ● Keep in mind that there are 2 different conventions: ○ Regular Frame: +x is forward, +y is left, +z is up ○ Optical Frame: +z is forward, +x is right, +y is down ○ Both of these are still following the right handed convention!
The code
The code
The code
Subscribing to tf A simple example ● This is useful for transforming some simple data structures - or looking up the transformations themselves ● Check out the velodyne_pcl package to transform pointclouds
tf, rviz and messages ● Each message containing sensor data should have a frame_id corresponding to the tf frame it is in. ○ outMsg.header.frame_id = "some_frame_id"; ○ outMsg.header = inMsgPtr->header; ○ Some of you may be experiencing this problem in Assignment 3 ● Let's play around with tf in rviz.
Programming Assignment 4 discussion ● Let's take a look at the camera output from the car
Recommend
More recommend