ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Extending bash completion for a command in rosbash (with catkin_add_env_hooks)

asked 2013-05-22 06:38:46 -0600

dornhege gravatar image

I plan to extend bash completion features for a common ros command (roslaunch) that already has completion defined in rosbash.

My first approach was to modify rosbash, which is quite generic and load my completion from there using rospack. Now, I found this commit using catkin_add_env_hooks to load completion scripts, which seems way more elegant.

First I am assuming this should work in any environment independent if catkin is used, correct?

The problem is that I am adding completion features instead of providing new completion. What is the correct way to do this?

I need to override the rosbash version here. rosbash is from 15.rosbash.bash, so I named my file 20.xxx and this seems to work, although I can't find any guarantees, especially about rosbash staying at 15. Maybe in the longrun the completion should be fully moved out of rosbash anyways and stay in the package that is completed?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-05-22 09:03:13 -0600

Dirk Thomas gravatar image

updated 2013-05-22 09:10:03 -0600

William gravatar image

Yes, in the long run it would make sense that each package provides its own completion. There is no "guarantee" that the rosbash env hooks will start with 15 but I don't see any reason why they should change.

So you can either:

  • create your own package which provides an env hook with a higher prefix than 15 or
  • contribute to the existing rosbash completion and send a pull request to improve the current completion which would be available to all ros users.
edit flag offensive delete link more

Comments

You have a pull request.

dornhege gravatar image dornhege  ( 2013-05-23 01:39:22 -0600 )edit

Question Tools

Stats

Asked: 2013-05-22 06:38:46 -0600

Seen: 422 times

Last updated: May 22 '13