26 #ifndef INDUSTRIAL_MOVEIT_STOMP_CORE_INCLUDE_STOMP_CORE_STOMP_COST_FUNCTION_H_ 27 #define INDUSTRIAL_MOVEIT_STOMP_CORE_INCLUDE_STOMP_CORE_STOMP_COST_FUNCTION_H_ 31 #include <stomp_core/utils.h> 32 #include <moveit_msgs/GetMotionPlan.h> 40 namespace cost_functions
43 class StompCostFunction;
44 typedef std::shared_ptr<StompCostFunction> StompCostFunctionPtr;
71 virtual bool initialize(moveit::core::RobotModelConstPtr robot_model_ptr,
90 const moveit_msgs::MotionPlanRequest &req,
92 moveit_msgs::MoveItErrorCodes& error_code) = 0;
106 virtual bool computeCosts(
const Eigen::MatrixXd& parameters,
107 std::size_t start_timestep,
108 std::size_t num_timesteps,
109 int iteration_number,
111 Eigen::VectorXd& costs,
112 bool& validity) = 0 ;
123 std::size_t num_timesteps,
int iteration_number,
double cost,
const Eigen::MatrixXd& parameters){}
133 virtual void done(
bool success,
int total_iterations,
double final_cost,
const Eigen::MatrixXd& parameters){}
136 virtual std::string getGroupName()
const 138 return "Not Implemented";
141 virtual double getWeight()
const 146 virtual std::string getName()
const 148 return "Not Implemented";
virtual bool initialize(moveit::core::RobotModelConstPtr robot_model_ptr, const std::string &group_name, XmlRpc::XmlRpcValue &config)=0
Initializes and configures the Cost Function.
virtual int getOptimizedIndex() const
The index returned by this method will be passed by the Task to the corresponding plugin method as th...
virtual bool configure(const XmlRpc::XmlRpcValue &config)=0
Sets internal members of the plugin from the configuration data.
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)=0
computes the state costs as a function of the parameters for each time step.
virtual void done(bool success, int total_iterations, double final_cost, const Eigen::MatrixXd ¶meters)
Called by the Stomp Task at the end of the optimization process.
Assigns a cost value to each robot state by evaluating the minimum distance between the robot and the...
virtual void postIteration(std::size_t start_timestep, std::size_t num_timesteps, int iteration_number, double cost, const Eigen::MatrixXd ¶meters)
Called by STOMP at the end of each iteration.
virtual bool setMotionPlanRequest(const planning_scene::PlanningSceneConstPtr &planning_scene, const moveit_msgs::MotionPlanRequest &req, const stomp_core::StompConfiguration &config, moveit_msgs::MoveItErrorCodes &error_code)=0
Stores the planning details which will be used during the costs calculations.