ament
ament_environment_hooks
Using to manage the environment variables and more when we source the workspace. Read more and more
- Set environment variable
- Run custom script when the workspace is sourced
The setup includes:
hookfolderdsv.infilesh.infile- using
ament_environment_hooksin theCMakeLists.txtfile
.dsv
dsv (Developer setup variables) file it use to set up the environment variables for the package.
When we source the workspace, the dsv file will be executed and set up the environment variables.
Demo
Setup gazebo environment variables
- GZ_SIM_RESOURCE_PATH
Steps
- Add the
hooksfolder to your package - Add the
dsv.infile to your package - Add the
sh.infile to your package - Add the
ament_environment_hooksto yourCMakeLists.txtfile - Build, Source and check
| CMakeLists.txt | |
|---|---|
| ros_gz_example_description.dsv.in | |
|---|---|
| ros_gz_example_description.sh.in | |
|---|---|
check
- Build using colcon
- Source install folder