Nav2 Navigation Stack - kilted
kilted
ROS 2 Navigation Stack
|
The scripts in this folder are used to generate the minimum control set for the state lattice planner. This work is based on Generating Near Minimal Control Sets for Constrained Motion Planning in Discrete State Spaces. An example of the trajectories for a grid resolution of 5cm and turning radius of 0.5m is shown below.
To install the required python packages run the following command
Run the primitive generator by using the following command
To adjust the settings to fit your particular needs you can edit the parameters in the config.json file. Alternatively, you can create your own file and pass it in using the –config flag.
The output file can be specified by passing in a path with the –output flag. The default is set to save in a file called output.json in the same directory as this README.
The directory to save the visualizations can be specified by passing in a path with the –visualizations flag.
Note: None of these parameters have defaults. They all must be specified through the config.json file.
motion_model (string)
The type of motion model used. Accepted values:
ackermann
: Only forward and reversing trajectoriesdiff
: Forward moving trajectories + rotation in place by a single angular binomni
: Forward moving trajectories + rotation in place by a single angular bin + sideways sliding motions turning_radius (float)
The minimum turning radius of the robot (in meters). Typical values for a service robot range from 0.4 to 1.0m.
grid_resolution (float)
The resolution of the grid (in meters) used to create the lattice. If the grid resolution is too large proportionally to the turning radius then the generator will not return a good result. This should be the same as your costmap resolution.
stopping_threshold (float)
Number of consecutive iterations without a valid trajectory before stopping the search. A value too low may mean that you stop searching too early. A value too high will cause the search to take longer. We found that stopping after 5 iterations produced the best results.
num_of_headings (float)
Number of discrete angular headings used. Due to the way discretization is done this number should be restricted to multiples of 8. Angles are not generated uniformly but instead generated in a way to facilitate straight lines. See angle discretization for more details. We believe 16 headings is a good number for most use cases.
The output file is a JSON file and contains the following fields:
version
The version number of the lattice generator that created the output file
date_generated
The date the output file was generated. Format: YYYY-MM-DD
lattice_metadata
A dictionary that contains information about the generated lattice. Most of this data comes from the config file used when generating the primitives. More information on each field is given in the Parameters section. Includes the following fields:
primitives
A list of dictionaries where each dictionary represents an individual motion primitive. Each motion primitive contains the following fields:
This section describes how the various portions of the generation algorithm works.
Dividing a full turn into uniform angular headings presents several problems. The biggest problem is that it will create angles for which a straight trajectory does not land nicely on an endpoint that aligns with the grid. Instead we discretize the angles in a way that ensures straight paths will land on endpoints aligned with the grid.
The image shows how the angular headings are generated. The same idea can be extended to a higher number of headings. As a result, the number of headings parameter is restricted to multiples of 8.
There are several checks we need to make to ensure a valid trajectory is generated:
The lattice generator is generally based on the generation of the control set as described in Generating Near Minimal Control Sets for Constrained Motion Planning in Discrete State Spaces. However, some changes were made to the above method. A brief outline of the implemented method is given below: