rossrv show tab complete

asked 2018-12-21 23:39:22 -0500

jwin gravatar image

updated 2018-12-22 13:53:41 -0500

Is there a way to get rossrv show to have tab-complete functionality? Something like this would be nice: rossrv show <package_name> tab tab and then this lists the services in that package.

My current workaround is this: roscat <package_name> *.srv and then selecting the appropriate .srv file I want to look at (which I suppose isn't that bad either).

Here's the output of rossrv show tab tab:

102:roscpp_tutorials/    176:tf/                  19:control_msgs/         56:laser_assembler/      
67:nodelet/      120:rospy_tutorials/     181:tf2_msgs/            26:diagnostic_msgs/      
5:beginner_tutorials/    78:polled_camera/    164:sensor_msgs/         186:topic_tools/         
28:dynamic_reconfigure/  60:map_msgs/             99:roscpp/
173:std_srvs/            191:turtlesim/           33:gazebo_msgs/          66:nav_msgs/
edit retag flag offensive close merge delete

Comments

1

Just about every ros* command(let) has tab completion support. So if it's not working for you, something is wrong.

Which platform are you on? Which CPU arch? Which OS? How did you install ROS? Do you have bash-completion installed (assuming you are using bash of course)?

gvdhoorn gravatar image gvdhoorn  ( 2018-12-22 09:44:58 -0500 )edit

Sorry I should have been more clear. rossrv show does have tab completion support, but it shows the output above. When I try to enter something like the 5:beginner_tutorials entry or any of the other entries above it doesn't tab complete. Is this the same behavior on your machine?

jwin gravatar image jwin  ( 2018-12-22 13:54:40 -0500 )edit

I'm using ROS Kinetic and I'm running Ubuntu 16.04 on an x86 laptop. I installed ROS the way it was mentioned on the ROS tutorials wiki: sudo apt-get install ros-kinetic-desktop-full. I believe I have bash-completion? Not sure how to check. And yes I am running bash

jwin gravatar image jwin  ( 2018-12-22 13:58:52 -0500 )edit

It most likely doesn't auto-complete because that 5: is not supposed to be there.

Try this:

rossrv show beginner_tutorials <tab tab>

That should show you all the service defs in that package.

I don't know where those nrs come from. That would be something to investigate.

gvdhoorn gravatar image gvdhoorn  ( 2018-12-22 14:57:05 -0500 )edit

Right I've tried that too. In that case, <tab tab=""> doesn't produce any output (it doesn't tab-complete to anything). Perhaps something is wrong with my installation then if the numbers aren't supposed to be there?

jwin gravatar image jwin  ( 2018-12-22 15:25:21 -0500 )edit

Perhaps something is wrong with my installation then if the numbers aren't supposed to be there?

I only know that I've never seen auto-complete output show me those number prefixes. Perhaps something has changed in bash or on Ubuntu. You could see whether trying this in a Docker container ..

gvdhoorn gravatar image gvdhoorn  ( 2018-12-23 07:23:57 -0500 )edit

.. (osrf/ros:kinetic-desktop) does work (although I've had trouble getting auto-complete to work reliably in containers).

If you have another machine, you could try it there. Or in a VM.

gvdhoorn gravatar image gvdhoorn  ( 2018-12-23 07:24:36 -0500 )edit

Ok thanks for the help. I'll give that a shot if my workaround starts to get annoying.

jwin gravatar image jwin  ( 2018-12-23 21:34:59 -0500 )edit