`Frame id /base_link does not exist` in pr2 simulation
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 ...