Skip to content

Use MOVEIT_CLASS_FORWARD for moveit classes. - #70

Merged
davetcoleman merged 3 commits into
moveit:kinetic-develfrom
fizyr-forks:shared_ptr_macro
Aug 18, 2016
Merged

davetcoleman merged 3 commits into
moveit:kinetic-develfrom
fizyr-forks:shared_ptr_macro

Conversation

@de-vri-es

Copy link
Copy Markdown
Contributor

This PR replaces manual shared_ptr typedefs with MOVEIT_CLASS_FORWARD, and changes source to use the generated typedefs instead of explicitly mentioning boost::shared_ptr.

As discussed in #48, this is to make it easier to switch to std::shared_ptr by modifying MOVEIT_CLASS_FORWARD (barring the occasional boost::make_shared and who knows what, but I don't think those should be wrapped).

So far I only got round to moveit_core/*, but since this is probably going to be a big PR I figured it would be good to put it out there for review (and to see what CI has to say) before it is completely finished. I'll do other subdirectories in different commits, which can be squashed later if desired.

In some cases I removed unneeded #include <boost/shared_ptr.hpp> which could break other files who forget to include that header, but I'll fix those as I encounter them.

};

typedef boost::shared_ptr<Object> ObjectPtr;
typedef boost::shared_ptr<Object> ObjectConstPtr;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ObjectConstPtr was not actually a ConstPtr. It is now, may break files who need mistakenly use ObjectConstPtr as ObjectPtr.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, it breaks the PlanningSceneMonitor:

 no known conversion for argument 1 from ‘std::pair<unsigned int, const Eigen::Transform<double, 3, 2>*>’ to ‘const value_type& {aka const std::pair<unsigned int, Eigen::Transform<double, 3, 2>*>&}’

@de-vri-es de-vri-es changed the title moveit_core: Use MOVEIT_CLASS_FORWARD for moveit classes. Use MOVEIT_CLASS_FORWARD for moveit classes. Aug 17, 2016

typedef boost::shared_ptr<CollisionDetectorAllocator> CollisionDetectorAllocatorPtr;

MOVEIT_CLASS_FORWARD(CollisionDetectorAllocator);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you feel so inclined, the more standard place to put these macros is right before the class definition. However I understand that you just replaced where it already was so might not want to do bigger reshuffling

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do. That actually makes it easier to verify that the correct name is passed to the macro :)

@davetcoleman

Copy link
Copy Markdown
Member

Thanks for doing this!

@de-vri-es

Copy link
Copy Markdown
Contributor Author

Moved the macros around and hopefully fixed planning_scene_monitor. I will squash at the end, but this way the in-line comments make sense for now.

@davetcoleman

Copy link
Copy Markdown
Member

So that devs in the future use CLASS_FORWARD: https://github.com/ros-planning/moveit.ros.org/pull/37

+1, do you think its ready to merge?

@de-vri-es

Copy link
Copy Markdown
Contributor Author

It can be merged, but I only got round to moveit_core/* so far. Up to you guys if you want to merge it now or wait for the rest. I suppose a quick merge is best to prevent conflicts with other people. I can open a new pull request for other parts of the repository then.

@davetcoleman

Copy link
Copy Markdown
Member

I don't see a good reason why not to merge this now. You recently changed typedef std::shared_ptr<FCLGeometry> FCLGeometryPtr; to use std and this reverts it to boost temporarily, so it should be done sooner than later.

@davetcoleman
davetcoleman merged commit 3464e3d into moveit:kinetic-devel Aug 18, 2016
@davetcoleman

Copy link
Copy Markdown
Member

Correction: we do need to cherry-pick this to I/J

davetcoleman pushed a commit to davetcoleman/moveit that referenced this pull request Aug 18, 2016
* moveit_core: Use MOVEIT_CLASS_FORWARD for moveit classes.
* Move MOVEIT_CLASS_FORWARD before the class defintiions.
* Fix planning_scene_monitor for fixed ObjectConstPtr.
davetcoleman pushed a commit to davetcoleman/moveit that referenced this pull request Aug 18, 2016
* moveit_core: Use MOVEIT_CLASS_FORWARD for moveit classes.
* Move MOVEIT_CLASS_FORWARD before the class defintiions.
* Fix planning_scene_monitor for fixed ObjectConstPtr.
@v4hn

v4hn commented Aug 18, 2016

Copy link
Copy Markdown
Contributor

@de-vri-es could you provide pull-requests for these changes against indigo-devel and jade-devel?
The whole point is to have similar-looking code throughout the branches...

@v4hn

v4hn commented Aug 18, 2016

Copy link
Copy Markdown
Contributor

Please ignore the above. @davetcoleman already did this in #76 and #77 . Although they fail testing at the moment..

@de-vri-es

de-vri-es commented Aug 18, 2016 •

Copy link
Copy Markdown
Contributor Author

Looks like an errant curly bracket was added by git somehow during the cherry-picking. I added line comments pointing at them (though I don't understand why compiler doesn't complain differently).

davetcoleman pushed a commit to davetcoleman/moveit that referenced this pull request Aug 18, 2016
* moveit_core: Use MOVEIT_CLASS_FORWARD for moveit classes.
* Move MOVEIT_CLASS_FORWARD before the class defintiions.
* Fix planning_scene_monitor for fixed ObjectConstPtr.
davetcoleman pushed a commit to davetcoleman/moveit that referenced this pull request Aug 18, 2016
* moveit_core: Use MOVEIT_CLASS_FORWARD for moveit classes.
* Move MOVEIT_CLASS_FORWARD before the class defintiions.
* Fix planning_scene_monitor for fixed ObjectConstPtr.
@davetcoleman

Copy link
Copy Markdown
Member

fixed per @de-vri-es and jade branch built locally

v4hn pushed a commit that referenced this pull request Aug 19, 2016
* moveit_core: Use MOVEIT_CLASS_FORWARD for moveit classes.
* Move MOVEIT_CLASS_FORWARD before the class defintiions.
* Fix planning_scene_monitor for fixed ObjectConstPtr.
v4hn pushed a commit that referenced this pull request Aug 19, 2016
* moveit_core: Use MOVEIT_CLASS_FORWARD for moveit classes.
* Move MOVEIT_CLASS_FORWARD before the class defintiions.
* Fix planning_scene_monitor for fixed ObjectConstPtr.
@mryellow

Copy link
Copy Markdown
Contributor

Should this also be applied to boost::shared_ptr<const shapes::OcTree> in collision_octomap_filter.cpp?

@mryellow

Copy link
Copy Markdown
Contributor

Scratch that, error there is related to running geometric_shapes 0.4.4-0 instead of 0.5.0-0.

JafarAbdi pushed a commit to JafarAbdi/moveit that referenced this pull request Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants