3 #ifndef ROBOWFLEX_DART_PLANNING_
4 #define ROBOWFLEX_DART_PLANNING_
9 #include <ompl/base/goals/GoalLazySamples.h>
10 #include <ompl/base/Constraint.h>
11 #include <ompl/geometric/SimpleSetup.h>
13 #include <moveit_msgs/MotionPlanRequest.h>
110 void setSpaceInformation(
const ompl::base::SpaceInformationPtr &si);
114 bool is_constrained_{
false};
131 TSRGoal(
const ompl::base::SpaceInformationPtr &si,
const WorldPtr &world,
163 bool sample(
const ompl::base::GoalLazySamples *gls, ompl::base::State *state);
168 double distanceGoal(
const ompl::base::State *state)
const override;
195 double tolerance = 0.);
198 const Eigen::Ref<const Eigen::VectorXd> &upper);
202 void sampleGoal(ompl::base::State *state)
const override;
204 double distanceGoal(
const ompl::base::State *state)
const override;
257 const moveit_msgs::MotionPlanRequest &msg);
264 const moveit_msgs::MotionPlanRequest &msg);
271 const moveit_msgs::MotionPlanRequest &msg);
278 const moveit_msgs::MotionPlanRequest &msg);
285 const moveit_msgs::PositionConstraint &msg)
const;
292 const moveit_msgs::OrientationConstraint &msg)
const;
306 const moveit_msgs::MotionPlanRequest &msg);
386 void setGoal(
const ompl::base::GoalPtr &goal);
403 bool interpolate =
true)
const;
408 ompl::base::StateSpacePtr
space{
nullptr};
409 ompl::base::SpaceInformationPtr
rinfo{
nullptr};
410 ompl::base::SpaceInformationPtr
info{
nullptr};
411 ompl::geometric::SimpleSetupPtr
ss{
nullptr};
#define ROBOWFLEX_CLASS_FORWARD(C)
Macro that forward declares a class and defines two shared ptrs types:
A shared pointer wrapper for robowflex::darts::JointRegionGoal.
A joint space goal volume.
JointRegionGoal(const PlanBuilder &builder, const Eigen::Ref< const Eigen::VectorXd > &state, double tolerance=0.)
unsigned int maxSampleCount() const override
ompl::base::State * upper_
void sampleGoal(ompl::base::State *state) const override
ompl::base::State * lower_
double distanceGoal(const ompl::base::State *state) const override
A helper class to setup common OMPL structures for planning.
void setGoal(const ompl::base::GoalPtr &goal)
Set the goal for the problem.
void setStartConfigurationFromWorld()
Set the start configuration from the current state of the world.
TSRPtr fromOrientationConstraint(const std::string &robot_name, const moveit_msgs::OrientationConstraint &msg) const
Get a TSR from an orientation constraint.
std::shared_ptr< ompl::base::GoalStates > sampleGoalConfiguration()
Sample a valid goal configuration.
void addConstraint(const TSRPtr &tsr)
Adds a TSR as a path constraint to the problem.
double lambda
Manifold lambda.
void setup()
Calls setup routines on OMPL structures. Call after all setup is done and builder is initialized.
void setStartConfiguration(const Eigen::Ref< const Eigen::VectorXd > &q)
Set the start configuration from a configuration.
Eigen::VectorXd start
Start configuration.
void getPathConstraintsFromMessage(const std::string &robot_name, const moveit_msgs::MotionPlanRequest &msg)
Get the set of path constraints from the request message.
void initialize()
Initialize OMPL structures. Only call this once all constraints, groups, and other parameters have be...
void initializeConstrained()
Initialize when path constraints are present.
ompl::base::SpaceInformationPtr info
Actual Space Information.
ompl::base::StateValidityCheckerFn getSVCUnconstrained()
Get a state validity checker for the unconstrained space.
TSRConstraintPtr constraint
OMPL Constraint for Path Constraints.
TSRGoalPtr getGoalTSR(const TSRPtr &tsr)
Set a TSR as the goal for the planning problem (will create a TSRGoal)
ompl::geometric::PathGeometric getSolutionPath(bool simplify=true, bool interpolate=true) const
Get the solution path from a successful plan.
ompl::geometric::SimpleSetupPtr ss
Simple Setup.
StateSpacePtr rspace
Underlying Robot State Space.
void addGroup(const std::string &robot, const std::string &name, std::size_t cyclic=0)
Add a robot's planning group to the controlled DoF in the state space.
PlanBuilder(WorldPtr world)
Constructor.
struct robowflex::darts::PlanBuilder::@1::@2 constraints
Constrained planning options.
double delta
Manifold delta.
void getWorkspaceBoundsFromMessage(const moveit_msgs::MotionPlanRequest &msg)
Get workspace bounds from a planning request.
void setStateValidityChecker()
Set the state validity checker on the simple setup.
void sampleStartConfiguration()
Sample a valid start configuration.
std::vector< TSRPtr > path_constraints
Path Constraints.
struct robowflex::darts::PlanBuilder::@1 options
Hyperparameter options.
void getStartFromMessage(const std::string &robot_name, const moveit_msgs::MotionPlanRequest &msg)
Get the start state from the request message.
std::shared_ptr< ompl::base::GoalStates > getGoalConfigurationFromWorld()
Set the goal configuration from the current state of the world.
WorldPtr world
World used for planning.
ompl::base::GoalPtr fromMessage(const std::string &robot_name, const moveit_msgs::MotionPlanRequest &msg)
Use all of the planning request message to setup motion planning.
TSRPtr fromPositionConstraint(const std::string &robot_name, const moveit_msgs::PositionConstraint &msg) const
Get a TSR from an position constraint.
ompl::base::StateSpacePtr space
Actual OMPL State Space (might be constrained).
void initializeUnconstrained()
Initialize when no path constraints are present.
ompl::base::State * sampleState() const
Sample a valid state.
ompl::base::StateValidityCheckerFn getSVCConstrained()
Get a state validity checker for the unconstrained space.
JointRegionGoalPtr fromJointConstraints(const std::vector< moveit_msgs::JointConstraint > &msgs) const
Get a joint region goal from a message.
ompl::base::GoalPtr getGoalFromMessage(const std::string &robot_name, const moveit_msgs::MotionPlanRequest &msg)
Get the goal constraints from the planning request message.
ompl::base::GoalPtr goal_
Desired goal.
ompl::base::SpaceInformationPtr rinfo
Underlying Space Information.
std::shared_ptr< ompl::base::GoalStates > getGoalConfiguration(const Eigen::Ref< const Eigen::VectorXd > &q)
Set the goal configuration from a configuration.
void getGroupFromMessage(const std::string &robot_name, const moveit_msgs::MotionPlanRequest &msg)
Set group for planning from message.
A shared pointer wrapper for robowflex::darts::StateSpace.
State type for the robowflex::darts::StateSpace.
An OMPL state space for robowflex::darts::World. Can do motion planning for any of the robots or stru...
A shared pointer wrapper for robowflex::darts::TSRConstraint.
A shared pointer wrapper for robowflex::darts::TSRGoal.
A sampleable goal region for OMPL for a set of TSRs. Samples goals in a separate thread using a clone...
std::size_t max_samples
Maximum samples.
bool use_gradient
Use gradient-based TSR solver.
struct robowflex::darts::TSRGoal::@0 options
Public options.
ompl::base::StateSamplerPtr sampler_
State sampler.
double distanceGoal(const ompl::base::State *state) const override
Distance to the goal.
~TSRGoal()
Destructor. Stops sampling thread.
TSRSetPtr getTSRSet()
Get the TSR set of this goal region.
bool sample(const ompl::base::GoalLazySamples *gls, ompl::base::State *state)
Sampling routine. Generates IK samples from the TSR goal.
TSRGoal(const ompl::base::SpaceInformationPtr &si, const WorldPtr &world, const std::vector< TSRPtr > &tsrs)
Constructor.
WorldPtr world_
World used.
TSRSetPtr tsr_
TSR set to sample from.
A shared pointer wrapper for robowflex::darts::TSR.
A shared pointer wrapper for robowflex::darts::TSRSet.
A shared pointer wrapper for robowflex::darts::World.
Functions for loading and animating robots in Blender.
Main namespace. Contains all library classes and functions.