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

Rosrun tab autocompletion crashes terminal

asked 2018-10-08 07:11:27 -0500

pavel92 gravatar image

updated 2018-10-08 08:16:08 -0500

I have been using ROS Kinetic on Ubuntu 16.04 for some time now. After doing some kernel upgrades I run into a problem when running the rosrun command. When I hit the tab after writing rosrun the terminal freezes and crashes after few seconds. This does not happen for roslaunch or other ros commands. If I type the whole rosrun command with the node that I want to run it works as expected. Has anyone encountered this problem? There was a question regarding this that proposed some fixes that unfortunately did not work for me (deleting the contents of /var/crash and doing a clean build).

Edit:
The output of env |grep -i ros |sort is:

CMAKE_PREFIX_PATH=/home/pavel/catkin_ws/devel:/opt/ros/kinetic
LD_LIBRARY_PATH=/home/pavel/catkin_ws/devel/lib:/opt/ros/kinetic/lib:/opt/ros/kinetic/lib/x86_64-linux-gnu
PATH=/opt/ros/kinetic/bin:/home/pavel/bin:/home/pavel/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PKG_CONFIG_PATH=/home/pavel/catkin_ws/devel/lib/pkgconfig:/opt/ros/kinetic/lib/pkgconfig:/opt/ros/kinetic/lib/x86_64-linux-gnu/pkgconfig
PYTHONPATH=/home/pavel/catkin_ws/devel/lib/python2.7/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages
ROS_DISTRO=kinetic
ROS_ETC_DIR=/opt/ros/kinetic/etc/ros
ROS_MASTER_URI=http://localhost:11311
ROS_PACKAGE_PATH=/home/pavel/catkin_ws/src/pkg1:/home/pavel/catkin_ws/src/pkg2:......../opt/ros/kinetic/share
ROS_ROOT=/opt/ros/kinetic/share/ros
ROS_VERSION=1

where the ROS_PACKAGE_PATH contains a lot of packages, but to make it short I just put pkg1, pkg2.... in the output above.

edit retag flag offensive close merge delete

Comments

What is the output of env |grep -i ros |sort ?

Delb gravatar image Delb  ( 2018-10-08 07:55:58 -0500 )edit

I edited the question with the output

pavel92 gravatar image pavel92  ( 2018-10-08 08:16:28 -0500 )edit

Have you sourced your workspace ? The variable ROS_PACKAGE_PATH should be /home/pavel/catkin_ws/src:/opt/ros/kinetic/share

Delb gravatar image Delb  ( 2018-10-08 08:34:37 -0500 )edit

Try unset ROS_PACKAGE_PATH, and then source devel/setup.bash. Is the output the same ? (only for ROS_PACKAGE_PATH )

Delb gravatar image Delb  ( 2018-10-08 08:36:01 -0500 )edit

When I do a clean build ROS_PACKAGE_PATH gives only /opt/ros/kinetic/share . After I source the workspace I get the same package path that was shown in the question. When i unset the ROS_PACKAGE_PATH and source the workspace the package path is the same and the crash still occurs

pavel92 gravatar image pavel92  ( 2018-10-08 08:49:18 -0500 )edit

Have you modified your .bashrc ? Moreover have you run sudo apt-get update, then sudo apt-get upgrade and finally sudo apt-get autoremove ?

Delb gravatar image Delb  ( 2018-10-08 09:47:44 -0500 )edit

Did that but it did not help. I had this added in my .bashrc:

source /opt/ros/kinetic/setup.bash
source /home/pavel/catkin_ws/devel/setup.bash
pavel92 gravatar image pavel92  ( 2018-10-10 02:17:16 -0500 )edit

Can you just try to unset ROS_PACKAGE_PATH and then export ROS_PACKAGE_PATH=/home/pavel/catkin_ws/src:/opt/ros/kinetic/share (don't source your workspace after that and try the autocompletion) just to make sure the problem isn't with this variable not correctly set.

Delb gravatar image Delb  ( 2018-10-10 02:33:07 -0500 )edit

5 Answers

Sort by ยป oldest newest most voted
1

answered 2020-05-21 12:29:47 -0500

130s gravatar image

updated 2020-07-02 17:47:27 -0500

TLDR; Use ros-%ROS_DISTRO%-rosbash (e.g. ros-kinetic-rosbash) instead of rosbash.

Our team ran into the similar/same rosrun issue on Ubuntu 16.04 with ROS Kinetic. TLDR, we fixed by installing ros-kinetic-rosbash and removed "upstream" version of rosbash. Command-wise it was:

apt-get purge rosbash && apt-get autoremove
apt-get install ros-kinetic-rosbash

We found in our case rosrun was provided by rosbash (NOT the one hosted on ros.org)

$ which rosrun
/usr/bin/rosrun

After having installed the one from ros.org, I see the path I expect:

$ which rosrun
/opt/ros/kinetic/bin/rosrun

(The reason we had the upstream rosbash installed was that we installed it manually by our mistake.)

edit flag offensive delete link more
0

answered 2019-09-04 04:23:58 -0500

Anchellon gravatar image

Reinstalling ROS bash worked for me

sudo apt-get install --reinstall ros-kinetic-rosbash
edit flag offensive delete link more

Comments

I tried that but no luck so far

pavel92 gravatar image pavel92  ( 2019-09-18 03:35:39 -0500 )edit
0

answered 2019-06-22 10:25:47 -0500

Maybe a stupid solution but in my case uninstalling and reinstalling Ros helped.

sudo apt-get purge ros-kinetic-*

and then following the tutorial for installing again

edit flag offensive delete link more

Comments

I am aware that this is one of the solution but I am trying to pinpoint the source of the problem and avoid reinstalling ROS

pavel92 gravatar image pavel92  ( 2019-09-18 02:44:22 -0500 )edit
0

answered 2020-07-23 05:06:43 -0500

In my case, I just had a large amount of files in the package (was a neural network with many versions and logs). Removing unnecessary files fixed this.

edit flag offensive delete link more
0

answered 2020-07-02 07:56:32 -0500

Rebuilding my workspace worked for me:

catkin clean --yes -all

catkin build

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2018-10-08 07:11:27 -0500

Seen: 1,755 times

Last updated: Jul 02 '20