Skip to content

[kinetic] Undefined reference to setCollisionObjectUpdateCallback #98

Closed

Description

@jettan

I'm getting another nasty undefined reference error in moveit kinetic while trying to compile something that used to work in indigo using moveit.

/home/jettan/workspace/ros/devel/lib/libmoveit_planning_scene_monitor.so: undefined reference to `planning_scene::PlanningScene::setCollisionObjectUpdateCallback(boost::function<void (boost::shared_ptr<collision_detection::World::Object const> const&, collision_detection::World::Action)> const&)'

I already tried to rebuild moveit_ros_planning and planning_scene_monitor over and over again.
Any idea if anything changed that might have caused this issue?

I know the function exist as a grep command outputs the following:

$ grep -r "setCollisionObjectUpdateCallback"
moveit_core/planning_scene/include/moveit/planning_scene/planning_scene.h:  void setCollisionObjectUpdateCallback(const collision_detection::World::ObserverCallbackFn &callback);
moveit_core/planning_scene/src/planning_scene.cpp:void planning_scene::PlanningScene::setCollisionObjectUpdateCallback(const collision_detection::World::ObserverCallbackFn &callback)
moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp:    scene_->setCollisionObjectUpdateCallback(collision_detection::World::ObserverCallbackFn());
moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp:      scene_->setCollisionObjectUpdateCallback(boost::bind(&PlanningSceneMonitor::currentWorldObjectUpdateCallback, this, _1, _2));
moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp:        scene_->setCollisionObjectUpdateCallback(collision_detection::World::ObserverCallbackFn());
moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp:        scene_->setCollisionObjectUpdateCallback(boost::bind(&PlanningSceneMonitor::currentWorldObjectUpdateCallback, this, _1, _2));
moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp:          scene_->setCollisionObjectUpdateCallback(collision_detection::World::ObserverCallbackFn());
moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp:          scene_->setCollisionObjectUpdateCallback(boost::bind(&PlanningSceneMonitor::currentWorldObjectUpdateCallback, this, _1, _2));
moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp:      scene_->setCollisionObjectUpdateCallback(collision_detection::World::ObserverCallbackFn());
moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp:      scene_->setCollisionObjectUpdateCallback(boost::bind(&PlanningSceneMonitor::currentWorldObjectUpdateCallback, this, _1, _2));

Activity

  1. de-vri-es commented on Aug 21, 2016

    @de-vri-es
    Contributor

    What exactly are you building? I happen to know my system closely matches yours and I can compile the entire moveit repository with catkin_make_isolated without problem (or at least those parts that are picked up by catkin_make_isolated).

  2. jettan commented on Aug 21, 2016

    @jettan
    Author

    It's not the moveit repository that crashes, but building something that is linked against moveit.
    Do you think gcc-6.1 is causing this problem? Or perhaps newer boost libraries?

    The weird thing is that the moveit repository builds completely fine.

  3. v4hn commented on Aug 22, 2016

    @v4hn
    Contributor

    On Sun, Aug 21, 2016 at 11:55:35AM -0700, Jethro Tan wrote:

    It's not the moveit repository that crashes, but building something that is linked against moveit.

    Most importantly: Does the same code still compile with current indigo-devel?
    This might be a regression introduced in #70 .
    At the moment I don't know if this is intentional, but as we also merged this into indigo,
    we might have the problem there too. And we shouldn't have it in indigo.

    @de-vri-es could you have a look at whether this is related?

  4. jettan commented on Aug 22, 2016

    @jettan
    Author

    I can't test with current indigo-devel atm since I don't have it setup.

  5. v4hn commented on Aug 22, 2016

    @v4hn
    Contributor

    On Mon, Aug 22, 2016 at 08:09:32AM -0700, Jethro Tan wrote:

    I can't test with current indigo-devel atm since I don't have it setup.

    Could you try to give us a minimal code-example where this happens?
    I could test it then.

  6. jettan commented on Aug 22, 2016

    @jettan
    Author

    It's taking me quite some time to trigger this bug in a minimal code example. I built the examples of moveit (the ones with planning scene and planning ros api tutorial) with success. So I'm trying to figure out what exactly triggers this behaviour.

  7. jettan commented on Aug 22, 2016

    @jettan
    Author

    But it definitely has something to do with the changes introduced in #70 as you mentioned and as @de-vri-es mentioned.

    https://github.com/ros-planning/moveit/pull/70/files#r75216429

    EDIT:
    So the main villain is planning_scene_monitor.cpp who has ObjectConstPtr typedef'd as ObjectPtr before as I read from de-vri-es' comment in #70.

    /opt/ros/overlay/src/moveit(kinetic-devel=)*/moveit_ros*/planning/planning_scene_monitor/src$ grep -rn "setCollisionObjectUpdateCallback(b"
    planning_scene_monitor.cpp:205:      scene_->setCollisionObjectUpdateCallback(boost::bind(&PlanningSceneMonitor::currentWorldObjectUpdateCallback, this, _1, _2));
    planning_scene_monitor.cpp:256:        scene_->setCollisionObjectUpdateCallback(boost::bind(&PlanningSceneMonitor::currentWorldObjectUpdateCallback, this, _1, _2));
    planning_scene_monitor.cpp:352:          scene_->setCollisionObjectUpdateCallback(boost::bind(&PlanningSceneMonitor::currentWorldObjectUpdateCallback, this, _1, _2));
    planning_scene_monitor.cpp:520:      scene_->setCollisionObjectUpdateCallback(boost::bind(&PlanningSceneMonitor::currentWorldObjectUpdateCallback, this, _1, _2));
    
    
  8. de-vri-es commented on Aug 22, 2016

    @de-vri-es
    Contributor

    The only way I can see that causing problems is if you're compiling with the new header and linking with an object compiled before the change. Do you have pre-compiled moveit packages installed?

    The declaration and definition of planning_scene::PlanningScene::setCollisionObjectUpdateCallback are consistent at any rate.

  9. de-vri-es commented on Aug 22, 2016

    @de-vri-es
    Contributor

    @jettan: If you don't have precompiled moveit packages installed or if removing them (and cleaning your workspace for good measure) does not fix the issue, can you show the full linker command and output?

  10. v4hn commented on Aug 22, 2016

    @v4hn
    Contributor

    On Mon, Aug 22, 2016 at 11:12:29AM -0700, Maarten de Vries wrote:

    Do you have pre-compiled moveit packages installed?

    Might also be other packages that were/are linked to moveit, but to an older version.

    The only way I can see that causing problems is if you're compiling with the new header and linking with an object compiled before the change.

    This is called ABI breakage. Do we have this same problem in our indigo-devel branch, when compared to the latest release?
    If we have, we should revert the problematic part (at least for now).

    The declaration and definition of 'planning_scene::PlanningScene::setCollisionObjectUpdateCallback' are consistent at any rate.

    For stable releases, it is not about consistency, but about change.
    We shouldn't change things (ABI,API) in indigo, even though we can always extend them.

  11. de-vri-es commented on Aug 22, 2016

    @de-vri-es
    Contributor

    Might also be other packages that were/are linked to moveit, but to an older version.

    Could be, although in that case removing the binary package for moveit-* should also remove those (assuming they were installed with a package manager).

    This is called ABI breakage. Do we have this same problem in our indigo-devel branch, when compared to the latest release? If we have, we should revert the problematic part (at least for now).

    Well, the correction of collision_detection::ObjectConstPtr definitely changed the API at a number of places. So for indigo that should be reverted. I'll make a PR for that. What about Jade?

    For stable releases, it is not about consistency, but about change.
    We shouldn't change things (ABI,API) in indigo, even though we can always extend them.

    The point was, if they are inconsistent then that could explain the linking problems on even on a fresh compilation. Though in the case of member functions the compiler should already catch the mismatch.

  12. jettan commented on Aug 22, 2016

    @jettan
    Author

    Got it compiling! It is indeed the ABI breakage. After uninstalling the prepackaged ros-kinetic-moveit_core and ros-kinetic-moveit_msgs and recompiling my moveit overlay repository everything compiles as it should.

  13. de-vri-es commented on Aug 22, 2016

    @de-vri-es
    Contributor

    Quick note: those packages are coming from a personal Arch Linux repository I'm maintaining, in case anyone is wondering how there are binary packages before the actual release =]

  14. v4hn commented on Aug 22, 2016

    @v4hn
    Contributor

    On Mon, Aug 22, 2016 at 11:42:39AM -0700, Maarten de Vries wrote:

    Might also be other packages that were/are linked to moveit, but to an older version.

    Could be, although in that case removing the binary package for moveit-* should also remove those (assuming they were installed with a package manager).

    Yes.

    This is called ABI breakage. Do we have this same problem in our indigo-devel branch, when compared to the latest release? If we have, we should revert the problematic part (at least for now).

    Well, the correction of collision_detection::ObjectConstPtr definitely changed the API at a number of places. So for indigo that should be reverted. I'll make a PR for that.

    I wasn't sure back then whether adding const-ness is an ABI problem.
    Turns out it is... I should have known better.
    Could you please provide a minimal-invasive patch to revert to the old A{P/B}I in indigo, but keep the other cleanup changes you did?

    What about Jade?

    During one of the maintainer meetings, we more or less agreed that jade is testing ground and does not have to be kept ABI-stable.
    The changes there are already released, so there is no sense in reverting them.

    The point was, if they are inconsistent then that could explain the linking problems on even on a fresh compilation.

    Agreed.

  15. v4hn commented on Aug 22, 2016

    @v4hn
    Contributor

    On Mon, Aug 22, 2016 at 11:52:07AM -0700, Maarten de Vries wrote:

    Quick note: those packages are coming from a personal Arch Linux repository I'm maintaining, in case anyone is wondering how there are binary packages before the actual release =]

    Awsome! Great to hear something like that exists!
    Be aware though that quite a number of things might change before the release...

  16. jettan commented on Aug 22, 2016

    @jettan
    Author

    No worries, it's on a private buildbot.
    And I was just getting ready to test things so I could one day mirror it.

  17. de-vri-es commented on Aug 22, 2016

    @de-vri-es
    Contributor

    I wasn't sure back then whether adding const-ness is an ABI problem. Turns out it is... I should have known better. Could you please provide a minimal-invasive patch to revert to the old A{P/B}I in indigo, but keep the other cleanup changes you did?

    I was actually wondering the same thing. Turns out that name mangling makes sure it is a problem :) Just as well I suppose, as otherwise you might end up with a program calling non-const members on what you thought was a const object.

    The PR contains only a pretty minimal patch, see #104.

    Awsome! Great to hear something like that exists! Be aware though that quite a number of things might change before the release...

    Aye, but I'm running Arch, so I'm used to having to recompile half the repo because of ABI breakage (yay boost updates) ;)

    The binary repository is mainly meant to avoid long compilation times when installing new systems, we're not expecting it to remain stable for now.

  18. v4hn commented on Aug 22, 2016

    @v4hn
    Contributor

    Just as well I suppose, as otherwise you might end up with a program calling non-const members on what you thought was a const object.

    The standard allows for that (hello const_cast), so why should the compiler care. ;)
    But yeah, it's good that it does...

    Aye, but I'm running Arch, so I'm used to having to recompile half the repo because of ABI breakage (yay boost updates) ;)

    Tell me about it: https://github.com/lunar-linux
    One of my favorites til today are gcc ABI changes: https://github.com/lunar-linux/moonbase-core/blob/master/compilers/gcc/POST_INSTALL#L10

    This issue is resolved, so I'll close it.
    Thanks for your support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions