-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Handle ROS config files - Proposal #75
Conversation
Great! This is also related to robotology/icub-models-generator#28 . Some comments:
|
See https://github.com/gerkey/ros1_external_use#installing-for-use-by-tools-like-roslaunch for a "official" way of deal with ROS packages without using Catkin . |
Thanks. I can add the dummy |
Yes, apparently in ROS documentation [1] they claim that the [1] : http://wiki.ros.org/ROS/EnvironmentVariables#ROS_PACKAGE_PATH |
This PR is a proposed way to handle the installation of ROS config files contained in a yarp repo.
NOTE: right now this PR handle launch and config files used ONLY BY ROS, and not by yarp applications.
Those files are in
config
andlaunch
folder placed in the root od the repo.This installer works in 4 different ways, depending on the PC's set-up
The 'package' (repo) is compiled and installed using plain CMake (the YARP way) and no special env var is set.
In this case the ROS config files will be installed using YARP standard paths, i.e. by mean of
${{PROJECT_NAME}_DATA_INSTALL_DIR}
In order to have ROS find this repo, the environment variable ROS_PACKAGE_PATH must be extended to include this folder.
The 'package' (repo) is compiled and installed using plain CMake (the YARP way) and the
ROS_WS
env var is set. (the nameROS_WS
can be changed to whatever we like)This approach works like the iCub-Common package, so all packages which need to install ROS config file, will place them in the folder pointed to by
ROS_WS
In order to have ROS find this repo at runtime, the environment variable
ROS_PACKAGE_PATH
must be extended to include this folder.This approach mimic the behaviour of iCubContribCommon, but uses an env var to achieve the goal. Obviously the behaviour can be changed to use the same approach used by contrib if we like it more. I used an env var because it was faster to implement.
The package is compiled using catkin ROS build system: this opens up 3 senarios:
- catkin_make: launch and config files are not copied/installed. Doing 'source devel/setup.*sh" the files in the src will be used.
- catkin_make install: launch and config files are installed in the install folder. Doing 'source devel/setup.*sh` the files in the install folder will be used.
- catkin build: similar to catkin_make build. It installs by default
In order to have ROS find this repo at runtime, the corresponding setup.bash have to be sourced, like in a normal catkin package.
The package is compiled with ament build system. This is experimental and things in ROS2 may vary before official release.
As stated in this page https://github.com/ros2/ros2/wiki/Migration-Guide ROS2 will not use xml launch files anymore, but python scripts instead. No ROS2 version of rosrun/roslaunch is ready yet. Right now we are installing launch and config files in ROS1 style for backward compatibility so the package can be compiled with ament and run with rosrun/launch for ROS1 modules.
There is some logic in the macro, so that the cmake is aware of what's going on and choose what to do depending on the environment it is compiled into.
For a package to use this installer it has to do:
It could be expanded to install other folders other then
config
andlaunch
. Filepackage.xml
is copied as well.