ROS: Welche Umgebungsvariablen modifiziert install/setup.sh tatsächlich?
Beim Ausführen von install/setup.sh oder install/local_setup.sh in ROS2 fragen Sie sich möglicherweise, welche Umgebungsvariablen tatsächlich modifiziert werden.
Die genauen Variablen können vom verwendeten Projekt abhängen. Für dieses Beispiel verwenden wir franka_description.
Bei Verwendung von entweder setup.sh oder local_setup.sh werden die folgenden Variablen modifiziert:
AMENT_PREFIX_PATH:[package]/install/[package]:wird vorangestelltCMAKE_PREFIX_PATH:[package]/install/[package]:wird vorangestelltCOLCON_PREFIX_PATH:[package]/installwird vorangestellt
Methode
trace-env.sh
cd franka_description
colcon build
printenv > a.env
source install/setup.sh
printenv > b.envJetzt können wir die Dateien diffen:
diff-env.sh
diff a.env b.envBeispielausgabe
Die Ausgabe ist in diesem Fall identisch für setup.sh und local_setup.sh:
env-diff.txt
76,77c76,77
< AMENT_PREFIX_PATH=/opt/ros/jazzy
< CMAKE_PREFIX_PATH=/opt/ros/jazzy/opt/gz_math_vendor:/opt/ros/jazzy/opt/gz_utils_vendor:/opt/ros/jazzy/opt/gz_cmake_vendor
---
> AMENT_PREFIX_PATH=/home/user/franka_description/install/franka_description:/opt/ros/jazzy
> CMAKE_PREFIX_PATH=/home/user/franka_description/install/franka_description:/opt/ros/jazzy/opt/gz_math_vendor:/opt/ros/jazzy/opt/gz_utils_vendor:/opt/ros/jazzy/opt/gz_cmake_vendor
81a82
> COLCON_PREFIX_PATH=/home/user/franka_description/install
Check out similar posts by category:
ROS
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow