0
$\begingroup$

Rosanswers logo

I've been trying to use Jetbrains CLion IDE for ROS programming, and for now it's working quite well. I'm able to run and debug ROS nodes, but I am having troubles with a node which uses the ImageTransport::subscribeCamera, which raises an exception when running it with the debugger.

The error message is:

[ INFO] [1448964578.745547058]: Connected to master at [localhost:11311]
Traceback (most recent call last):
  File "/opt/ros/indigo/bin/catkin_find", line 11, in <module>
    from catkin.find_in_workspaces import find_in_workspaces
ImportError: No module named catkin.find_in_workspaces
terminate called after throwing an instance of 'image_transport::TransportLoadException'
  what():  Unable to load plugin for transport 'raw', error string:
Could not find library corresponding to plugin image_transport/raw_sub. Make sure the plugin description XML file has the correct name of the library and that the library actually exists.
Signal: SIGABRT (Aborted)

This does not happen when the debugger is not used (i.e. running it from CLion with the 'play' button), and neither happens when debugging the binary with gdb in the command line, in which cases the node seems to run correctly. I suspect it may be due to the Import Error that is shown before the exception, though I have not much idea about why this could be. I'm running CLion from a ROS-ready bash terminal.

Any idea on this?

Thank you in advance.


Originally posted by gcc05 on ROS Answers with karma: 5 on 2015-12-01

Post score: 0


Original comments

Comment by deliang on 2016-12-08:
how to setup Clion to debug ROS nodes within it? thanks!

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Could be that for a debug session, CLion is overriding / purging the environment in which the node is run. If that is the case, the search paths are probably not set correctly / present, resulting in an import error at runtime.


edit: I'm not a CLion user, but looking at Creating and Editing Run/Debug Configurations and Run/Debug Configurations, it would seem you can configure Environment Variables for Run/Debug configurations. Would be a bit manual, but perhaps you can copy just enough ROS envvars to get things working.


Originally posted by gvdhoorn with karma: 86574 on 2015-12-01

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by gcc05 on 2015-12-01:
You are right, it resets PYTHONPATH to clion/bin/gdb/lib/python2.7 and PYTHONHOME to clion/bin/gdb. I could not find a way to make the bundled gdb use the environment variables, but a self compiled version of gdb 7.8 seems to do the trick... Being able to use the bundled one would be awesome though.

Comment by gcc05 on 2015-12-01:
(The edit) could also work (though I could not find all the set of variables needed). Looks easier for me to have a compiled gdb 7.8 and make CLion point at it, which is also project independent (I think the run configurations must be configured manually every time for each project). Thank you!

$\endgroup$
0
$\begingroup$

Rosanswers logo

I fixed this by going to file->settings-> build/execution/deployment->Toolchains, then setting the Debugger GDB to 'Use specified GDB' instead of the bundled version.

To find out which gdb to specify, on ubuntu type: $ which gdb and it should outline something like /usr/bin/gdb, then select this. Happy debugging!


Originally posted by lovelyhorse with karma: 11 on 2016-06-12

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.