From a5fc743166f88b10d454ac79fb77e40aef045e26 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 2 Sep 2021 12:17:31 +0200 Subject: [PATCH] Fix used values of AMENT_PREFIX_PATH (#868) --- CHANGELOG.md | 3 +++ cmake/template/addPathsToUserEnvVariables.ps1.in | 2 +- cmake/template/removePathsFromUserEnvVariables.ps1.in | 2 +- cmake/template/setup.bat.in | 2 +- cmake/template/setup.sh.in | 2 +- conda/multisheller/icub-models_activate.msh | 4 ++-- conda/multisheller/icub-models_deactivate.msh | 6 +++--- conda/multisheller/matlab-whole-body-simulator_activate.msh | 4 ++-- .../multisheller/matlab-whole-body-simulator_deactivate.msh | 4 ++-- doc/environment-variables-configuration.md | 2 +- 10 files changed, 17 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83308286d..040e9eec0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ The format of this document is based on [Keep a Changelog](https://keepachangelo ## [Unreleased] +### Fixed +- Fixed the values assigned to the `AMENT_PREFIX_PATH` environment variable for ROS2 compatibility (https://github.com/robotology/robotology-superbuild/pull/868). + ## [2021.08] - 2021-08-31 ### Added diff --git a/cmake/template/addPathsToUserEnvVariables.ps1.in b/cmake/template/addPathsToUserEnvVariables.ps1.in index 7c702ae5b..bfa8784a8 100644 --- a/cmake/template/addPathsToUserEnvVariables.ps1.in +++ b/cmake/template/addPathsToUserEnvVariables.ps1.in @@ -43,7 +43,7 @@ Add-ValueToUserEnvVariable BLOCKFACTORY_PLUGIN_PATH $ROBOTOLOGY_SUPERBUILD_INSTA # Setup to find resources in URDF and SDF files Add-ValueToUserEnvVariable ROS_PACKAGE_PATH $ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX"\share" -Add-ValueToUserEnvVariable AMENT_PREFIX_PATH $ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX"\share" +Add-ValueToUserEnvVariable AMENT_PREFIX_PATH $ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX Add-ValueToUserEnvVariable GAZEBO_MODEL_PATH $ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX"\share\gazebo\models" Add-ValueToUserEnvVariable GAZEBO_MODEL_PATH $ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX"\share\iCub\robots" Add-ValueToUserEnvVariable GAZEBO_MODEL_PATH $ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX"\share" diff --git a/cmake/template/removePathsFromUserEnvVariables.ps1.in b/cmake/template/removePathsFromUserEnvVariables.ps1.in index e395f9464..17c4a6c46 100644 --- a/cmake/template/removePathsFromUserEnvVariables.ps1.in +++ b/cmake/template/removePathsFromUserEnvVariables.ps1.in @@ -46,7 +46,7 @@ Remove-ValueFromUserEnvVariable BLOCKFACTORY_PLUGIN_PATH $ROBOTOLOGY_SUPERBUILD_ # Cleanup variables useful to find resources in URDF and SDF files Remove-ValueFromUserEnvVariable ROS_PACKAGE_PATH $ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX"\share" -Remove-ValueFromUserEnvVariable AMENT_PREFIX_PATH $ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX"\share" +Remove-ValueFromUserEnvVariable AMENT_PREFIX_PATH $ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX Remove-ValueFromUserEnvVariable GAZEBO_MODEL_PATH $ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX"\share\gazebo\models" Remove-ValueFromUserEnvVariable GAZEBO_MODEL_PATH $ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX"\share\iCub\robots" Remove-ValueFromUserEnvVariable GAZEBO_MODEL_PATH $ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX"\share" diff --git a/cmake/template/setup.bat.in b/cmake/template/setup.bat.in index 3cf14fc2c..b8aa55448 100644 --- a/cmake/template/setup.bat.in +++ b/cmake/template/setup.bat.in @@ -13,7 +13,7 @@ set BLOCKFACTORY_PLUGIN_PATH=%ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX%\@BLOCKFACTOR rem Variables to find resources in URDF and SDF files set "ROS_PACKAGE_PATH=%ROS_PACKAGE_PATH%;%ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX%\share" -set "AMENT_PREFIX_PATH=%AMENT_PREFIX_PATH%;%ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX%\share" +set "AMENT_PREFIX_PATH=%AMENT_PREFIX_PATH%;%ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX%" set "GAZEBO_MODEL_PATH=%GAZEBO_MODEL_PATH%;%ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX%\share\gazebo\models;%ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX%\share\iCub\robots;%ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX%\share" rem Bash completion diff --git a/cmake/template/setup.sh.in b/cmake/template/setup.sh.in index 84c82e4b7..cdcb1677f 100644 --- a/cmake/template/setup.sh.in +++ b/cmake/template/setup.sh.in @@ -25,7 +25,7 @@ export GAZEBO_RESOURCE_PATH=${GAZEBO_RESOURCE_PATH:+${GAZEBO_RESOURCE_PATH}:}${R @endcmakeif ROBOTOLOGY_USES_GAZEBO export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH:+${ROS_PACKAGE_PATH}:}${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/share -export AMENT_PREFIX_PATH=${AMENT_PREFIX_PATH:+${AMENT_PREFIX_PATH}:}${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/share +export AMENT_PREFIX_PATH=${AMENT_PREFIX_PATH:+${AMENT_PREFIX_PATH}:}${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX} export GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH:+${GAZEBO_MODEL_PATH}:}${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/share/gazebo/models:${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/share/iCub/robots:${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/share @cmakeif ROBOTOLOGY_ENABLE_ROBOT_TESTING diff --git a/conda/multisheller/icub-models_activate.msh b/conda/multisheller/icub-models_activate.msh index d09a52302..dd1732bd7 100644 --- a/conda/multisheller/icub-models_activate.msh +++ b/conda/multisheller/icub-models_activate.msh @@ -1,13 +1,13 @@ if_(is_set("COMSPEC")).then_([ sys.list_append("YARP_DATA_DIRS", path.join(env("CONDA_PREFIX"), "Library\\share\\iCub")), sys.list_append("ROS_PACKAGE_PATH", path.join(env("CONDA_PREFIX"), "Library\\share")), - sys.list_append("AMENT_PREFIX_PATH", path.join(env("CONDA_PREFIX"), "Library\\share")), + sys.list_append("AMENT_PREFIX_PATH", path.join(env("CONDA_PREFIX"), "Library")), sys.list_append("GAZEBO_MODEL_PATH", path.join(env("CONDA_PREFIX"), "Library\\share\\gazebo\\models")), sys.list_append("GAZEBO_RESOURCE_PATH", path.join(env("CONDA_PREFIX"), "Library\\share\\gazebo\\worls")) ]).else_([ sys.list_append("YARP_DATA_DIRS", path.join(env("CONDA_PREFIX"), "share/iCub")), sys.list_append("ROS_PACKAGE_PATH", path.join(env("CONDA_PREFIX"), "share")), - sys.list_append("AMENT_PREFIX_PATH", path.join(env("CONDA_PREFIX"), "share")), + sys.list_append("AMENT_PREFIX_PATH", env("CONDA_PREFIX")), sys.list_append("GAZEBO_MODEL_PATH", path.join(env("CONDA_PREFIX"), "share/gazebo/models")), sys.list_append("GAZEBO_RESOURCE_PATH", path.join(env("CONDA_PREFIX"), "share/gazebo/worls")) ]) diff --git a/conda/multisheller/icub-models_deactivate.msh b/conda/multisheller/icub-models_deactivate.msh index 58a7da015..f46a6c571 100644 --- a/conda/multisheller/icub-models_deactivate.msh +++ b/conda/multisheller/icub-models_deactivate.msh @@ -1,13 +1,13 @@ if_(is_set("COMSPEC")).then_([ sys.list_remove("YARP_DATA_DIRS", path.join(env("CONDA_PREFIX"), "Library\\share\\iCub")), sys.list_remove("ROS_PACKAGE_PATH", path.join(env("CONDA_PREFIX"), "Library\\share")), - sys.list_remove("AMENT_PREFIX_PATH", path.join(env("CONDA_PREFIX"), "Library\\share")), + sys.list_remove("AMENT_PREFIX_PATH", path.join(env("CONDA_PREFIX"), "Library")), sys.list_remove("GAZEBO_MODEL_PATH", path.join(env("CONDA_PREFIX"), "Library\\share\\gazebo\\models")), sys.list_remove("GAZEBO_RESOURCE_PATH", path.join(env("CONDA_PREFIX"), "Library\\share\\gazebo\\worls")) ]).else_([ sys.list_remove("YARP_DATA_DIRS", path.join(env("CONDA_PREFIX"), "share/iCub")), sys.list_remove("ROS_PACKAGE_PATH", path.join(env("CONDA_PREFIX"), "share")), - sys.list_remove("AMENT_PREFIX_PATH", path.join(env("CONDA_PREFIX"), "share")), + sys.list_remove("AMENT_PREFIX_PATH", env("CONDA_PREFIX")), sys.list_remove("GAZEBO_MODEL_PATH", path.join(env("CONDA_PREFIX"), "share/gazebo/models")), sys.list_remove("GAZEBO_MODEL_PATH", path.join(env("CONDA_PREFIX"), "share/iCub/robots")), sys.list_remove("GAZEBO_MODEL_PATH", path.join(env("CONDA_PREFIX"), "share")), @@ -26,4 +26,4 @@ if_(is_set("COMSPEC")).then_([ sys.list_remove("GAZEBO_MODEL_PATH", path.join(env("CONDA_PREFIX"), "Library\\share")) ]).else_([ sys.list_remove("GAZEBO_MODEL_PATH", path.join(env("CONDA_PREFIX"), "share")) -]) \ No newline at end of file +]) diff --git a/conda/multisheller/matlab-whole-body-simulator_activate.msh b/conda/multisheller/matlab-whole-body-simulator_activate.msh index 6b159ba2a..a89545128 100644 --- a/conda/multisheller/matlab-whole-body-simulator_activate.msh +++ b/conda/multisheller/matlab-whole-body-simulator_activate.msh @@ -1,12 +1,12 @@ if_(is_set("COMSPEC")).then_([ sys.list_append("YARP_DATA_DIRS", path.join(env("CONDA_PREFIX"), "Library\\share\\RRbot")), sys.list_append("ROS_PACKAGE_PATH", path.join(env("CONDA_PREFIX"), "Library\\share")), - sys.list_append("AMENT_PREFIX_PATH", path.join(env("CONDA_PREFIX"), "Library\\share")), + sys.list_append("AMENT_PREFIX_PATH", path.join(env("CONDA_PREFIX"), "Library")), sys.list_append("GAZEBO_MODEL_PATH", path.join(env("CONDA_PREFIX"), "Library\\share\\RRbot\\robots")) ]).else_([ sys.list_append("YARP_DATA_DIRS", path.join(env("CONDA_PREFIX"), "share/RRbot")), sys.list_append("ROS_PACKAGE_PATH", path.join(env("CONDA_PREFIX"), "share")), - sys.list_append("AMENT_PREFIX_PATH", path.join(env("CONDA_PREFIX"), "share")), + sys.list_append("AMENT_PREFIX_PATH", env("CONDA_PREFIX")), sys.list_append("GAZEBO_MODEL_PATH", path.join(env("CONDA_PREFIX"), "share/RRbot/robots")) ]) diff --git a/conda/multisheller/matlab-whole-body-simulator_deactivate.msh b/conda/multisheller/matlab-whole-body-simulator_deactivate.msh index 0c099b07d..8b2c35b9d 100644 --- a/conda/multisheller/matlab-whole-body-simulator_deactivate.msh +++ b/conda/multisheller/matlab-whole-body-simulator_deactivate.msh @@ -1,12 +1,12 @@ if_(is_set("COMSPEC")).then_([ sys.list_remove("YARP_DATA_DIRS", path.join(env("CONDA_PREFIX"), "Library\\share\\RRbot")), sys.list_remove("ROS_PACKAGE_PATH", path.join(env("CONDA_PREFIX"), "Library\\share")), - sys.list_remove("AMENT_PREFIX_PATH", path.join(env("CONDA_PREFIX"), "Library\\share")), + sys.list_remove("AMENT_PREFIX_PATH", path.join(env("CONDA_PREFIX"), "Library")), sys.list_remove("GAZEBO_MODEL_PATH", path.join(env("CONDA_PREFIX"), "Library\\share\\RRbot\\robots")) ]).else_([ sys.list_remove("YARP_DATA_DIRS", path.join(env("CONDA_PREFIX"), "share/RRbot")), sys.list_remove("ROS_PACKAGE_PATH", path.join(env("CONDA_PREFIX"), "share")), - sys.list_remove("AMENT_PREFIX_PATH", path.join(env("CONDA_PREFIX"), "share")), + sys.list_remove("AMENT_PREFIX_PATH", env("CONDA_PREFIX")), sys.list_remove("GAZEBO_MODEL_PATH", path.join(env("CONDA_PREFIX"), "share/RRbot/robots")) ]) diff --git a/doc/environment-variables-configuration.md b/doc/environment-variables-configuration.md index 95d465737..f32f8cc51 100644 --- a/doc/environment-variables-configuration.md +++ b/doc/environment-variables-configuration.md @@ -29,7 +29,7 @@ Just on Linux, you need to append `$ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX/lib` to while on macOS you need to append `$ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX/lib` to [`DYLD_LIBRARY_PATH`](https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/UsingDynamicLibraries.html). For what regards correctly loading resources in URDF files, you need to append `$ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX\share` to the -[`ROS_PACKAGE_PATH`](http://wiki.ros.org/ROS/EnvironmentVariables#ROS_PACKAGE_PATH) environment variable for [ROS1](https://www.ros.org/), and to [`AMENT_PREFIX_PATH`](http://design.ros2.org/articles/ament.html) for [ROS2](https://index.ros.org/doc/ros2/) +[`ROS_PACKAGE_PATH`](http://wiki.ros.org/ROS/EnvironmentVariables#ROS_PACKAGE_PATH) environment variable for [ROS1](https://www.ros.org/), and `$ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX` to [`AMENT_PREFIX_PATH`](http://design.ros2.org/articles/ament.html) for [ROS2](https://index.ros.org/doc/ros2/) To enable bash autocompletion, you need to add `$ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX\share` to `XDG_DATA_DIRS` environment variable.