Ask Your Question
0

gmapping node ignores tf2 static latch transforms

asked 2013-09-27 16:52:48 -0500

rnunziata gravatar image

updated 2013-10-27 08:41:26 -0500

Update: this seems to be true on any senor or odometric transformation requiring a link that is defined using a tf2 static latch transform. They work if defined using the static-transform-publisher but not if defined as tf2 latches. Can some confirm or reject this before I open ticket.

gmapping node ignores tf2 static latch transforms. If I code this transform as a tf2 static latch it is ignored but if specified via node input as shown below then the scanner data is transformed correctly.

<node pkg="tf" type="static_transform_publisher" name="hftf_broadcaster" args="1 0 0 0 0 0 base_link hokuyo_frame 100"/>

Note: the tf node above follows the my odometry node in the launch file that was issuing the same transform as a tf2 static latch in its main. It is the first node started in the launch sequence. Moving my latch transforms after gmapping node in the launch file made no difference.

    int main(int argc, char **argv)
    { 
      ros::init(argc, argv, "robot_odometry");

      // send static latch transformations 

      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 = "base_link";   // additional test transform
  //    msg.transform.translation.x = 0;     // but should not be needed as chain is
  //    msg.transform.translation.y = 0;     // hokuyo_frame->camera_link->base_link
  //    msg.transform.translation.z = 0.2;   // transforms are all specified
  //    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);


      PublishOdometry sp;


      ros::spin();

      return 0;
    }
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-10-07 07:37:12 -0500

rnunziata gravatar image

I opened a tick on gmapping.

edit flag offensive delete link more

Comments

This is related to setting tf2 static latch transforms in code and is related to question http://answers.ros.org/question/92026/static-latch-frames-not-shown-in-tf-frame-graph/.

rnunziata gravatar image rnunziata  ( 2013-10-30 12:08:50 -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

1 follower

Stats

Asked: 2013-09-27 16:52:48 -0500

Seen: 330 times

Last updated: Oct 27 '13