This is a ROS1 port of the ROS2 Local Planner plugin. They are mostly the same, however the source code may differ due to the lack of similar API/functions within ROS1. Of course, that being said, we should all prepare to move to ROS2, yet a significant proportion of existing robots still utilise the ROS1 ecosystem, and since there is a lack of good pure pursuit planners out there, this port could prove to be a viable local planner replacement.
The Parameters are the same, please refer to the Nav2 Regulated Pure Pursuit Controller for more details
In no way did I write the original algorithm/source code, this originally developed by Shrijit Singh and Steve Macenski while at Samsung Research as part of the Nav2 working group.
In ROS2, the corresponding method is
computeVelocityCommands( const geometry_msgs::msg::PoseStamped & pose, const geometry_msgs::msg::Twist & speed, nav2_core::GoalChecker * goal_checker)
.
Where the robot velocity(speed
) is already supplied to the method, and the goal_checker already replacing the need for a isGoalReached()
method.
In the ported version, we have to use the ROS1 isGoalReached()
method to check for goals, and the robot velocity is obtained through the base_local_planner::OdometryHelperRos
API.
ROS2 uses setPlan(const nav_msgs::msg::Path & path)
, so we have to convert the global plan to a nav_msgs::path message type for further processing.
The original transformGlobalPlan from the Nav2 package when ported directly faced issues with extrapolation into the future when looking up the transform between /odom
and /map
frame. Therefore, the transformGlobalPlan method from TEB Local Planner has been adapted for use here as it provides a more reliable and faster way of transforming the global plan into the base frame of the robot.