Ask Your Question
0

3rd time getting stuck at "Building a ROS Package"

asked 2017-12-03 17:44:00 -0500

ju78iklo9 gravatar image

updated 2017-12-03 18:12:03 -0500

jayess gravatar image

Before I get to this section if I do a:

echo $ROS_PACKAGE_PATH

i get two paths:

/home/ju78iklo9/catkin_ws/src:/opt/ros/kinetic/share

But

By the time I get to Building a ROS Package and work down to:

catkin_make

I get the following output (for three complete beginning to here retries):

Base path://home/ju78iklo9/catkin_ws
Source space: //home/ju78iklo9/catkin_ws/src
The specified base path //home/ju78iklo9/catkin_ws contains a CMakeLists.txt but catkin_make must be invoked in the root of workspace

I have a killer ROS robot design but now I find myself repeating the same elementary ROS learning steps.

Now, again, for the 4th time (due to lab distractions)

Any help is appreciated as the non-industrial robot I intend to help design & build, although it would not likely be used at Starbucks to serve drinks, would likely help ROS (& community organizations) become a household name.

Thank you in advance for any assistance.

John

Note: The only path result I get after I get to Building Your Package and entering

echo $ROS_PACKAGE_PATH

is:

/opt/ros/kinetic/share
edit retag flag offensive close merge delete

Comments

1

I don't quite understand your question, but perhaps this will help: #q221538.

clyde gravatar image clyde  ( 2017-12-03 18:09:27 -0500 )edit

Are you referring to the "official" Building a ROS Package tutorial?

jayess gravatar image jayess  ( 2017-12-03 18:09:32 -0500 )edit

I agree with @clyde. What exactly is the question? There's a lot going on here but no clear question.

jayess gravatar image jayess  ( 2017-12-03 18:11:09 -0500 )edit

Also, what directory are you running catkin_make from? It needs to be in the root of your catkin workspace, i.e., ~/ju78iklo9/catkin_ws

jayess gravatar image jayess  ( 2017-12-03 18:13:27 -0500 )edit
2

The specified base path //home/ju78iklo9/catkin_ws contains a CMakeLists.txt [..]

and it shouldn't.

Check to make sure there is one. If there is, how did it get there?

gvdhoorn gravatar image gvdhoorn  ( 2017-12-04 01:09:23 -0500 )edit

@ju78iklo9: As @gvdhoorn pointed out, the root of your workspace should not contain a CMakeLists.txt. You may want to recreate your workspace following the tutorials.

jayess gravatar image jayess  ( 2017-12-04 01:37:09 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-12-06 19:23:27 -0500

Hi @ju78iklo9 ,

as mentioned in the comments, this happens because you have the CMakeLists.txt on the root folder of the workspace. In your case, /home/ju78iklo9/catkin_ws/CMakeLists.txt

The main CMakeLists.txt of the Workspace must be on the ~/catkin_ws/src/ folder, in your case, /home/ju78iklo9/catkin_ws/src/CMakeLists.txt

You problem is probably on the creation process of the workspace.

If you want to create a workspace from zero, you can do the following:

1. Rename the current ~/catkin_ws to ~/old_catkin_ws with:

mv ~/catkin_ws ~/old_catkin_ws

2. Create the new catkin_ws from zero with:

cd
mkdir catkin_ws/src -p
cd catkin_ws/
catkin_make

3. The ROS Packages you create must be on ~/catkin_ws/src, so, if you want create a package named example_pkg that depends on roscpp package, for example, you would do the following:

cd ~/catkin_ws/src/
catkin_create_pkg example_pkg roscpp

4. To compile the example_pkg package, you run:

cd ~/catkin_ws
catkin_make

That is it.

If you prefer to watch a video for a better understanding, I've created one here.

Ruben.

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: 2017-12-03 17:44:00 -0500

Seen: 1,002 times

Last updated: Dec 06 '17