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

Netbeans, ROS and debug

asked 2014-04-16 00:05:23 -0500

mark_vision gravatar image

updated 2014-04-28 21:15:20 -0500

Hi guys, I want to develop and debug packages in ROS with Netbeans. I followed the Instructions at link text but I have some questions:

catkin_make is creating all his stuff inside my myworkspace/build/mypackage (caktin, catkin_generated, MakeFile, etc.) and the executable in myworkspace/devel/lib/mypackage

but if I do it with Netbeans, all this stuff is inside myworkspace/src/mypackage.

Is this a problem (e.g., ambiguity during compiling/running)?

When I compile with Netbeans and then with catkin_make rosrun says that there are two executables and I have to choose. Is there a way to do something clean (e.g., putting all catkin/cmake/make stuff in a separate folder and the executable in a folder like mypackage/bin even if I call catkin_make on the workspace? Why catkin is forcing us to have one place to compile all the packages in a folder far from them?

EDIT: After losing so much time I ended with this solution (I hope will be appreciated):

File -> New Project -> New Project with existing source

Next

In the folder with existing source myworkspace/src/mypackage

Custom

Next

configure script: myworkspace/src/CMakeLists.txt This is the GLOBAL cmakefile of ROS, not the package one

configure arguments: -DCATKIN_DEVEL_PREFIX=myworkspace/devel WITH ABSOLUTE PATH

run the configure script in subfolder: ../build so that he's pointing to the global build space

Next until the end

This is the best I could. If anybody knows a CLEAN method to specify programmatically where to put Build Space, Devel Space and Install space inside the project CMakeLists.txt, please tell me

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-04-16 08:05:28 -0500

William gravatar image

Those instructions sounds pretty specific to rosmake, so they probably aren't designed to work with catkin. I don't use Netbeans so I might not get all this right, but it seems to me the biggest change is that you need to tell Netbeans to run CMake in myworkspace/build/package rather than in myworkspace/src/package where it is now. There may be other issues involved, but that would be the first thing.

If you are working on a single package then you can treat it like a plain cmake package and these instructions will likely work:

http://stackoverflow.com/a/8027379

This doesn't allow it to work with a catkin workspace, but it is a step in the right direction.

If you are using catkin_make then you'll have a boilerplate CMakeLists.txt in myworkspace/src, so if you point Netbeans at that "CMake project" then you can mimic the behavior of catkin_make by:

  • running cmake in myworkspace/build
  • passing -DCATKIN_DEVEL_SPACE=../devel to cmake
  • passing -DCMAKE_INSTALL_PREFIX=../install to cmake

Maybe some of that helps.

edit flag offensive delete link more

Comments

I found your solution reasonable. I tried it but there's something wrong. Since Netbeans oblige me to run the cmake only on a subfolder of myworkspace/src/mypackage I created a soft link that points to myworkspace/build/mypackage and effectively all the stuff is going into the right place. But then cmake says that there's no Cmakelists.txt to process, looking for it inside myworkspace/build even if I never told that path to it...

mark_vision gravatar image mark_vision  ( 2014-04-17 00:40:43 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-04-16 00:05:23 -0500

Seen: 1,111 times

Last updated: Apr 28 '14