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_ 29 #include <Eigen/Sparse> 35 namespace cost_functions
58 virtual bool initialize(moveit::core::RobotModelConstPtr robot_model_ptr,
77 const moveit_msgs::MotionPlanRequest &req,
79 moveit_msgs::MoveItErrorCodes& error_code)
override;
93 virtual bool computeCosts(
const Eigen::MatrixXd& parameters,
94 std::size_t start_timestep,
95 std::size_t num_timesteps,
98 Eigen::VectorXd& costs,
99 bool& validity)
override;
101 virtual std::string getGroupName()
const override 107 virtual std::string getName()
const override 109 return "CollisionCheck/" + group_name_;
112 virtual void done(
bool success,
int total_iterations,
double final_cost,
const Eigen::MatrixXd& parameters)
override;
129 std::string group_name_;
130 moveit::core::RobotModelConstPtr robot_model_ptr_;
131 moveit::core::RobotStatePtr robot_state_;
134 planning_scene::PlanningSceneConstPtr planning_scene_;
135 moveit_msgs::MotionPlanRequest plan_request_;
143 Eigen::VectorXd raw_costs_;
144 Eigen::ArrayXd intermediate_costs_slots_;
virtual bool computeCosts(const Eigen::MatrixXd ¶meters, 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 ¶meters) 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 'config' 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.