Ask Your Question
1

roscore command not found

asked 2014-08-18 11:28:38 -0500

asiron gravatar image

Hey there,

I installed properly ROS Hydro, and I've been using it for quite a while. However, after coming to office the next day. I get the following error

zsh: command not found: roscore

This is weird because I am sourcing setup files for both ROS installation and catkin/rosbuild workspaces. Rosbuild is overlayed with catkin/devel. Also rosdep is working, and I have all enviromental variables except ROS_ROOT after launching new terminal. Thought exporting manually ROS_ROOT doesnt help, and when I source manually /opt/ros/hydro/setup.zsh and after rosbuild/setup.zsh or catkin/devel/setup.zsh, I lose all again.

I tried reinstalling ROS, but that didn't fix the problem.

Anyway had a similar problem?, because this sounds really weird to me.

edit retag flag offensive close merge delete

Comments

Are you sure you did setup ROS Environment?

dj0405 gravatar imagedj0405 ( 2014-08-18 19:36:09 -0500 )edit

7 Answers

Sort by ยป oldest newest most voted
4

answered 2014-08-19 12:53:59 -0500

ahendrix gravatar image

It sounds like your workspaces aren't nested properly for some reason. You may want to remove the build and devel folders in your catkin workspace, source /opt/ros/hydro/setup.bash, and then rebuild it.

edit flag offensive delete link more

Comments

I just upgraded from zesty/lunar to bionic/melodic, and removing ~/catkin_ws/devel worked for me

lalten gravatar imagelalten ( 2018-05-30 14:32:39 -0500 )edit
5

answered 2015-07-31 12:40:46 -0500

dmagree gravatar image

I was able to solve a similar problem by sourcing the main ros setup.bash file

source /opt/ros/jade/setup.bash

and then recompiling in my catkin workspace.

~/catkin_sw$ catkin_make

It seems that my workspace setup.bash was corrupted somehow.

edit flag offensive delete link more

Comments

This solved the problem for me.

Marijn gravatar imageMarijn ( 2015-08-25 02:39:59 -0500 )edit
1

But to me, I have to run this every time I restart my computer. Can this be sovled permanently?

Bill5785 gravatar imageBill5785 ( 2017-02-01 22:08:58 -0500 )edit

I don't know it if might be of any help but this happened to me because I use QtCreator as IDE and tried to compile my workspace with QtCreator which I didn't start from a terminal (although the tutorial clearly said you should :)). Maybe compiling with a bad environment breaks the workspace somehow

Marijn gravatar imageMarijn ( 2017-02-02 06:15:49 -0500 )edit

This solved the problem in ROS KINETIC on a JETSON TX2.

Thank you.

thepirate16 gravatar imagethepirate16 ( 2017-11-22 10:00:38 -0500 )edit

this worked for me; but I also had to source .bashrc after deleting build and devel

Void gravatar imageVoid ( 2018-05-03 15:58:16 -0500 )edit

Worked for me on Jetson Nano. Instead of jade use melodic. Thanks for sharing!

kumar_fc gravatar imagekumar_fc ( 2019-09-07 13:48:05 -0500 )edit
2

answered 2014-08-18 12:10:19 -0500

ahendrix gravatar image

updated 2014-08-19 00:32:58 -0500

command not found can mean that the binary in question could not be found, but it can also indicate that the interpreter for that binary was missing.

which roscore should tell you if the roscore binary can be found or not. If it isn't found for some reason, you should check that the ros-hydro-roslaunch package is installed. If it does exist, you should make sure that it actually exists and isn't a broken symlink or something.

roscore uses /usr/bin/python as the interpreter, so you should also check that you have a python interpreter installed.

UPDATE

On my system, roscore is located in /opt/ros/hydro/bin/roscore. If that file doesn't exist, there's something wrong with your installation, and you should reinstall roslaunch with sudo apt-get install --reinstall rod-hydro-roslaunch. If it does exist, you should make sure that /opt/ros/hydro/bin is in your PATH.

edit flag offensive delete link more

Comments

Thanks for fast response,

which roscore cannot find roscore, and ros-hydro-roslaunch is installed and up to date, also I have working python at /usr/bin/python.

asiron gravatar imageasiron ( 2014-08-18 12:29:17 -0500 )edit
0

answered 2014-08-19 00:49:19 -0500

I had the same problem I typed source /opt/ros/hydro/setup.bash in terminal then my problem solved :-)

edit flag offensive delete link more
0

answered 2018-05-03 16:12:39 -0500

Void gravatar image

updated 2018-05-04 06:23:55 -0500

I'm not sure if the source of this problem was specified, but I think it has something to do with running catkin_make with sudo. It created a setup.bash that wouldn't run with the /opt/ros/kinetic/setup.bash, probably because the sourcing of the workspace's setup.bash doesn't have sudo rights but the devel folder does.

Basically don't use sudo.

edit flag offensive delete link more

Comments

Basically don't use sudo.

I can't upvote this enough.

Yes: Don't. Use. Sudo.

gvdhoorn gravatar imagegvdhoorn ( 2018-05-04 03:41:42 -0500 )edit
0

answered 2014-08-19 05:24:48 -0500

asiron gravatar image

updated 2014-08-19 07:46:20 -0500

Ok I have roscore in /opt/ros/hydro/bin, and if I source /opt/ros/hydro/setup.zsh then it works, or if I manually add /opt/ros/hydro/bin to my $PATH, then it crashes because $PYTHONPATH is not setup correctly.

However, the problem is that sourcing either catkin_ws/devel/setup.zsh or rosbuild/setup.zsh breaks my general ROS enviromental variables, it overwrites them. For example I lose from $PYTHONPATH dist-packages, /opt/ros/hydro/bin from the $PATH, and so on.

Does anyone have similar issue ?

UPDATE:

I just don't want to edit all enviromental variables by hand after sourcing catkin_ws/rosbuild setup files, so there has to be one solution to it.

edit flag offensive delete link more
0

answered 2015-08-27 01:40:37 -0500

Marijn gravatar image

updated 2015-08-27 01:48:03 -0500

I encountered the same problem, solved it as described here (source setup.bash, remove build/ and devel/, build using catkin_make) but it kept coming back.

I use QTCreator to edit and build my code. Turned out the error arose because I launched QTCreator from the Ubuntu launcher instead of from a terminal in which the ROS environment is set up correctly.

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

1 follower

Stats

Asked: 2014-08-18 11:28:38 -0500

Seen: 19,547 times

Last updated: May 04 '18