27 #ifndef INDUSTRIAL_MOVEIT_STOMP_MOVEIT_INCLUDE_STOMP_MOVEIT_COST_FUNCTIONS_OBSTACLE_DISTANCE_GRADIENT_H_ 28 #define INDUSTRIAL_MOVEIT_STOMP_MOVEIT_INCLUDE_STOMP_MOVEIT_COST_FUNCTIONS_OBSTACLE_DISTANCE_GRADIENT_H_ 35 namespace cost_functions
57 virtual bool initialize(moveit::core::RobotModelConstPtr robot_model_ptr,
const std::string& group_name,
77 const moveit_msgs::MotionPlanRequest &req,
79 moveit_msgs::MoveItErrorCodes& error_code)
override;
92 virtual bool computeCosts(
const Eigen::MatrixXd& parameters, std::size_t start_timestep, std::size_t num_timesteps,
93 int iteration_number,
int rollout_number, Eigen::VectorXd& costs,
bool& validity)
override;
95 virtual std::string getGroupName()
const override 100 virtual std::string getName()
const override 102 return name_ +
"/" + group_name_ ;
105 virtual void done(
bool success,
int total_iterations,
double final_cost,
const Eigen::MatrixXd& parameters)
override;
124 std::string group_name_;
125 moveit::core::RobotModelConstPtr robot_model_ptr_;
126 moveit::core::RobotStatePtr robot_state_;
133 planning_scene::PlanningSceneConstPtr planning_scene_;
134 moveit_msgs::MotionPlanRequest plan_request_;
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...
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.
virtual bool configure(const XmlRpc::XmlRpcValue &config) override
Sets internal members of the plugin from the configuration data.
double max_distance_
maximum distance from at which the trajectory will be penalized
This is the base class for all stomp cost functions.
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 calculating the minimum distance between the robot and an obstacle...
std::array< moveit::core::RobotStatePtr, 3 > intermediate_coll_states_
Used in checking collisions between to consecutive poses.
Assigns a cost value to each robot state by evaluating the minimum distance between the robot and the...
double longest_valid_joint_move_
how far can a joint move in between consecutive trajectory points
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...
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.