ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How do latch transforms work?

asked 2013-09-27 11:25:47 -0600

rnunziata gravatar image

I am getting this error after publishing latch transforms for camera-link to base-link. The code is at the end of the errors...

[ERROR] [1380316527.758532146, 2.527000000]: Error getting latest time from frame 'camera_link' to frame 'base_link': Could not find a connection between 'base_link' and 'NO_PARENT' because they are not part of the same tree.Tf has two or more unconnected trees. (Error code: 2)
[ERROR] [1380316527.758625055, 2.527000000]: Error getting latest time from frame 'hokuyo_frame' to frame 'base_link': Could not find a connection between 'base_link' and 'NO_PARENT' because they are not part of the same tree.Tf has two or more unconnected trees. (Error code: 2)
[ERROR] [1380316527.767405664, 2.528000000]: Error getting latest time from frame 'camera_frame' to frame 'base_link': Could not find a connection between 'base_link' and 'NO_PARENT' because they are not part of the same tree.Tf has two or more unconnected trees. (Error code: 2)
[ERROR] [1380316527.767563302, 2.528000000]: Error getting latest time from frame 'camera_link' to frame 'base_link': Could not find a connection between 'base_link' and 'NO_PARENT' because they are not part of the same tree.Tf has two or more unconnected trees. (Error code: 2)
[ERROR] [1380316527.767687690, 2.528000000]: Error getting latest time from frame 'hokuyo_frame' to frame 'base_link': Could not find a connection between 'base_link' and 'NO_PARENT' because they are not part of the same tree.Tf has two or more unconnected trees. (Error code: 2)

My code is as follows:

  tf2_ros::StaticTransformBroadcaster static_broadcaster;
  geometry_msgs::TransformStamped msg;

  msg.header.stamp = ros::Time::now();
  msg.transform.rotation.x =  0.0;
  msg.transform.rotation.y =  0.0;
  msg.transform.rotation.z =  0.0;
  msg.transform.rotation.w =  1.0;

  msg.header.frame_id = "base_link";   
  msg.transform.translation.x = 0;
  msg.transform.translation.y = 0;
  msg.transform.translation.z = 0.1;
  msg.child_frame_id = "camera_link";
  static_broadcaster.sendTransform(msg);

  msg.header.frame_id = "camera_link";   
  msg.transform.translation.x = 0;
  msg.transform.translation.y = 0;
  msg.transform.translation.z = 0.2;
  msg.child_frame_id = "hokuyo_frame";
  static_broadcaster.sendTransform(msg);

  msg.header.frame_id = "camera_link";   
  msg.transform.translation.x = 0;
  msg.transform.translation.y = 0;
  msg.transform.translation.z = 0.3;
  msg.child_frame_id = "camera_frame";
  static_broadcaster.sendTransform(msg);
edit retag flag offensive close merge delete

Comments

Did you try broadcasting these frames from a launch file?

BennyRe gravatar image BennyRe  ( 2013-09-27 13:45:13 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-09-27 15:36:21 -0600

rnunziata gravatar image

In part this was caused by not bring up the node doing the latches before the rqt_gui which was bringing up rviz as default. Apparently this makes a difference. Now I am left with one error which I will place under a different question.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-09-27 11:25:47 -0600

Seen: 389 times

Last updated: Sep 27 '13