moveit / moveit_planners

THIS REPO HAS MOVED TO https://github.com/ros-planning/moveit
15 stars 34 forks source link

Allow compiling against OMPL with C++11 support. #70

Closed de-vri-es closed 8 years ago

de-vri-es commented 8 years ago

The head of OMPL requires C++11 and unconditionally ditched boost::shared_ptr for std::shared_ptr [1]. That leads to an incompatibility in the moveit ompl plugin.

This PR adds a template same_shared_ptr<T, OtherPtr> which has a type typedef using the correct shared_ptr (taken from OtherPtr). Preprocessor checks prevent the include of <memory> and the mention of std::shared_ptr if C++11 support is not available.

I only changed the type of shared_ptr where it was required by OMPL, which was only one place.

[1] https://bitbucket.org/ompl/ompl/commits/d47925099e2307e50f7420eedad604452dcc297a

isucan commented 8 years ago

This looks good. Any idea why travis failed?

de-vri-es commented 8 years ago

Oops, I used double >> for closing template parameters. That's only allowed since C++11.

de-vri-es commented 8 years ago

Changed to > >, lets see if it passes now.

davetcoleman commented 8 years ago

Wow I had fixed this in my fork but hadn't made it backwards compatible like that, nice PR!

de-vri-es commented 8 years ago

I had a horrible hack first using cmake to generate a config.h with the correct shared_ptr type, but I didn't want to send a PR for that :)

Anyway, thanks for the merge.