📐 Nav2 Planners Extensions#
pal_nav2_planners
package extends the nav2_plannersnav2_core::GlobalPlanner
.Function Planner#
FunctionPlanner
is a plugin which generates a path starting from a mathematical function defined by the user in the form y=f(x)
.nav2_planner
configuration file, or set them at runtime.std::vector<std::string>
that will be parsed with the use of theNote
This plugin is under-development. This first version only supports functions with the followin characteristics:
Monotonic functions
Continous functions
Explicit functions in the form
y=f(x)

Usage#
This plugin can be triggered sending an action goal to the /compute_path_to_pose.
The field of the goal message planner_id
must be set to 'FunctionPlanner'
.
$ ros2 action send_goal /compute_path_to_pose nav2_msgs/action/ComputePathToPose "goal:
header:
stamp:
sec: 0
nanosec: 0
frame_id: 'map'
pose:
position:
x: 0.0
y: 0.0
z: 0.0
orientation:
x: 0.0
y: 0.0
z: 0.0
w: 1.0
start:
header:
stamp:
sec: 0
nanosec: 0
frame_id: ''
pose:
position:
x: 0.0
y: 0.0
z: 0.0
orientation:
x: 0.0
y: 0.0
z: 0.0
w: 1.0
planner_id: 'FunctionPlanner'
use_start: false"
When setting use_start: false
the path will be planned using the robot pose as the initial pose,
meanwhile the last point, or goal, of the path
will be evaluated as the last point of the function defined in the range set by the user.
The FunctionPlanner
is added to the list of plugins in the nav2_planner
configuration file.
You can learn more on the
Nav2 Documentation.
planner_server:
ros__parameters:
#Other planner_server parameters
planner_plugins: ["FunctionPlanner"]
use_sim_time: ${use_sim_time}
expected_planner_frequency: 20.0
FunctionPlanner:
plugin: "pal_nav2_planners::FunctionPlanner"
interpolation_resolution: 0.1
functions: ["1-sqrt(1-x^2)", "1+sqrt(1-x^2)"]
ranges: "[[-1.0, 1.0], [-1.0, 1.0]]"
#Other FunctionPlanner parameters
#Other planner_server plugins
Configuration#
Parameter |
Description |
---|---|
|
Interpolation Step. |
|
Header frame ID of the resulting global path. |
|
Frame with respect to which the global path is evaluated, typically the robot frame. |
|
Vector of mathematical functions in form |
|
Ranges expressed in [min_val, max_val] for each function. |