37#include <boost/algorithm/string/trim.hpp>
38#include <boost/algorithm/string/split.hpp>
39#include <boost/algorithm/string/replace.hpp>
40#include <boost/lexical_cast.hpp>
56#include <ompl/config.h>
57#include <ompl/base/samplers/UniformValidStateSampler.h>
58#include <ompl/base/goals/GoalLazySamples.h>
59#include <ompl/tools/config/SelfConfig.h>
60#include <ompl/base/spaces/SE3StateSpace.h>
61#include <ompl/datastructures/PDF.h>
62#include <ompl/base/terminationconditions/IterationTerminationCondition.h>
63#include <ompl/base/terminationconditions/CostConvergenceTerminationCondition.h>
65#include <ompl/base/objectives/PathLengthOptimizationObjective.h>
66#include <ompl/base/objectives/MechanicalWorkOptimizationObjective.h>
67#include <ompl/base/objectives/MinimaxObjective.h>
68#include <ompl/base/objectives/StateCostIntegralObjective.h>
69#include <ompl/base/objectives/MaximizeMinClearanceObjective.h>
70#include <ompl/geometric/planners/prm/LazyPRM.h>
113 if (!use_constraints_approximations)
122 if (
spec_.constrained_state_space_)
125 ompl::base::ScopedState<> ompl_start_state(
spec_.constrained_state_space_);
128 ompl_simple_setup_->setStateValidityChecker(std::make_shared<ConstrainedPlanningStateValidityChecker>(
this));
133 ompl::base::ScopedState<> ompl_start_state(
spec_.state_space_);
136 ompl_simple_setup_->setStateValidityChecker(std::make_shared<StateValidityChecker>(
this));
141 const ConstraintApproximationPtr& constraint_approx =
143 if (constraint_approx)
145 getOMPLStateSpace()->setInterpolationFunction(constraint_approx->getInterpolationFunction());
146 RCLCPP_INFO(
getLogger(),
"Using precomputed interpolation states");
157 if (!
spec_.state_space_)
159 RCLCPP_ERROR(
getLogger(),
"No state space is configured yet");
164 spec_.state_space_->registerDefaultProjection(projection_eval);
169 if (peval.find_first_of(
"link(") == 0 && peval[peval.length() - 1] ==
')')
171 std::string link_name = peval.substr(5, peval.length() - 6);
174 return std::make_shared<ProjectionEvaluatorLinkPose>(
this, link_name);
179 "Attempted to set projection evaluator with respect to position of link '%s', "
180 "but that link is not known to the kinematic model.",
184 else if (peval.find_first_of(
"joints(") == 0 && peval[peval.length() - 1] ==
')')
186 std::string joints = peval.substr(7, peval.length() - 8);
187 boost::replace_all(joints,
",",
" ");
188 std::vector<unsigned int> j;
189 std::stringstream ss(joints);
190 while (ss.good() && !ss.eof())
193 ss >> joint >> std::ws;
197 if (variable_count > 0)
200 for (
unsigned int q = 0; q < variable_count; ++q)
202 j.push_back(idx + q);
207 RCLCPP_WARN(
getLogger(),
"%s: Ignoring joint '%s' in projection since it has 0 DOF",
name_.c_str(),
214 "%s: Attempted to set projection evaluator with respect to value of joint "
215 "'%s', but that joint is not known to the group '%s'.",
221 RCLCPP_ERROR(
getLogger(),
"%s: No valid joints specified for joint projection",
name_.c_str());
225 return std::make_shared<ProjectionEvaluatorJointValue>(
this, j);
230 RCLCPP_ERROR(
getLogger(),
"Unable to allocate projection evaluator based on description: '%s'", peval.c_str());
232 return ob::ProjectionEvaluatorPtr();
235ompl::base::StateSamplerPtr
238 if (
spec_.state_space_.get() != state_space)
240 RCLCPP_ERROR(
getLogger(),
"%s: Attempted to allocate a state sampler for an unknown state space",
name_.c_str());
241 return ompl::base::StateSamplerPtr();
244 RCLCPP_DEBUG(
getLogger(),
"%s: Allocating a new state sampler (attempts to use path constraints)",
name_.c_str());
250 const ConstraintApproximationPtr& constraint_approx =
252 if (constraint_approx)
254 ompl::base::StateSamplerAllocator state_sampler_allocator =
256 if (state_sampler_allocator)
258 ompl::base::StateSamplerPtr state_sampler = state_sampler_allocator(state_space);
262 "%s: Using precomputed state sampler (approximated constraint space) for constraint '%s'",
264 return state_sampler;
270 constraint_samplers::ConstraintSamplerPtr constraint_sampler;
271 if (
spec_.constraint_sampler_manager_)
277 if (constraint_sampler)
279 RCLCPP_INFO(
getLogger(),
"%s: Allocating specialized state sampler for state space",
name_.c_str());
280 return std::make_shared<ConstrainedSampler>(
this, constraint_sampler);
283 RCLCPP_DEBUG(
getLogger(),
"%s: Allocating default state sampler for state space",
name_.c_str());
284 return state_space->allocDefaultStateSampler();
289 const std::map<std::string, std::string>& config =
spec_.config_;
292 std::map<std::string, std::string> cfg = config;
295 auto it = cfg.find(
"longest_valid_segment_fraction");
300 double longest_valid_segment_fraction_config = (it != cfg.end())
303 double longest_valid_segment_fraction_final = longest_valid_segment_fraction_config;
308 longest_valid_segment_fraction_final = std::min(
309 longest_valid_segment_fraction_config,
320 it = cfg.find(
"projection_evaluator");
332 std::string optimizer;
333 ompl::base::OptimizationObjectivePtr objective;
334 it = cfg.find(
"optimization_objective");
337 optimizer = it->second;
340 if (optimizer ==
"PathLengthOptimizationObjective")
343 std::make_shared<ompl::base::PathLengthOptimizationObjective>(
ompl_simple_setup_->getSpaceInformation());
345 else if (optimizer ==
"MinimaxObjective")
347 objective = std::make_shared<ompl::base::MinimaxObjective>(
ompl_simple_setup_->getSpaceInformation());
349 else if (optimizer ==
"StateCostIntegralObjective")
351 objective = std::make_shared<ompl::base::StateCostIntegralObjective>(
ompl_simple_setup_->getSpaceInformation());
353 else if (optimizer ==
"MechanicalWorkOptimizationObjective")
356 std::make_shared<ompl::base::MechanicalWorkOptimizationObjective>(
ompl_simple_setup_->getSpaceInformation());
358 else if (optimizer ==
"MaximizeMinClearanceObjective")
361 std::make_shared<ompl::base::MaximizeMinClearanceObjective>(
ompl_simple_setup_->getSpaceInformation());
366 "Optimization objective %s is invalid or not defined, using PathLengthOptimizationObjective instead",
369 std::make_shared<ompl::base::PathLengthOptimizationObjective>(
ompl_simple_setup_->getSpaceInformation());
376 it = cfg.find(
"multi_query_planning_enabled");
383 it = cfg.find(
"interpolate");
391 it = cfg.find(
"simplify_solutions");
399 it = cfg.find(
"hybridize");
402 hybridize_ = boost::lexical_cast<bool>(it->second);
407 it = cfg.find(
"type");
411 RCLCPP_WARN(
getLogger(),
"%s: Attribute 'type' not specified in planner configuration",
name_.c_str());
415 std::string type = it->second;
419 [planner_name, &spec =
spec_, allocator =
spec_.planner_selector_(type)](
420 const ompl::base::SpaceInformationPtr& si) { return allocator(si, planner_name, spec); });
422 "Planner configuration '%s' will use planner '%s'. "
423 "Additional configuration parameters will be set when the planner is constructed.",
424 name_.c_str(), type.c_str());
436 if (wparams.min_corner.x == wparams.max_corner.x && wparams.min_corner.x == 0.0 &&
437 wparams.min_corner.y == wparams.max_corner.y && wparams.min_corner.y == 0.0 &&
438 wparams.min_corner.z == wparams.max_corner.z && wparams.min_corner.z == 0.0)
440 RCLCPP_WARN(
getLogger(),
"It looks like the planning volume was not specified.");
444 "%s: Setting planning volume (affects SE2 & SE3 joints only) to x = [%f, %f], y = "
445 "[%f, %f], z = [%f, %f]",
446 name_.c_str(), wparams.min_corner.x, wparams.max_corner.x, wparams.min_corner.y, wparams.max_corner.y,
447 wparams.min_corner.z, wparams.max_corner.z);
449 spec_.state_space_->setPlanningVolume(wparams.min_corner.x, wparams.max_corner.x, wparams.min_corner.y,
450 wparams.max_corner.y, wparams.min_corner.z, wparams.max_corner.z);
455 ompl::time::point start = ompl::time::now();
471 unsigned int eventual_states = 1;
472 std::vector<ompl::base::State*> states = pg.getStates();
473 for (
size_t i = 0; i < states.size() - 1; ++i)
475 eventual_states +=
ompl_simple_setup_->getStateSpace()->validSegmentCount(states[i], states[i + 1]);
495 for (std::size_t i = 0; i < pg.getStateCount(); ++i)
497 spec_.state_space_->copyToRobotState(ks, pg.getState(i));
524 std::vector<ob::GoalPtr> goals;
525 for (kinematic_constraints::KinematicConstraintSetPtr& goal_constraint :
goal_constraints_)
527 constraint_samplers::ConstraintSamplerPtr constraint_sampler;
528 if (
spec_.constraint_sampler_manager_)
531 goal_constraint->getAllConstraints());
534 if (constraint_sampler)
536 ob::GoalPtr goal = std::make_shared<ConstrainedGoalSampler>(
this, goal_constraint, constraint_sampler);
537 goals.push_back(goal);
543 return goals.size() == 1 ? goals[0] : std::make_shared<GoalSampleableRegionMux>(goals);
547 RCLCPP_ERROR(
getLogger(),
"Unable to construct goal representation");
550 return ob::GoalPtr();
553ompl::base::PlannerTerminationCondition
556 auto it =
spec_.config_.find(
"termination_condition");
557 if (it ==
spec_.config_.end())
559 return ob::timedPlannerTerminationCondition(timeout - ompl::time::seconds(ompl::time::now() - start));
562 std::string termination_string = it->second;
563 std::vector<std::string> termination_and_params;
564 boost::split(termination_and_params, termination_string, boost::is_any_of(
"[ ,]"));
566 if (termination_and_params.empty())
568 RCLCPP_ERROR(
getLogger(),
"Termination condition not specified");
574 else if (termination_and_params[0] ==
"Iteration")
576 if (termination_and_params.size() > 1)
578 return ob::plannerOrTerminationCondition(
579 ob::timedPlannerTerminationCondition(timeout - ompl::time::seconds(ompl::time::now() - start)),
580 ob::IterationTerminationCondition(std::stoul(termination_and_params[1])));
584 RCLCPP_ERROR(
getLogger(),
"Missing argument to Iteration termination condition");
589 else if (termination_and_params[0] ==
"CostConvergence")
591 std::size_t solutions_window = 10u;
592 double epsilon = 0.1;
593 if (termination_and_params.size() > 1)
595 solutions_window = std::stoul(termination_and_params[1]);
596 if (termination_and_params.size() > 2)
601 return ob::plannerOrTerminationCondition(
602 ob::timedPlannerTerminationCondition(timeout - ompl::time::seconds(ompl::time::now() - start)),
603 ob::CostConvergenceTerminationCondition(
ompl_simple_setup_->getProblemDefinition(), solutions_window, epsilon));
608 else if (termination_and_params[0] ==
"ExactSolution")
610 return ob::plannerOrTerminationCondition(
611 ob::timedPlannerTerminationCondition(timeout - ompl::time::seconds(ompl::time::now() - start)),
612 ob::exactSolnPlannerTerminationCondition(
ompl_simple_setup_->getProblemDefinition()));
616 RCLCPP_ERROR(
getLogger(),
"Unknown planner termination condition");
619 return ob::plannerAlwaysTerminatingCondition();
640 auto planner =
dynamic_cast<ompl::geometric::LazyPRM*
>(
ompl_simple_setup_->getPlanner().get());
641 if (planner !=
nullptr)
643 planner->clearValidity();
655 moveit_msgs::msg::MoveItErrorCodes* )
666 const moveit_msgs::msg::Constraints& path_constraints,
667 moveit_msgs::msg::MoveItErrorCodes* error)
671 for (
const moveit_msgs::msg::Constraints& goal_constraint : goal_constraints)
674 kinematic_constraints::KinematicConstraintSetPtr kset(
685 RCLCPP_WARN(
getLogger(),
"%s: No goal constraints specified. There is no problem to solve.",
name_.c_str());
688 error->val = moveit_msgs::msg::MoveItErrorCodes::INVALID_GOAL_CONSTRAINTS;
695 return static_cast<bool>(goal);
706 ot::Benchmark::Request req;
707 req.maxTime = timeout;
708 req.runCount = count;
709 req.displayProgress =
true;
710 req.saveConsoleOutput =
false;
720 static_cast<ob::GoalLazySamples*
>(
ompl_simple_setup_->getGoal().get())->startSampling();
734 static_cast<ob::GoalLazySamples*
>(
ompl_simple_setup_->getGoal().get())->stopSampling();
753 ompl_simple_setup_->getSpaceInformation()->getMotionValidator()->resetMotionCounter();
759 int v =
ompl_simple_setup_->getSpaceInformation()->getMotionValidator()->getValidMotionCount();
760 int iv =
ompl_simple_setup_->getSpaceInformation()->getMotionValidator()->getInvalidMotionCount();
761 RCLCPP_DEBUG(
getLogger(),
"There were %d valid motions and %d invalid motions.", v, iv);
766 std::stringstream debug_out;
768 return debug_out.str();
777 if (res.
error_code.val != moveit_msgs::msg::MoveItErrorCodes::SUCCESS)
779 RCLCPP_ERROR(
getLogger(),
"Unable to solve the planning problem");
795 RCLCPP_DEBUG(
getLogger(),
"%s: Returning successful solution with %lu states",
getName().c_str(),
807 if (res.
error_code.val != moveit_msgs::msg::MoveItErrorCodes::SUCCESS)
809 RCLCPP_INFO(
getLogger(),
"Unable to solve the planning problem");
836 ompl::time::point start_interpolate = ompl::time::now();
838 res.
processing_time.push_back(ompl::time::seconds(ompl::time::now() - start_interpolate));
845 RCLCPP_DEBUG(
getLogger(),
"%s: Returning successful solution with %lu states",
getName().c_str(),
851 ompl::time::point start = ompl::time::now();
854 moveit_msgs::msg::MoveItErrorCodes result;
855 result.val = moveit_msgs::msg::MoveItErrorCodes::FAILURE;
858 RCLCPP_DEBUG(
getLogger(),
"%s: Solving the planning problem once...",
name_.c_str());
869 RCLCPP_DEBUG(
getLogger(),
"%s: Solving the planning problem %u times...",
name_.c_str(), count);
876 for (
unsigned int i = 0; i < count; ++i)
883 for (
unsigned int i = 0; i < count; ++i)
893 result.val = moveit_msgs::msg::MoveItErrorCodes::SUCCESS;
903 result.val = moveit_msgs::msg::MoveItErrorCodes::SUCCESS;
904 for (
int i = 0; i < n && !ptc(); ++i)
924 result.val = (result.val == moveit_msgs::msg::MoveItErrorCodes::SUCCESS && r) ?
925 moveit_msgs::msg::MoveItErrorCodes::SUCCESS :
926 moveit_msgs::msg::MoveItErrorCodes::FAILURE;
934 for (
int i = 0; i < n; ++i)
941 for (
int i = 0; i < n; ++i)
949 result.val = (result.val == moveit_msgs::msg::MoveItErrorCodes::SUCCESS && r) ?
950 moveit_msgs::msg::MoveItErrorCodes::SUCCESS :
951 moveit_msgs::msg::MoveItErrorCodes::FAILURE;
964 std::unique_lock<std::mutex> slock(
ptc_lock_);
970 std::unique_lock<std::mutex> slock(
ptc_lock_);
976 auto result = moveit_msgs::msg::MoveItErrorCodes::PLANNING_FAILED;
977 const ompl::base::PlannerStatus ompl_status = ompl_simple_setup->getLastPlannerStatus();
978 switch (ompl::base::PlannerStatus::StatusType(ompl_status))
980 case ompl::base::PlannerStatus::UNKNOWN:
981 RCLCPP_WARN(
getLogger(),
"Motion planning failed for an unknown reason");
982 result = moveit_msgs::msg::MoveItErrorCodes::PLANNING_FAILED;
984 case ompl::base::PlannerStatus::INVALID_START:
985 RCLCPP_WARN(
getLogger(),
"Invalid start state");
986 result = moveit_msgs::msg::MoveItErrorCodes::START_STATE_INVALID;
988 case ompl::base::PlannerStatus::INVALID_GOAL:
989 RCLCPP_WARN(
getLogger(),
"Invalid goal state");
990 result = moveit_msgs::msg::MoveItErrorCodes::GOAL_STATE_INVALID;
992 case ompl::base::PlannerStatus::UNRECOGNIZED_GOAL_TYPE:
993 RCLCPP_WARN(
getLogger(),
"Unrecognized goal type");
994 result = moveit_msgs::msg::MoveItErrorCodes::UNRECOGNIZED_GOAL_TYPE;
996 case ompl::base::PlannerStatus::TIMEOUT:
997 RCLCPP_WARN(
getLogger(),
"Timed out: %.1fs ≥ %.1fs", ompl_simple_setup->getLastPlanComputationTime(),
999 result = moveit_msgs::msg::MoveItErrorCodes::TIMED_OUT;
1001 case ompl::base::PlannerStatus::APPROXIMATE_SOLUTION:
1003 if (ompl_simple_setup->getLastPlanComputationTime() >
request_.allowed_planning_time)
1005 RCLCPP_WARN(
getLogger(),
"Planning timed out: %.1fs ≥ %.1fs", ompl_simple_setup->getLastPlanComputationTime(),
1007 result = moveit_msgs::msg::MoveItErrorCodes::TIMED_OUT;
1011 RCLCPP_WARN(
getLogger(),
"Solution is approximate");
1012 result = moveit_msgs::msg::MoveItErrorCodes::PLANNING_FAILED;
1015 case ompl::base::PlannerStatus::EXACT_SOLUTION:
1016 result = moveit_msgs::msg::MoveItErrorCodes::SUCCESS;
1018 case ompl::base::PlannerStatus::CRASH:
1019 RCLCPP_WARN(
getLogger(),
"OMPL crashed!");
1020 result = moveit_msgs::msg::MoveItErrorCodes::CRASH;
1022 case ompl::base::PlannerStatus::ABORT:
1023 RCLCPP_WARN(
getLogger(),
"OMPL was aborted");
1024 result = moveit_msgs::msg::MoveItErrorCodes::ABORT;
1028 RCLCPP_WARN(
getLogger(),
"Unexpected PlannerStatus code from OMPL.");
1029 result = moveit_msgs::msg::MoveItErrorCodes::PLANNING_FAILED;
1036 std::unique_lock<std::mutex> slock(
ptc_lock_);
1046 std::string constraint_path;
1047 if (node->get_parameter(
"constraint_approximations_path", constraint_path))
1052 RCLCPP_WARN(
getLogger(),
"ROS param 'constraint_approximations' not found. Unable to save constraint approximations");
1058 std::string constraint_path;
1059 if (node->get_parameter(
"constraint_approximations_path", constraint_path))
1062 std::stringstream ss;
1064 RCLCPP_INFO_STREAM(
getLogger(), ss.str());
A class that contains many different constraints, and can check RobotState *versus the full set....
const JointModel * getJointModel(const std::string &joint) const
Get a joint by its name. Throw an exception if the joint is not part of this group.
int getVariableGroupIndex(const std::string &variable) const
Get the index of a variable within the group. Return -1 on error.
std::size_t getVariableCount() const
Get the number of variables that describe this joint.
Representation of a robot's state. This includes position, velocity, acceleration and effort.
void startSampling()
If there are any member lazy samplers, start them.
void stopSampling()
If there are any member lazy samplers, stop them.
int32_t logPlannerStatus(const og::SimpleSetupPtr &ompl_simple_setup)
Convert OMPL PlannerStatus to moveit_msgs::msg::MoveItErrorCode.
void setVerboseStateValidityChecks(bool flag)
virtual ob::ProjectionEvaluatorPtr getProjectionEvaluator(const std::string &peval) const
unsigned int minimum_waypoint_count_
void clear() override
Clear the data structures used by the planner.
bool getSolutionPath(robot_trajectory::RobotTrajectory &traj) const
double last_plan_time_
the time spent computing the last plan
void registerTerminationCondition(const ob::PlannerTerminationCondition &ptc)
const ob::PlannerTerminationCondition * ptc_
unsigned int max_planning_threads_
when planning in parallel, this is the maximum number of threads to use at one time
bool loadConstraintApproximations(const rclcpp::Node::SharedPtr &node)
Look up param server 'constraint_approximations' and use its value as the path to load constraint app...
std::vector< int > space_signature_
bool setPathConstraints(const moveit_msgs::msg::Constraints &path_constraints, moveit_msgs::msg::MoveItErrorCodes *error)
ModelBasedPlanningContext(const std::string &name, const ModelBasedPlanningContextSpecification &spec)
void interpolateSolution()
virtual ob::PlannerTerminationCondition constructPlannerTerminationCondition(double timeout, const ompl::time::point &start)
bool saveConstraintApproximations(const rclcpp::Node::SharedPtr &node)
Look up param server 'constraint_approximations' and use its value as the path to save constraint app...
const moveit::core::RobotState & getCompleteInitialRobotState() const
double getLastPlanTime() const
bool multi_query_planning_enabled_
when false, clears planners before running solve()
virtual void configure(const rclcpp::Node::SharedPtr &node, bool use_constraints_approximations)
Configure ompl_simple_setup_ and optionally the constraints_library_.
bool setGoalConstraints(const std::vector< moveit_msgs::msg::Constraints > &goal_constraints, const moveit_msgs::msg::Constraints &path_constraints, moveit_msgs::msg::MoveItErrorCodes *error)
const moveit::core::RobotModelConstPtr & getRobotModel() const
void convertPath(const og::PathGeometric &pg, robot_trajectory::RobotTrajectory &traj) const
std::vector< kinematic_constraints::KinematicConstraintSetPtr > goal_constraints_
const ModelBasedStateSpacePtr & getOMPLStateSpace() const
kinematic_constraints::KinematicConstraintSetPtr path_constraints_
unsigned int max_goal_sampling_attempts_
maximum number of attempts to be made at sampling a goal states
void setCompleteInitialState(const moveit::core::RobotState &complete_initial_robot_state)
og::SimpleSetupPtr ompl_simple_setup_
the OMPL planning context; this contains the problem definition and the planner used
moveit::core::RobotState complete_initial_robot_state_
unsigned int max_goal_samples_
void setPlanningVolume(const moveit_msgs::msg::WorkspaceParameters &wparams)
const moveit::core::JointModelGroup * getJointModelGroup() const
double getLastSimplifyTime() const
moveit_msgs::msg::Constraints path_constraints_msg_
ot::Benchmark ompl_benchmark_
the OMPL tool for benchmarking planners
ConstraintsLibraryPtr constraints_library_
void unregisterTerminationCondition()
bool benchmark(double timeout, unsigned int count, const std::string &filename="")
bool terminate() override
If solve() is running, terminate the computation. Return false if termination not possible....
virtual ob::StateSamplerPtr allocPathConstrainedSampler(const ompl::base::StateSpace *ss) const
unsigned int max_state_sampling_attempts_
void simplifySolution(double timeout)
void setProjectionEvaluator(const std::string &peval)
void solve(planning_interface::MotionPlanResponse &res) override
Solve the motion planning problem and store the result in res. This function should not clear data st...
ModelBasedPlanningContextSpecification spec_
ot::ParallelPlan ompl_parallel_plan_
tool used to compute multiple plans in parallel; this uses the problem definition maintained by ompl_...
const og::SimpleSetupPtr & getOMPLSimpleSetup() const
virtual ob::GoalPtr constructGoal()
double last_simplify_time_
the time spent simplifying the last plan
double max_solution_segment_length_
void setConstraintsApproximations(const ConstraintsLibraryPtr &constraints_library)
An interface for a OMPL state validity checker.
void setVerbose(bool flag)
std::string name_
The name of this planning context.
MotionPlanRequest request_
The planning request for this context.
const planning_scene::PlanningSceneConstPtr & getPlanningScene() const
Get the planning scene associated to this planning context.
const std::string & getGroupName() const
Get the name of the group this planning context is for.
PlanningContext(const std::string &name, const std::string &group)
Construct a planning context named name for the group group.
const std::string & getName() const
Get the name of this planning context.
Maintain a sequence of waypoints and the time durations between these waypoints.
RobotTrajectory & addSuffixWayPoint(const moveit::core::RobotState &state, double dt)
Add a point to the trajectory.
RobotTrajectory & clear()
moveit_msgs::msg::Constraints mergeConstraints(const moveit_msgs::msg::Constraints &first, const moveit_msgs::msg::Constraints &second)
Merge two sets of constraints into one.
double toDouble(const std::string &s)
Converts a std::string to double using the classic C locale.
std::string toString(double d)
Convert a double to std::string using the classic C locale.
rclcpp::Logger getLogger(const std::string &name)
Creates a namespaced logger.
The MoveIt interface to OMPL.
std::function< bool(const ompl::base::State *from, const ompl::base::State *to, const double t, ompl::base::State *state)> InterpolationFunction
This namespace includes the base class for MoveIt planners.
moveit_msgs::msg::MoveItErrorCodes error_code
std::vector< std::string > description
std::vector< double > processing_time
std::vector< robot_trajectory::RobotTrajectoryPtr > trajectory
Response to a planning query.
moveit::core::MoveItErrorCode error_code
robot_trajectory::RobotTrajectoryPtr trajectory
rclcpp::Logger getLogger()