Robotics StackExchange | Archived questions

rosrun autocomplete show all src files.

when i try autocomplete at rosrun with tab key,

uesr@pc:~$ rosrun name-of-pkg [tab]
CMakeLists.txt             [executable_name]
main.cpp                      package.xml

what i expect is to see only the executable_name on autocomplete, but what i see is whole files in package folder in src

another happening :

i created 2 catkin workspace with a pkg

  1. create ws1/src/ws1pkg, do $ catkinmake

  2. then create ws2/src/ws2pkg, do $ catkinmake

  3. $ source ws1/devel/setup.bash -> can't autocomplete ws2_pkg

  4. new terminal $ source ws2/devel/setup.bash -> rosrun ws1_pkg shows up.

ws1_pkg shows up even if i sourced ws2 setup.bash

What's happening to me?

ubuntu 16.04, kinetic, reinstalled today

Asked by saga702 on 2018-07-17 01:55:14 UTC

Comments

Answers

I don't see why the autocompletion is an issue you do have your exectutable found.

For your workspaces issue it's totally normal you should read the environment variables wiki. I'm pretty sure if you run echo $ROS_PACKAGE_PATH you will have the ws1 path inside.

It's also mentionned (section 2.1) that :

These ordered paths tell the ROS system where to search for more ROS packages. If there are multiple packages of the same name, ROS will choose the one that appears on ROS_PACKAGE_PATH first.

So i'm pretty sure your ROS_PACKAGE_PATH looks like /homepath/ws1/src:/homepath/ws2/src:/opt/ros/kinetic/share

You sould get the paths in the right order and only the required ones.

Asked by Delb on 2018-07-17 02:38:13 UTC

Comments

What i want to see is just executable one. not cpp and txt files. This is not big problem, but it keeps annoying me

Asked by saga702 on 2018-07-17 02:51:14 UTC

Well after some research the autocompletion is related to devel/setup.bash so if your env variables are not correctly set (as you said with your workspaces issue) then both issue have the same resolution (ie properly set your ROS env variables)

Asked by Delb on 2018-07-17 03:54:43 UTC

self answer --

during backup and restore the workspaces, every files in workspaces turned into executable files.

So, changing the file's with chmod makes all problem solved.

with $ sudo chmod -R -x+X ./

Asked by saga702 on 2018-07-17 06:54:49 UTC

Comments