Unable to transform between frames for which transform exists
Loading objects in the planning scene with moveit::planning_interface::PlanningSceneInterface::addCollisionObjects
results in error Unable to transform from frame 'world' to frame '/panda_link0'. Returning identity.
.
I tracked down the issue to moveit::core::getTransform which gets called by the interface which calls methods from
planning_scene
, here.At the same time, I'm 100% sure the transform exists before publishing the objects, because 1) prior to adding the object I sleep and spin until the transform is available; 2) I can see it if I
rosrun tf2_tools view_frames.py
.I tried to update moveit's internal map of transforms using
planning_scene_monitor::PlanningSceneMonitor::updateFrameTransforms()
, and checking the last update was recent withgetLastUpdateTime
(it is 0.2s - 0.25s ago); This issue discusses the same procedure.Restarting my node (only) doesn't display the error at all, so it really seems an "update" issue.
More details on what I might be doing wrong:
- I'm sending a collision object with
collision_object.header.frame_id = my_object.getPose().header.frame_id;
which is initialized elsewhere to be the string "world"; - I'm publishing the equivalent of writing this transform:
auto static_transform_stamped = geometry_msgs::TransformStamped {};
static_transform_stamped.header.stamp = ros::Time::now();
static_transform_stamped.header.frame_id = "world";
static_transform_stamped.child_frame_id = "panda_link0";
static_transform_stamped.transform.translation.x = 0.0;
static_transform_stamped.transform.translation.y = 0.0;
static_transform_stamped.transform.translation.z = 0.0;
static_transform_stamped.transform.rotation.w = 1.0;
static_transform_stamped.transform.rotation.x = 0.0;
static_transform_stamped.transform.rotation.y = 0.0;
static_transform_stamped.transform.rotation.z = 0.0;
on a topic and sending it (after aggregation happens) in a separate node (as per #310440) but, as I said previously, I'm also sleeping and spinning until said transform is live before even attempting to add objects to the collision scene.