This is an example package for RV2 Package Launcher Management.
rv2_package_example
├── include/rv2_package_example
│ └── ...
├── launch
│ └── launch.py
├── params
│ ├── params.yaml
│ └── system.yaml (optional)
├── scripts
│ ├── custom.sh (optional)
│ ├── script_after_build.sh (optional)
│ ├── script_before_build.sh (optional)
│ └── source_env.sh (optional)
├── src
│ └── ...
├── CMakeLists.txt
├── package.xml
├── requirements_apt.txt (optional)
├── requirements_pip.txt (optional)
└── ...
This directory contains launch files for the package. The launch file should contains the params_file or config_file argument to load the parameters.
This directory contains the parameters for the package. The parameters are stored in YAML format and can be loaded using the params_file or config_file argument in the launch file.
The files under this directory will be copied to the package launcher directory.
-
params.yaml: The parameters file for the package./**: ros__parameters: param1: "val1"
/**: The namespace for the parameters.ros__parameters: The ROS parameters format.param1: The parameter name and value.
NOTE: The file can be directly loaded using
ros2 runcommand. -
system.yaml: The system parameters to create the service file.launch: params: "params.yaml" launch: "launch.py" use_root: false network: interface: "eno1" internet_required: false custom: arg1: "val1"
-
launch: The required parameters to createrunfile.shfor systemd service.params: The name of the parameters file underparamsdirectory.launch: The name of the launch file underlaunchdirectory.use_root: The flag to run the service as root. Iftrue, the service will be run as root.
-
network: The network parameters to createrunfile.shand service file.interface: The network interface to use. The parameter will be added to the service file.internet_required: The flag to check the internet connection. Iftrue, the internet connection check will be added to therunfile.sh.
-
custom: The custom parameters forcustom.shscript.
-
This directory contains scripts that can be used to create service, runfile and build the package.
-
custom.sh: Custom script that can be run undercreate-servicecommand before runfile.sh created, before service file created.The
custom.shwill be run with sudo permission, and passes thesystem.yamlfile path andpackage pathas arguments.NOTE: The
system.yamlfile path indicates the file under package launcher directory.NOTE: The
package pathis the path of the package under the ROS2 workspace. -
script_after_build.sh: Script that can be run after thebuildcommand.The
script_after_build.shwill be run with sudo permission, and passes thepackage pathas an argument. -
script_before_build.sh: Script that can be run before thebuildcommand.The
script_before_build.shwill be run with sudo permission, and passes thepackage pathas an argument. -
source_env.sh: Script that will be added to therunfile.shto source the environment.NOTE: The script will be added before the
ros2 launchcommand.
The requirements files are used to install the dependencies for the package.
-
requirements_apt.txt: The APT packages to install usingapt installcommand. -
requirements_pip.txt: The Python packages to install usingpython3 -m pip installcommand.