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 run
command. -
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.sh
for systemd service.params
: The name of the parameters file underparams
directory.launch
: The name of the launch file underlaunch
directory.use_root
: The flag to run the service as root. Iftrue
, the service will be run as root.
-
network
: The network parameters to createrunfile.sh
and 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.sh
script.
-
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-service
command before runfile.sh created, before service file created.The
custom.sh
will be run with sudo permission, and passes thesystem.yaml
file path andpackage path
as arguments.NOTE: The
system.yaml
file path indicates the file under package launcher directory.NOTE: The
package path
is the path of the package under the ROS2 workspace. -
script_after_build.sh
: Script that can be run after thebuild
command.The
script_after_build.sh
will be run with sudo permission, and passes thepackage path
as an argument. -
script_before_build.sh
: Script that can be run before thebuild
command.The
script_before_build.sh
will be run with sudo permission, and passes thepackage path
as an argument. -
source_env.sh
: Script that will be added to therunfile.sh
to source the environment.NOTE: The script will be added before the
ros2 launch
command.
The requirements files are used to install the dependencies for the package.
-
requirements_apt.txt
: The APT packages to install usingapt install
command. -
requirements_pip.txt
: The Python packages to install usingpython3 -m pip install
command.