An environment server must already be started for Lightning to work.
Also, make sure that the ROBOT environment variable and robot_description parameter are set for the machine that Lightning is running for.
To start lightning with the default parameters, run the following command:
roslaunch lightning lightning.launch
To start lightning with custom parameters, create a launch file and place the following line in it:
<include file="$(find lightning)/launch/lightning.launch">
Set the desired parameters after the above line:
<param name="<parameter_name>" value="<parameter_value>" />
robot_name (default=pr2)
Name of your robot. This determines which path librar(ies) to use.
step_size (default=0.02)
Step size to use between path points.
draw_points (default=false)
Set to true if rviz and the point_drawer node are being started and you want to view planning data in rviz. Otherwise, set it to false.
allowed_planning_time (default=20.0)
Timeout for planning.
collision_check_service/num_threads (default=4)
Number of threads to use for collision checking.
path_shortcutter_service/num_iterations (default=200)
Number of attempts to shortcut the path.
path_shortcutter_service/ignore_fraction (default=0.1)
The path shortcutter does not attempt to shortcut between two points if the current path between them is already almost a line. This parameter controls what the shortcutter thinks is "almost a line". The higher the value, the more path sections the shortcutter will not try to shortcut. This value must be in the interval (0, 1).
rr_node/num_rr_planners (default=2)
Number of planners used for retrieve-repair. If a retrieved path has multiple invalid sections, then those sections are replanned in parallel. This parameter specifies how many invalid sections are replanned in at one time. If there are more invalid sections than RR planners, then some go into a queue and are repaired when a planner finishes and becomes available. The planners must be started separately. If this value is changed, then ompl_planning.launch must also be changed. To start another planner, see the ompl_planning.launch file for an example.
rr_node/path_library_path_node_size (default=8)
Number of paths that can be stored in a single file for new libraries.
rr_node/path_library_sg_node_size (default=50)
Number of start-goal pairs that can be stored in a single file for new libraries. This must be higher than path_library_path_node_size.
rr_node/num_paths_to_collision_check (default=4)
Number of paths to that the library needs to collision check. The higher this value is, the more likely a better path will be retrieved for repair. However, the higher this value is, the more time will be needed to check collisions before a path can be repaired. It is recommended that this value is a multiple of collision_check_service/num_threads.
rr_node/dtw_distance (default=5.0)
This value determines how "different" repaired paths need to be so they are stored in the library. In general, more repaired paths will be stored if this value is lower.
rr_node/path_library_dir (default=$(find lightning)/src/pathlib/paths)
The library directory to use.
lightning/store_paths (default=true)
Set to false if you do not want to store paths in the library when planning.
lightning/use_RR (default=true)
Set to false if you do not want to use retrieve-repair.
lightning/use_PFS (default=true)
Set to false if you do not want to use planning-from-scratch.
Lightning uses the arm_navigation_msgs/GetMotionPlan service.
Lightning is a Service listening for requests on "lightning/lightning_get_path". In the request that is sent, only set the following fields:
The robot_name parameter and the joint_names provided in the GetMotionPlan request determine the path library that is used for retrieving paths and storing them. Different libraries are created and used for different combinations of robot_name and joint_names. Libraries are saved even after Lightning is shut down.
If you are using the same robot (and same joints) in different environments, make sure that the robot name parameter is unique for each different environment. Otherwise, path libraries for different environments will be mixed.
The Lightning planner does not currently handle position constraints or tolerances.
Lightning will return the planned path in trajectory.joint_trajectory.points.
In addition to having Lightning interface with the path librar(ies), you can as well.
There are three management actions for the librar(ies): storing a path, deleting a path, and deleting a library. When Lightning is running, send ManagePathLibrary service requests to "manage_path_library" to perform these actions.
Storing a path:
Deleting a path:
Deleting a library:
You can also delete a library from the command line when Lightning is not running.
roscd lightning
cd src/pathlib/paths
rm -r
command._lib_info
file in the library directory to be deleted are the right ones.