26 #ifndef INDUSTRIAL_MOVEIT_STOMP_MOVEIT_INCLUDE_STOMP_MOVEIT_STOMP_OPTIMIZATION_TASK_H_ 27 #define INDUSTRIAL_MOVEIT_STOMP_MOVEIT_INCLUDE_STOMP_MOVEIT_STOMP_OPTIMIZATION_TASK_H_ 30 #include <moveit_msgs/MotionPlanRequest.h> 45 typedef std::shared_ptr<CostFunctionLoader> CostFuctionLoaderPtr;
47 typedef std::shared_ptr<NoisyFilterLoader> NoisyFilterLoaderPtr;
49 typedef std::shared_ptr<UpdateFilterLoader> UpdateFilterLoaderPtr;
51 typedef std::shared_ptr<NoiseGeneratorLoader> NoiseGeneratorLoaderPtr;
84 const moveit_msgs::MotionPlanRequest &req,
86 moveit_msgs::MoveItErrorCodes& error_code);
100 std::size_t start_timestep,
101 std::size_t num_timesteps,
102 int iteration_number,
104 Eigen::MatrixXd& parameters_noise,
105 Eigen::MatrixXd& noise)
override;
119 std::size_t start_timestep,
120 std::size_t num_timesteps,
121 int iteration_number,
123 Eigen::VectorXd& costs,
124 bool& validity)
override;
136 virtual bool computeCosts(
const Eigen::MatrixXd& parameters,
137 std::size_t start_timestep,
138 std::size_t num_timesteps,
139 int iteration_number,
140 Eigen::VectorXd& costs,
141 bool& validity)
override;
156 std::size_t num_timesteps,
157 int iteration_number,
159 Eigen::MatrixXd& parameters,
160 bool& filtered)
override;
174 std::size_t num_timesteps,
175 int iteration_number,
176 const Eigen::MatrixXd& parameters,
177 Eigen::MatrixXd& updates)
override;
188 std::size_t num_timesteps,
int iteration_number,
double cost,
const Eigen::MatrixXd& parameters);
198 virtual void done(
bool success,
int total_iterations,
double final_cost,
const Eigen::MatrixXd& parameters)
override;
203 std::string group_name_;
204 moveit::core::RobotModelConstPtr robot_model_ptr_;
208 CostFuctionLoaderPtr cost_function_loader_;
209 NoisyFilterLoaderPtr noisy_filter_loader_;
210 UpdateFilterLoaderPtr update_filter_loader_;
214 std::vector<cost_functions::StompCostFunctionPtr> cost_functions_;
215 std::vector<noisy_filters::StompNoisyFilterPtr> noisy_filters_;
216 std::vector<update_filters::StompUpdateFilterPtr> update_filters_;
217 std::vector<noise_generators::StompNoiseGeneratorPtr> noise_generators_;
virtual bool setMotionPlanRequest(const planning_scene::PlanningSceneConstPtr &planning_scene, const moveit_msgs::MotionPlanRequest &req, const stomp_core::StompConfiguration &config, moveit_msgs::MoveItErrorCodes &error_code)
Passes the planning details down to each loaded plugin.
This is the base class for all stomp noisy generators.
StompOptimizationTask(moveit::core::RobotModelConstPtr robot_model_ptr, std::string group_name, const XmlRpc::XmlRpcValue &config)
Constructor.
virtual bool filterNoisyParameters(std::size_t start_timestep, std::size_t num_timesteps, int iteration_number, int rollout_number, Eigen::MatrixXd ¶meters, bool &filtered) override
Filters the given noisy parameters which is applied after noisy trajectory generation. It could be used for clipping of joint limits or projecting into the null space of the Jacobian. It accomplishes this by calling the loaded Noisy Filter plugins.
virtual bool computeCosts(const Eigen::MatrixXd ¶meters, std::size_t start_timestep, std::size_t num_timesteps, int iteration_number, Eigen::VectorXd &costs, bool &validity) override
computes the state costs as a function of the optimized parameters for each time step. It does this by calling the loaded Cost Function plugins
This is the base class for all stomp filters.
virtual bool computeNoisyCosts(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 as a function of the noisy parameters for each time step. It does this by calling the loaded Cost Function plugins
planning_scene::PlanningSceneConstPtr planning_scene_ptr_
This is the base class for all stomp cost functions.
NoiseGeneratorLoaderPtr noise_generator_loader_
virtual bool generateNoisyParameters(const Eigen::MatrixXd ¶meters, std::size_t start_timestep, std::size_t num_timesteps, int iteration_number, int rollout_number, Eigen::MatrixXd ¶meters_noise, Eigen::MatrixXd &noise) override
Generates a noisy trajectory from the parameters by calling the active Noise Generator plugin...
virtual void done(bool success, int total_iterations, double final_cost, const Eigen::MatrixXd ¶meters) override
Called by Stomp at the end of the optimization process.
Loads and manages the STOMP plugins during the planning process.
virtual bool filterParameterUpdates(std::size_t start_timestep, std::size_t num_timesteps, int iteration_number, const Eigen::MatrixXd ¶meters, Eigen::MatrixXd &updates) override
Filters the given parameters which is applied after calculating the update. It could be used for clip...
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.
This is the base class for all stomp update filters.