Using tf_prefix with MoveIt virtual joint?

asked 2018-06-13 09:36:44 -0500

drcra gravatar image

updated 2018-06-13 09:38:41 -0500

Description

I am trying to simulate two mobile robots, each with its own arm which I am trying to control with MoveIt. To organize the two robots, I am using namespacing on the nodes and topics, and using tf_prefix to delineate the separate TF trees. To connect each robot to the world, I would like to use a planar virtual joint from base_link to odom. However, when tf_prefix is applied outside the urdf, these frames become /h1_tf/base_link and /h1_tf/odom. As a result, the TF lookup fails to find the frames with:

[ WARN] [1528829858.191182394, 1630.340000000]: Unable to update multi-DOF joint 'virtual_joint': TF has no common time between '/odom' and 'base_link':

The corresponding section of the code is in "/planning_scene_monitor/src/current_state_monitor.cpp":

  const moveit::core::JointModel* joint = multi_dof_joints[i];
  const std::string& child_frame = joint->getChildLinkModel()->getName();
  const std::string& parent_frame =
      joint->getParentLinkModel() ? joint->getParentLinkModel()->getName() : robot_model_->getModelFrame();

  ros::Time latest_common_time;
  std::string err;
  if (tf_->getLatestCommonTime(parent_frame, child_frame, latest_common_time, &err) != tf::NO_ERROR)
  {
    ROS_WARN_STREAM_ONCE("Unable to update multi-DOF joint '"
                         << joint->getName() << "': TF has no common time between '" << parent_frame.c_str()
                         << "' and '" << child_frame.c_str() << "': " << err);
    continue;
  }

I've tried hacking the srdf, but that seems to mess up things upstream. Is there a way to get this functionality to work, or am I going to have to modify the code for my application?

Environment

  • ROS Distro: Kinetic
  • OS Version: Ubuntu 16.04
  • Binary build
  • 0.9.12-1xenial-20180530-071129-0800
edit retag flag offensive close merge delete

Comments

Any solution to this? Having the same issue.

atyshka gravatar image atyshka  ( 2018-08-20 14:00:40 -0500 )edit

Hi atyshka. There is no solution without modifying the code. You can see the thread between me and the MoveIt developer on their git repo. I have a working version but it's not a nice enough solution to push. Basically, I added params for tf_prefix for the two frames and appended them in the code.

drcra gravatar image drcra  ( 2018-08-21 09:58:47 -0500 )edit