ros2 roscd feature
I do not found an equivalent to roscd in ros2. Is it implemented ? Does ament support that feature ?
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
I do not found an equivalent to roscd in ros2. Is it implemented ? Does ament support that feature ?
While a verb like cd
can easily be contributed to the ros2cli
tools the question is what should the semantic of that command be? In ROS 1 when using the devel space it brought you to the source folder of a package. In ROS 2 there is no concept of a devel space and after installing a package there is no correlation to the source space anymore. So the only possible location to switch to would be the install prefix of the package or the location where the package manifest is (in the subfolder share/<pkgname>
in the install space). I am just not sure how useful that would be...
Update:
The ros2
command is only available after installation and at that time the source code of packages is potentially not available anymore (and also its location is generally not known). Therefore I created a colcon
specific shell function named colcon_cd
which only operates on the filesystem and doesn't utilize any installed ROS workspace. The PR for this functionality is here: https://github.com/colcon/colcon-cd/p... Please feel free to comment / provide feedback on how it works for you - I am probably not a good tested of this functionality since I have never used roscd
in the first place.
It has not been implemented yet. It is likely that we will implement a command like that since many people find it useful. The underlying capabilities are definitely available from ament. (Try src/ament/ament_tools/scripts/ament.py list_packages ./src
)
A contribution of a verb cd
for the ros2
command would be appreciated. This is probably an easy way to get involved if anyone is interested.
Any news on this feature? I couldn't find it as a verb of the ros2 command.
Please read the accepted answer which describes why such a command isn't implemented.
Thank you for the answer! From the accepted answer it was not 100% clear to me whether this verb was in the development cue or not. Now, it is. Still, after developing with ROS2 for a couple of weeks I still miss such a verb to quickly navigate to source packages that I have checked out in an overlay. I liked that in ROS1, and some of my colleagues share the impression...
If https://github.com/colcon/colcon-core... gets implemented it would be possible to provide a function which goes to the source directory of the package within the same workspace (basically colcon list --packages-select <PKGNAME> --paths-only
if it returns exactly one path).
That would be great! I'll make sure to watch that issue. :)
For those who want a straightforward answer the terminal command colcon_cd mentioned in the older comments is now available
If you installed colcon as a debian package, run the following to source the command (or put in your ./.bashrc for convenience)
source /usr/share/colcon_cd/function/colcon_cd.sh
Then run
colcon_cd [package_name]
For the full installation instructions see:
Asked: 2017-12-11 09:51:51 -0600
Seen: 10,055 times
Last updated: Feb 04 '23
Is there a release date of ros 2 or more informations about it?
Is the planned ROS1 to ROS2/DDS bridge available yet?
ROS2: content-based topic subscriptions?
Building Ros 2.0 without OpenCV?
ros2 rttest example build error
ROS 2 Alpha 2 ros1_bridge using DDS between two computers