0
$\begingroup$

Rosanswers logo

Hi,

I'm new to ROS, and have been going through the tutorials. I decided I wanted to modify the behaviour of the Turtlesim demo application (having gotten the source from GitHub). I wanted to try 'catkin_make' using a target that has a bit more meat than the original example in ROS / Tutorials / BuildingPackages. I increased the precision of 'Pi' and made some changes to the 'draw_square' publisher.

The files I got from GIT are located in a folder inside my home directory. But 'catkin_make' gives an error when I try to make the project. I've tried copying the files over to the /opt/ros/hydro/share/turtlesim folder and using catkin_make there, but I get the same error as before.

The error I'm getting is:

The specified base path "/opt/ros/hydro/share/turtlesim" contains a CMakeLists.txt but "catkin_make" must be invoked in the root of workspace

From what I gather about ROS from the tutorials I've been through, I believe I am in the root of the workspace, and the parent folder is 'share'. I have tried 'catkin_init_workspace' and I get a message the CMakeLists.txt already exists. 'rospack find turtlesim' locates the project in /opt/ros/... so ros knows about my project.

Could someone please explain the above error and what I need to do in response.

Cheers, Nap

I'm not privileged enough to post a link that points to the same domain where I'm posting. :(


Originally posted by Nap on ROS Answers with karma: 302 on 2013-12-08

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

From your description I guess you are trying to invoke catkin_make in the folder where you checked out turtlesim. Instead you should create a workspace (as described here: http://wiki.ros.org/catkin/Tutorials/create_a_workspace) and checkout the packages under the src subfolder (as described here http://wiki.ros.org/catkin/Tutorials/using_a_workspace).

You should never try to build under /opt/ros/*. Always create and build your workspace somewhere in your home folder.


Originally posted by Dirk Thomas with karma: 16276 on 2013-12-09

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Nap on 2013-12-09:
@Dirk, thanks. Copying to /opt/ros/... was an attempt to overcome the error. Now that I've compiled it, how do I install it to /opt/ros/... so I can replace the original turtlesim? I used the "-DCMAKE_INSTALL_PREFIX=/opt/ros/hydro" option but it still went into the workspace's install folder.

Comment by Nap on 2013-12-09:
Got it.... 'source setup.sh' in the workspace's install folder did the trick.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.