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:
hook
folderdsv.in
filesh.in
file- using
ament_environment_hooks
in theCMakeLists.txt
file
.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
hooks
folder to your package - Add the
dsv.in
file to your package - Add the
sh.in
file to your package - Add the
ament_environment_hooks
to yourCMakeLists.txt
file - 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