Ask Your Question
1

`Frame id /base_link does not exist` in pr2 simulation

asked 2011-08-09 00:33:57 -0500

vincent gravatar image

updated 2011-08-09 04:12:29 -0500

I had pr2 robot running in gazebo.

I want to get the pose of r_wrist_roll_link with respect to base_link but got an error here.

$ rosrun tf tf_echo base_link r_wrist_roll_link
Failure at 146370.940000000
Exception thrown:Frame id /base_link does not exist! When trying to transform between   /r_wrist_roll_link and /base_link.
The current list of frames is:

At time 146371.172
- Translation: [0.590, -0.360, 0.930]
- Rotation: in Quaternion [0.651, -0.211, 0.381, 0.621]
        in RPY [1.475, -0.860, 0.310]
At time 146371.202
- Translation: [0.590, -0.360, 0.930]
- Rotation: in Quaternion [0.652, -0.210, 0.381, 0.621]
        in RPY [1.475, -0.860, 0.310]

Any idea what's the problem?

[UPDATE] It seems that it just can't find tf from base_link to r_wrist_roll_link at first, but then it gives the correct transform. I wrote some code to check the transform,

// get the position of r_wrist_roll_link
ros::Duration(0.1).sleep(); 
tf::StampedTransform transform;
try{
  listener.lookupTransform("base_link", "r_wrist_roll_link",
                           ros::Time(0), transform);
}   
catch (tf::TransformException ex){
  ROS_ERROR("%s",ex.what());
}

It works fine but if I comment out the line ros::Duration(0.1).sleep(), it gives same error as in tf_echo. Maybe it's because transform listener needs some time to get some frames. Not sure if that's the problem of tf_echo.

Here is the output of roswtf and view_frames shows both base_link and r_wrist_roll_link.

Loaded plugin tf.tfwtf
Package: supercontroller_keyboard
================================================================================
Static checks summary:

Found 1 warning(s).
Warnings are things that may be just fine, but are sometimes at fault

WARNING The following packages have msg/srv-related cflags exports that are no longer necessary
    <export>
        <cpp cflags="..."
    </export>:
 * motion_planning_msgs: -I${prefix}/msg/cpp -I${prefix}/srv/cpp
 * kinematics_msgs: -I${prefix}/msg/cpp -I${prefix}/srv/cpp
 * geometric_shapes_msgs: -I${prefix}/msg/cpp
 * mapping_msgs: -I${prefix}/msg/cpp


================================================================================
Beginning tests of your ROS graph. These may take awhile...
analyzing graph...
... done analyzing graph
running graph rules...
... done running graph rules
running tf checks, this will take a second...
... tf checks complete

Online checks summary:

Found 3 warning(s).
Warnings are things that may be just fine, but are sometimes at fault

WARNING The following node subscriptions are unconnected:
 * /head_traj_controller/point_head_action:
   * /head_traj_controller/point_head_action/cancel
   * /head_traj_controller/point_head_action/goal
 * /l_gripper_controller/gripper_action_node:
   * /l_gripper_controller/gripper_action/cancel
   * /l_gripper_controller/gripper_action/goal
 * /gazebo:
   * /head_traj_controller/joint_trajectory_action/cancel
   * /r_arm_controller/joint_trajectory_action/goal
   * /gazebo/set_link_state
   * /l_arm_controller/command
   * /projector_wg6802418_controller/image
   * /set_hfov
   * /torso_controller/joint_trajectory_action/cancel
   * /torso_controller/joint_trajectory_action/goal
   * /plugged_in    ================================================================================
Beginning tests of your ROS graph. These may take awhile...
analyzing graph...
... done analyzing graph
running graph rules...
... done running graph rules
running tf checks, this will take a second...
... tf checks complete

Online checks summary:

Found 3 warning(s).
Warnings are things that may be just fine, but are sometimes at fault

WARNING The following node subscriptions are unconnected:
 * /head_traj_controller/point_head_action:
   * /head_traj_controller/point_head_action/cancel
   * /head_traj_controller/point_head_action/goal
 * /l_gripper_controller/gripper_action_node:
   * /l_gripper_controller/gripper_action/cancel
   * /l_gripper_controller/gripper_action/goal
 * /gazebo:
   * /head_traj_controller/joint_trajectory_action/cancel
   * /r_arm_controller/joint_trajectory_action/goal
   * /gazebo/set_link_state
   * /l_arm_controller/command
   * /projector_wg6802418_controller/image
   * /set_hfov
   * /torso_controller/joint_trajectory_action ...
(more)
edit retag flag offensive close merge delete

Comments

Nobody publishes a /base_link transform. The simulation does this if working correctly. Can you add the output of roswtf and rosrun tf view_frames?
dornhege gravatar imagedornhege ( 2011-08-09 02:51:17 -0500 )edit
i've updated it
vincent gravatar imagevincent ( 2011-08-09 04:12:43 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
6

answered 2011-08-09 04:40:03 -0500

dornhege gravatar image

You said it already in your post. The listener needs to get the information first before it can transform.

Instead of the sleep you can use: waitForTransform.

edit flag offensive delete link more

Comments

from past experience, I remeber Transformer::waitForTransform(...) sometimes returns false and does not block, so you need while loop around the call.
hsu gravatar imagehsu ( 2011-08-09 07:57:22 -0500 )edit
thank you. yes i think hsu is right, since waitForTransform() did fail sometimes from my experience as well
vincent gravatar imagevincent ( 2011-08-09 11:46:39 -0500 )edit

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2011-08-09 00:33:57 -0500

Seen: 1,452 times

Last updated: Aug 09 '11