problems about local_planner.computeVelocityCommands

Skip to first unread message


Sep 12, 2017, 4:12:37 AM9/12/17
to ros-sig-navigation
Why I need to call goal_functions::transformGlobalPlan ,when I call the TrajectoryPlannerROS::computeVelocityCommands

I find this in function transformGlobalPlan

 // get plan_to_global_transform from plan frame to global_frame
      tf::StampedTransform plan_to_global_transform;
      tf.waitForTransform(global_frame, ros::Time::now(),
                          plan_pose.header.frame_id, plan_pose.header.stamp,
                          plan_pose.header.frame_id, ros::Duration(0.5));
      tf.lookupTransform(global_frame, ros::Time(),
                         plan_pose.header.frame_id, plan_pose.header.stamp, 
                         plan_pose.header.frame_id, plan_to_global_transform);

      //let's get the pose of the robot in the frame of the plan
      tf::Stamped<tf::Pose> robot_pose;
      tf.transformPose(plan_pose.header.frame_id, global_pose, robot_pose);

Does it mean that I don't need this function if my plan_pose.header.frame_id is global_frame 

and when I find this from global_planner when getting globalPlan in global_planner/planner_core.cpp

    for (int i = path.size() -1; i>=0; i--) {
        std::pair<float, float> point = path[i];
        //convert the plan to world coordinates
        double world_x, world_y;
        mapToWorld(point.first, point.second, world_x, world_y);

        geometry_msgs::PoseStamped pose;
        pose.header.stamp = plan_time;
        pose.header.frame_id = global_frame;
        pose.pose.position.x = world_x;
        pose.pose.position.y = world_y;
        pose.pose.position.z = 0.0;
        pose.pose.orientation.x = 0.0;
        pose.pose.orientation.y = 0.0;
        pose.pose.orientation.z = 0.0;
        pose.pose.orientation.w = 1.0;

in Bold line,the pose_header.frame_id is assigned global_frame

So,I have a idea that I don't need the function transformGlobalPlan if I got global plan in the global_frame. am I wrong?

David Lu!!

Sep 25, 2017, 10:06:47 PM9/25/17
to is probably the more appropriate venue for this, as
this list is very low traffic, but in short, the global_frame used by
the global_planner is the global costmap's frame (usually /map) and
the global_frame for the local planner is the local costmap's frame
(often /odom). So perhaps global_frame is not the most descriptive
variable name.
> --
> You received this message because you are subscribed to the Google Groups
> "ros-sig-navigation" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
> For more options, visit
Reply all
Reply to author
0 new messages