collision_check.h
Go to the documentation of this file.
1 
26 #ifndef INDUSTRIAL_MOVEIT_STOMP_MOVEIT_INCLUDE_STOMP_MOVEIT_COST_FUNCTIONS_COLLISION_CHECK_H_
27 #define INDUSTRIAL_MOVEIT_STOMP_MOVEIT_INCLUDE_STOMP_MOVEIT_COST_FUNCTIONS_COLLISION_CHECK_H_
28 
29 #include <Eigen/Sparse>
32 
33 namespace stomp_moveit
34 {
35 namespace cost_functions
36 {
37 
46 {
47 public:
49  virtual ~CollisionCheck();
50 
58  virtual bool initialize(moveit::core::RobotModelConstPtr robot_model_ptr,
59  const std::string& group_name,XmlRpc::XmlRpcValue& config) override;
60 
66  virtual bool configure(const XmlRpc::XmlRpcValue& config) override;
67 
76  virtual bool setMotionPlanRequest(const planning_scene::PlanningSceneConstPtr& planning_scene,
77  const moveit_msgs::MotionPlanRequest &req,
78  const stomp_core::StompConfiguration &config,
79  moveit_msgs::MoveItErrorCodes& error_code) override;
80 
81 
93  virtual bool computeCosts(const Eigen::MatrixXd& parameters,
94  std::size_t start_timestep,
95  std::size_t num_timesteps,
96  int iteration_number,
97  int rollout_number,
98  Eigen::VectorXd& costs,
99  bool& validity) override;
100 
101  virtual std::string getGroupName() const override
102  {
103  return group_name_;
104  }
105 
106 
107  virtual std::string getName() const override
108  {
109  return "CollisionCheck/" + group_name_;
110  }
111 
112  virtual void done(bool success,int total_iterations,double final_cost,const Eigen::MatrixXd& parameters) override;
113 
114 protected:
115 
124  bool checkIntermediateCollisions(const Eigen::VectorXd& start, const Eigen::VectorXd& end,double longest_valid_joint_move);
125 
126  std::string name_;
127 
128  // robot details
129  std::string group_name_;
130  moveit::core::RobotModelConstPtr robot_model_ptr_;
131  moveit::core::RobotStatePtr robot_state_;
132 
133  // planning context information
134  planning_scene::PlanningSceneConstPtr planning_scene_;
135  moveit_msgs::MotionPlanRequest plan_request_;
136 
137  // parameters
142  // cost calculation
143  Eigen::VectorXd raw_costs_;
144  Eigen::ArrayXd intermediate_costs_slots_;
145 
146  // intermediate collision check support
147  std::array<moveit::core::RobotStatePtr,3 > intermediate_coll_states_;
149 };
150 
151 } /* namespace cost_functions */
152 } /* namespace stomp_moveit */
153 
154 #endif /* INDUSTRIAL_MOVEIT_STOMP_MOVEIT_INCLUDE_STOMP_MOVEIT_COST_FUNCTIONS_COLLISION_CHECK_H_ */
virtual bool computeCosts(const Eigen::MatrixXd &parameters, std::size_t start_timestep, std::size_t num_timesteps, int iteration_number, int rollout_number, Eigen::VectorXd &costs, bool &validity) override
computes the state costs by checking whether the robot is in collision at each time step...
double kernel_window_percentage_
The value assigned to a collision state.
virtual bool setMotionPlanRequest(const planning_scene::PlanningSceneConstPtr &planning_scene, const moveit_msgs::MotionPlanRequest &req, const stomp_core::StompConfiguration &config, moveit_msgs::MoveItErrorCodes &error_code) override
Stores the planning details which will be used during the costs calculations.
double longest_valid_joint_move_
how far can a joint move in between consecutive trajectory points
std::array< moveit::core::RobotStatePtr, 3 > intermediate_coll_states_
Used in checking collisions between to consecutive poses.
This is the base class for all stomp cost functions.
virtual void done(bool success, int total_iterations, double final_cost, const Eigen::MatrixXd &parameters) override
Called by the Stomp Task at the end of the optimization process.
double collision_penalty_
The value assigned to a collision state.
virtual bool initialize(moveit::core::RobotModelConstPtr robot_model_ptr, const std::string &group_name, XmlRpc::XmlRpcValue &config) override
Initializes and configures the Cost Function. Calls the configure method and passes the &#39;config&#39; valu...
Assigns a cost value to each robot state by evaluating if the robot is in collision.
bool checkIntermediateCollisions(const Eigen::VectorXd &start, const Eigen::VectorXd &end, double longest_valid_joint_move)
Checks for collision between consecutive points by dividing the joint move into sub-moves where the m...
Assigns a cost value to each robot state by evaluating the minimum distance between the robot and the...
virtual bool configure(const XmlRpc::XmlRpcValue &config) override
Sets internal members of the plugin from the configuration data.


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