Ask Your Question
2

ROS2 equivalents to ROS1 roscd, rosmsg rossrv...

asked 2020-08-03 11:00:08 -0500

screen33 gravatar image

updated 2020-08-03 11:20:37 -0500

Are there equivalent commands for roscd, rosmsg and rossrv (especially for rosmsg show), rosed, rosls and rosmv?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2020-08-03 13:57:46 -0500

sloretz gravatar image

There are equivalents for some of them. In ROS 2 they're all under the ros2 command.


rosmsg / rossrv

The equivalent to rosmsg/rossrv is ros2 interface.

$ rosmsg show std_msgs/Bool
bool data

ROS 2 equivalent

$ ros2 interface show std_msgs/msg/Bool
bool data

and for services

$ rossrv show std_srvs/Trigger
---
bool success
string message

ROS 2 equivalent

$ ros2 interface show std_srvs/srv/Trigger
---
bool success   # indicate successful run of triggered service
string message # informational, e.g. for error messages

And ros2 interface also works with actions

$ ros2 interface show test_msgs/action/Fibonacci
#goal definition
int32 order
---
#result definition
int32[] sequence
---
#feedback
int32[] sequence

rosed / roscd / rosls

In ROS 1 I think these were provided by rosbash: http://wiki.ros.org/rosbash

$ rosls std_msgs
cmake  msg  package.xml

There's nothing equivalent in ROS 2 that I know of. Maybe you could make a bash alias around ros2 pkg prefix?

$ ls `ros2 pkg prefix --share std_msgs`
cmake  environment  local_setup.bash  local_setup.dsv  local_setup.sh  local_setup.zsh  msg  package.dsv  package.xml

Here's a brief intro to the command line tools. https://index.ros.org/doc/ros2/Tutori...

If you'd like to contribute to them, most of the source code is in the ros2clirepo: https://github.com/ros2/ros2cli . Some tools are in other repos; for example ros2 launchis in the ros2/launch_ros repo: https://github.com/ros2/launch_ros/tr...

edit flag offensive delete link more

Comments

Yes alias ros2cd="ros2 pkg prefix" works but is not as handy as the original roscd: Autocompletion does not work and ros2cd alone either. Since we're in a Python subprocess, it can't work the same. Maybe opening a subshell? Not sure that would be nice though.

screen33 gravatar image screen33  ( 2020-08-05 19:54:35 -0500 )edit

ros2 pkg prefix <tab> does provide completion of all available package names. For a custom alias you will need to register the completion function yourself.

Dirk Thomas gravatar image Dirk Thomas  ( 2020-08-05 22:55:55 -0500 )edit
2

answered 2020-08-03 14:10:03 -0500

Dirk Thomas gravatar image

updated 2020-08-05 22:53:52 -0500

An equivalent to roscd is provided by colcon-cd- see https://github.com/colcon/colcon-cd/

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2020-08-03 11:00:08 -0500

Seen: 283 times

Last updated: Aug 05 '20