Skip to content
This repository has been archived by the owner on Nov 13, 2017. It is now read-only.

moveit_ros_planning_interface dependency triggers ros::init() error #300

Open
cheffe112 opened this issue Aug 27, 2013 · 3 comments
Open
Labels

Comments

@cheffe112
Copy link
Contributor

When I accidently add the moveit_ros_planning_interface dependency to one of my projects not containing any code other than a .cpp file with the contents

#include <ros/ros.h>
int main(int argc, char **argv)
{
    ros::init(argc, argv, "some_node");
    ros::NodeHandle n;
    ros::spin();
    return 0;
}

, I reproducibly keep getting runtime errors like "You must call ros::init() before creating the first NodeHandle".

I don't know whether this dependency is needed by the end user under any circumstances; if not, maybe some kind of warning can be inserted somewhere?

@isucan
Copy link
Contributor

isucan commented Sep 4, 2013

Can you give me a backtrace? I tried to replicate this and things seem to work for me.

@cheffe112
Copy link
Contributor Author

Meanwhile I found out that the error appears only if I add dependencies to some of my other selfmade packages (which I accidently still had included when the error appeared first, sorry for the sloppiness). The error goes away if I remove these dependencies.
However, I've never had any problems with those packages, even if I added dependencies to lots of other selfmade and standard ROS packages. They don't seem to contain any "strange" stuff in the CMakeLists.txt either which looks suspicious like it could cause problems.

Anyway, here's the backtrace:

[FATAL] [1378317883.313324765]: You must call ros::init() before creating the first NodeHandle
[FATAL] [1378317883.313481035]: BREAKPOINT HIT
    file = /tmp/buildd/ros-groovy-roscpp-1.9.47-0precise-20130721-1839/src/libros/node_handle.cpp
    line=151


Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007fffe4de27c7 in ros::NodeHandle::construct(std::string const&, bool) () from /opt/ros/groovy/lib/libroscpp.so
(gdb) bt
#0  0x00007fffe4de27c7 in ros::NodeHandle::construct(std::string const&, bool) () from /opt/ros/groovy/lib/libroscpp.so
#1  0x00007fffe4de3ad5 in ros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&) () from /opt/ros/groovy/lib/libroscpp.so
#2  0x00007fffec616b80 in ?? () from /opt/ros/groovy/lib/libmoveit_pick_place_planner.so
#3  0x00007fffec606bd4 in ?? () from /opt/ros/groovy/lib/libmoveit_pick_place_planner.so
#4  0x00007ffff7de9306 in call_init (l=<optimized out>, argc=3, argv=0x7fffffffda18, env=0x7fffffffda38) at dl-init.c:85
#5  0x00007ffff7de93df in call_init (env=<optimized out>, argv=<optimized out>, argc=<optimized out>, l=<optimized out>)
    at dl-init.c:52
#6  _dl_init (main_map=0x7ffff7ffe2c8, argc=3, argv=0x7fffffffda18, env=0x7fffffffda38) at dl-init.c:134
#7  0x00007ffff7ddb6ea in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#8  0x0000000000000003 in ?? ()
#9  0x00007fffffffdd9f in ?? ()
#10 0x00007fffffffde1a in ?? ()
#11 0x00007fffffffde2f in ?? ()
#12 0x0000000000000000 in ?? ()

I don't know whether it's very helpful. Maybe you anyways get an idea where the problem might come from or how I could further debug it? I don't really need to add the moveit_ros_planning_interface dependency for my project, but it's probably best if we can track down the source of the error so it doesn't appear again.

System info: I'm using Ubuntu 12.04 64-bit, ROS Groovy from Ubuntu repos and tried MoveIt both from source and Ubuntu repos.

@ghost
Copy link

ghost commented Oct 25, 2013

I think I have a similar issue but with moveit_setup_assistant on debianAMD64/stable.
The backtrace is:

[FATAL] [1382695756.037652742]: You must call ros::init() before creating the first NodeHandle
[FATAL] [1382695756.039102320]: BREAKPOINT HIT
file = /media/hd160/robot/ros/catkin_workspace/src/roscpp/src/libros/node_handle.cpp
line=151

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007fffedc3afca in ros::NodeHandle::construct(std::string const&, bool) ()
from /opt/ros/groovy/lib/libroscpp.so
(gdb) bt
#0 0x00007fffedc3afca in ros::NodeHandle::construct(std::string const&, bool)
() from /opt/ros/groovy/lib/libroscpp.so
#1 0x00007fffedc3a687 in ros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, std::string, std::lessstd::string, std::allocator<std::pair<std::string const, std::string> > > const&) ()
from /opt/ros/groovy/lib/libroscpp.so
#2 0x00007fffea5bfc54 in pick_place::(anonymous namespace)::DynamicReconfigureImpl::DynamicReconfigureImpl() ()
from /opt/ros/groovy/lib/libmoveit_pick_place_planner.so
#3 0x00007fffea5aeb6f in _GLOBAL__sub_I_approach_and_translate_stage.cpp ()
from /opt/ros/groovy/lib/libmoveit_pick_place_planner.so
#4 0x00007ffff7de99e6 in ?? () from /lib64/ld-linux-x86-64.so.2
#5 0x00007ffff7de9aca in ?? () from /lib64/ld-linux-x86-64.so.2
#6 0x00007ffff7ddc53a in ?? () from /lib64/ld-linux-x86-64.so.2
#7 0x0000000000000003 in ?? ()
#8 0x00007fffffffdfbd in ?? ()
#9 0x00007fffffffe00d in ?? ()
#10 0x00007fffffffe02c in ?? ()
#11 0x0000000000000000 in ?? ()

otamachan pushed a commit to otamachan/moveit_ros that referenced this issue Oct 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants