stomp_planner.h
Go to the documentation of this file.
1 
26 #ifndef STOMP_MOVEIT_STOMP_PLANNER_H_
27 #define STOMP_MOVEIT_STOMP_PLANNER_H_
28 
30 #include <stomp_core/stomp.h>
33 #include <boost/thread.hpp>
34 #include <ros/ros.h>
35 
36 namespace stomp_moveit
37 {
38 
39 using StompOptimizationTaskPtr = std::shared_ptr<StompOptimizationTask>;
40 
49 {
50 public:
57  StompPlanner(const std::string& group,const XmlRpc::XmlRpcValue& config,const moveit::core::RobotModelConstPtr& model);
58  virtual ~StompPlanner();
59 
65  virtual bool solve(planning_interface::MotionPlanResponse &res) override;
66 
72  virtual bool solve(planning_interface::MotionPlanDetailedResponse &res) override;
73 
78  virtual bool terminate() override;
79 
83  virtual void clear() override;
84 
92  static bool getConfigData(ros::NodeHandle &nh, std::map<std::string, XmlRpc::XmlRpcValue> &config, std::string param = std::string("stomp"));
93 
98  bool canServiceRequest(const moveit_msgs::MotionPlanRequest &req) const;
99 
107  static moveit_msgs::TrajectoryConstraints encodeSeedTrajectory(const trajectory_msgs::JointTrajectory& seed);
108 
109 protected:
110 
114  void setup();
115 
122  bool getStartAndGoal(Eigen::VectorXd& start, Eigen::VectorXd& goal);
123 
132  bool getSeedParameters(Eigen::MatrixXd& parameters) const;
133 
140  bool parametersToJointTrajectory(const Eigen::MatrixXd& parameters, trajectory_msgs::JointTrajectory& traj);
141 
148  bool jointTrajectorytoParameters(const trajectory_msgs::JointTrajectory& traj, Eigen::MatrixXd& parameters) const;
149 
157  bool extractSeedTrajectory(const moveit_msgs::MotionPlanRequest& req, trajectory_msgs::JointTrajectory& seed) const;
158 
159 protected:
160 
161  // stomp optimization
162  std::shared_ptr< stomp_core::Stomp> stomp_;
163  StompOptimizationTaskPtr task_;
164  XmlRpc::XmlRpcValue config_;
165  stomp_core::StompConfiguration stomp_config_;
166 
167  // robot model
168  moveit::core::RobotModelConstPtr robot_model_;
169  utils::kinematics::IKSolverPtr ik_solver_;
170 
171  // ros tasks
172  ros::NodeHandlePtr ph_;
173 };
174 
175 
176 } /* namespace stomp_moveit */
177 #endif /* STOMP_MOVEIT_STOMP_PLANNER_H_ */
bool param(const std::string &param_name, T &param_val, const T &default_val)
virtual bool solve(planning_interface::MotionPlanResponse &res) override
Solve the motion planning problem as defined in the motion request passed before hand.
void setup()
planner setup
virtual void clear() override
Clears results from previous plan.
static moveit_msgs::TrajectoryConstraints encodeSeedTrajectory(const trajectory_msgs::JointTrajectory &seed)
From a trajectory_msgs::JointTrajectory create a set of trajectory constraints that stomp can use lat...
virtual bool terminate() override
Thread-safe method that request early termination, if a solve() function is currently computing plans...
StompPlanner(const std::string &group, const XmlRpc::XmlRpcValue &config, const moveit::core::RobotModelConstPtr &model)
StompPlanner constructor.
bool getSeedParameters(Eigen::MatrixXd &parameters) const
This function 1) gets the seed trajectory from the active motion plan request, 2) checks to see if th...
bool canServiceRequest(const moveit_msgs::MotionPlanRequest &req) const
Checks some conditions to determine whether it is able to plan given for this planning request...
This defines kinematic related utilities.
bool jointTrajectorytoParameters(const trajectory_msgs::JointTrajectory &traj, Eigen::MatrixXd &parameters) const
Converts from a joint trajectory to an Eigen Matrix.
bool extractSeedTrajectory(const moveit_msgs::MotionPlanRequest &req, trajectory_msgs::JointTrajectory &seed) const
Populates a seed joint trajectory from the &#39;trajectory_constraints&#39; moveit_msgs::Constraints[] array...
static bool getConfigData(ros::NodeHandle &nh, std::map< std::string, XmlRpc::XmlRpcValue > &config, std::string param=std::string("stomp"))
Convenience method to load extract the parameters for each supported planning group.
This defines stomp&#39;s optimization task.
bool parametersToJointTrajectory(const Eigen::MatrixXd &parameters, trajectory_msgs::JointTrajectory &traj)
Converts from an Eigen Matrix to to a joint trajectory.
bool getStartAndGoal(Eigen::VectorXd &start, Eigen::VectorXd &goal)
Gets the start and goal joint values from the motion plan request passed.
The PlanningContext specialization that wraps the STOMP algorithm.
Definition: stomp_planner.h:48


stomp_moveit
Author(s): Jorge Nicho
autogenerated on Fri May 8 2020 03:35:47