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

Revision history [back]

click to hide/show revision 1
initial version

hi, this solved my problem:

 tf::TransformListener listener;
 tf::StampedTransform transform;
 ros::NodeHandle node;
 const std::string target_frame = "base_link";
 const std::string original_frame = "camera_rgb_optical_frame";
 const ros::Time time = ros::Time(0);
 ros::Rate rate(10.0);
 while (node.ok()){
 try{
    listener.waitForTransform(target_frame, original_frame, time, ros::Duration(10.0));
    listener.lookupTransform(target_frame, original_frame, time, transform);
    break;
  }
 catch (tf::TransformException ex){
      ROS_ERROR("%s",ex.what());
 }
}

point = transform * point;

but when i put together the move to goal code, i realized Dan was right, in the code you can declare what ever frame you need and it works, just have to:

  goal.target_pose.header.frame_id = "camera_rgb_optical_frame";