ros-planning / navigation_experimental

Experimental navigation techniques for ROS robots.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: How to change frame from which global plan is planned with sbpl_lattice_planner?

Wimll opened this issue · comments

commented

Hi there!

In my current robot implementation, I need the global plan coming from the SBPLLatticePlanner to be planned from a different frame than base_frame. In the previous planner I used this was a parameter, i.e. I could define a different start point for the global plan. Is this something that is possible for the sbpl_lattice_planner?

Thanks!

Yes, the makePlan function accepts an arbitrary start pose:

/**
* @brief Given a goal pose in the world, compute a plan
* @param start The start pose
* @param goal The goal pose
* @param plan The plan... filled by the planner
* @return True if a valid plan was found, false otherwise
*/
virtual bool makePlan(const geometry_msgs::PoseStamped& start,
const geometry_msgs::PoseStamped& goal,
std::vector<geometry_msgs::PoseStamped>& plan);

Note that the pose has to have the same frame_id as the costmap's global frame ID. So perhaps you'll have to use tf to transform the pose before passing it to SBPL.

If I misunderstood you, and all you want to do is change the name of the link on your robot that's used for planning, that has nothing to do with SBPL, but move_base. You'll just have to change the move_base parameter global_costmap/robot_base_frame:

https://github.com/ros-planning/navigation/blob/4a3d261daa4e7eafa40bf7e4505f8aa8678d7bd7/move_base/src/move_base.cpp#L72

This works for all planners, including SBPL.

commented

Thank you for your swift reply!

I indeed just want to change the name from which the route is planned using SBPL, as my local planner also uses this different frame.

However, when I change the move_base parameter global_costmap/robot_base_frame the route still is planned from the base_frame instead of the frame I set it to be. Any idea what might be happening here?

Make sure that move_base is actually reading the parameter that you have set. I usually do the following in situations like this:

  1. Use rosautodoc as a man-in-the-middle to log which parameters are actually read.
  2. Use rosparam dump to see which parameters are set on the parameter server.
  3. Compare

Alternatively, use gdb to set a breakpoint on the line where the parameter is read in move_base and see what value is read.

Good luck!

commented

Thanks for the help Martin! This helps a lot. I will have a look into the debug tools you mentioned, I have never used these tools before (:

commented

Additionally, is there any way to set the spacing between 2 poses of the planned path using sbpl_lattice_planner? Or do I just have to change the motion primitives to get more spacing between 2 poses of the planned path?

commented

After going through the source code of move_base_flex I found the issue. By setting the robot_frame parameter, in addition to changing the global_costmap/robot_base_frame the route is planned correctly! So I'll close this issue for now, thanks for the help!