-
Notifications
You must be signed in to change notification settings - Fork 531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allowing users to load and change dynamically new optimization objective for OMPL's planners #1436
Open
AntoineDevop
wants to merge
8
commits into
moveit:main
Choose a base branch
from
forssea-robotics:custom_ompl_optimization_objective
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+118
−1
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
446f786
Creation of the interface to load a optimizer objective
AntoineDevop 55425c5
Modification in order to allow users to include moveit/ompl_interface
AntoineDevop 3a2d8f4
Load the user's plugins as the new optimizer objective
AntoineDevop bb13492
Modification of the header of the file
AntoineDevop 0d01d15
Fixing bad include
AntoineDevop 2225fab
Loading OMPL's optimization objectives at launch in order to reduce t…
AntoineDevop 52fa9b7
Clang format
AntoineDevop 37c1128
Merge branch 'main' into custom_ompl_optimization_objective
ejalaa12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
...rs/ompl/ompl_interface/include/moveit/ompl_interface/ompl_optimization_objective_loader.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/********************************************************************* | ||
* Software License Agreement (BSD License) | ||
* | ||
* Copyright (c) 2012, Willow Garage, Inc. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* * Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* * Redistributions in binary form must reproduce the above | ||
* copyright notice, this list of conditions and the following | ||
* disclaimer in the documentation and/or other materials provided | ||
* with the distribution. | ||
* * Neither the name of Willow Garage nor the names of its | ||
* contributors may be used to endorse or promote products derived | ||
* from this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*********************************************************************/ | ||
|
||
/* Author: Antoine Duplex */ | ||
|
||
#ifndef SRC_OMPL_OPTIMIZATION_OBJECTIVE_LOADER_H | ||
#define SRC_OMPL_OPTIMIZATION_OBJECTIVE_LOADER_H | ||
|
||
#include <ompl/base/OptimizationObjective.h> | ||
#include <ompl/base/SpaceInformation.h> | ||
|
||
#include <string> | ||
#include <iostream> | ||
|
||
#define MOVEIT_OPTIMIZATION_OBJECTIVE_PLUGIN(my_namespace, OptimizationObjective) \ | ||
namespace my_namespace \ | ||
{ \ | ||
class OptimizationObjective##Loader : public ompl_optimization_loader::OptimizationObjectiveLoader \ | ||
{ \ | ||
public: \ | ||
ompl::base::OptimizationObjectivePtr getOptimizationObjective(ompl::base::SpaceInformationPtr si) override \ | ||
{ \ | ||
return std::make_shared<OptimizationObjective>(si); \ | ||
} \ | ||
}; \ | ||
PLUGINLIB_EXPORT_CLASS(my_namespace::OptimizationObjective##Loader, \ | ||
ompl_optimization_loader::OptimizationObjectiveLoader) \ | ||
} | ||
v4hn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
namespace ompl_optimization_loader | ||
{ | ||
class OptimizationObjectiveLoader | ||
{ | ||
public: | ||
OptimizationObjectiveLoader() | ||
{ | ||
} | ||
~OptimizationObjectiveLoader() = default; | ||
|
||
virtual ompl::base::OptimizationObjectivePtr getOptimizationObjective(ompl::base::SpaceInformationPtr si) = 0; | ||
}; | ||
} // namespace ompl_optimization_loader | ||
|
||
#endif // SRC_OMPL_OPTIMIZATION_OBJECTIVE_LOADER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moveit/planning_interface/
lives inmoveit_core
, so there is no need for this new dependency.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes my bad, the include in top of the file was false. See new commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't see the need to depend on
moveit_ros_planning
unless that dependency was missing here before your patch?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reasons, the header inside
moveit/ompl_interface
are not found unless we addmoveit_ros_planning
to the export_dependendencies.