correll / advancedrobotics

Advanced Robotics class repository
GNU General Public License v2.0
13 stars 5 forks source link

Set up Jaguar using tf #46

Closed bryanbocao closed 8 years ago

bryanbocao commented 8 years ago

tf

Setting up your robot using tf

Sub-issue of #36

bryanbocao commented 8 years ago

tf setup finished

screenshot from 2015-10-20 20 38 36 Set up Jaguar using tf--console.txt

Created the packages and files mentioned in the instruction Setting up your robot using tf

In the picture, the terminal on the left shows the building process by command in "/home/ubuntu/catkin_ws" directory:

catkin_make

The terminals on the right displays the result of running the code by command in three terminals respectively:

roscore
rosrun robot_setup_tf tf_broadcaster
rosrun robot_setup_tf tf_listener

The output in the right-bottom terminal shows a point being transformed from the "base_stewart" frame to the "base_link" frame once a second.


Note that in line 18 of code "/home/ubuntu/catkin_ws/src/robot_setup_tf/src/tf_broadcaster.cpp", three parameters in tf::Vector3(), which are 0.18, 0.0, 0.28, are measured roughly for now based on our design. Vector3 corresponds to the center of stewart's x offset of 18cm and z offset of 28cm from the robot base, which need to changed correctly when stewart is attached to the jaguar eventually.

15  while(n.ok()){
16    broadcaster.sendTransform(
17      tf::StampedTransform(
18        tf::Transform(tf::Quaternion(0, 0, 0, 1), tf::Vector3(0.18, 0.0, 0.28)),
19        ros::Time::now(),"base_link", "base_stewart"));
20    r.sleep();
21  }