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

Ros melodic setup.bash source error

asked 2018-06-01 00:03:39 -0500

z1huo gravatar image

updated 2018-06-01 12:40:49 -0500

gvdhoorn gravatar image

Hi GUYS!

I am using ROS melodic. I had a hard time with catkin package, specifically sourcing setup.bash. Hi GUYS, I am really struggling with setup.bash sourcing. I am using ROS melodic

I followed this tutorial: http://wiki.ros.org/ROS/Tutorials/Cre...

I got stuck in section 4, when I run $ . ~/catkin_ws/devel/setup.bash, it shows me:

bash: /home/z1huo/catkin_ws/devel/setup.bash: No such file or directory

That happens almost every time I tried source bash. I know how to get rid of the message in terminal using gedit. But I want to successfully source this setup.bash. Can someone help me out?


Edit: Than you!

I think I have went all the steps:

$ cd ~/catkin_ws/src
$ catkin_init_workspace
$ catkin_make
$ echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc

Before I typed in $ source ~/.bashrc Then it tells me

bash: /home/z1huo/catkin_ws/devel/setup.bash: No such file or directory
edit retag flag offensive close merge delete

Comments

2

First things to check:

  1. do you have a Catkin workspace?
  2. if yes: did you build it (catkin_make)?
  3. if yes: is it located at /home/z1huo/catkin_ws?
  4. if yes: are you using bash as your shell (probably yes)?
gvdhoorn gravatar image gvdhoorn  ( 2018-06-01 01:52:12 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-06-01 12:44:09 -0500

gvdhoorn gravatar image

updated 2018-06-01 12:44:28 -0500

I think I have went all the steps:

$ cd ~/catkin_ws/src
$ catkin_init_workspace
$ catkin_make

If you want ~/catkin_ws to be the root of your workspace, you need to run catkin_make in ~/catkin_ws, not in ~/catkin_ws/src.

In the steps you list, you never do cd ~/catkin_ws. So you remain in ~/catkin_ws/src, and catkin_make will create devel and build directories inside ~/catkin_ws/src.

Please do this:

rm -rf $HOME/catkin_ws/src/*
cd $HOME/catkin_ws
catkin_make

Now source ~/catkin_ws/devel/setup.bash should work.

Put new pkgs in ~/catkin_ws/src and run catkin_make again.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-06-01 00:03:39 -0500

Seen: 3,228 times

Last updated: Jun 01 '18