update_logger.h
Go to the documentation of this file.
1 
26 #ifndef INDUSTRIAL_MOVEIT_STOMP_MOVEIT_INCLUDE_STOMP_MOVEIT_UPDATE_FILTERS_UPDATE_LOGGER_H_
27 #define INDUSTRIAL_MOVEIT_STOMP_MOVEIT_INCLUDE_STOMP_MOVEIT_UPDATE_FILTERS_UPDATE_LOGGER_H_
28 
30 #include <fstream>
31 
32 namespace stomp_moveit
33 {
34 namespace update_filters
35 {
36 
48 {
49 public:
50  UpdateLogger();
51  virtual ~UpdateLogger();
52 
54  virtual bool initialize(moveit::core::RobotModelConstPtr robot_model_ptr,
55  const std::string& group_name,const XmlRpc::XmlRpcValue& config);
56 
58  virtual bool configure(const XmlRpc::XmlRpcValue& config);
59 
61  virtual bool setMotionPlanRequest(const planning_scene::PlanningSceneConstPtr& planning_scene,
62  const moveit_msgs::MotionPlanRequest &req,
63  const stomp_core::StompConfiguration &config,
64  moveit_msgs::MoveItErrorCodes& error_code);
65 
77  virtual bool filter(std::size_t start_timestep,
78  std::size_t num_timesteps,
79  int iteration_number,
80  const Eigen::MatrixXd& parameters,
81  Eigen::MatrixXd& updates,
82  bool& filtered) override;
83 
84  virtual std::string getGroupName() const override
85  {
86  return group_name_;
87  }
88 
89  virtual std::string getName() const override
90  {
91  return name_ + "/" + group_name_;
92  }
93 
94  virtual void done(bool success, int total_iterations,double final_cost,const Eigen::MatrixXd& parameters) override;
95 
96 protected:
97 
98  std::string name_;
99  std::string group_name_;
100 
101  // parameters
102  std::string filename_;
103  std::string package_;
104  std::string directory_;
105 
106  // config
107  stomp_core::StompConfiguration stomp_config_;
108 
109  // logging
110  std::stringstream stream_;
111  std::string full_file_name_;
112  std::ofstream file_stream_;
113  Eigen::IOFormat format_;
114 
115 };
116 
117 } /* namespace smoothers */
118 } /* namespace stomp_moveit */
119 
120 #endif /* INDUSTRIAL_MOVEIT_STOMP_MOVEIT_INCLUDE_STOMP_MOVEIT_UPDATE_FILTERS_UPDATE_LOGGER_H_ */
virtual bool filter(std::size_t start_timestep, std::size_t num_timesteps, int iteration_number, const Eigen::MatrixXd &parameters, Eigen::MatrixXd &updates, bool &filtered) override
Store the updates values into a file that can be loaded into a numpy array.
virtual bool configure(const XmlRpc::XmlRpcValue &config)
see base class for documentation
Interface class which applies filtering methods to the update parameters before it is added onto the ...
virtual bool setMotionPlanRequest(const planning_scene::PlanningSceneConstPtr &planning_scene, const moveit_msgs::MotionPlanRequest &req, const stomp_core::StompConfiguration &config, moveit_msgs::MoveItErrorCodes &error_code)
see base class for documentation
virtual bool initialize(moveit::core::RobotModelConstPtr robot_model_ptr, const std::string &group_name, const XmlRpc::XmlRpcValue &config)
see base class for documentation
Saves the update values into a file for post analysis. The file is compatible with the python numpy l...
Definition: update_logger.h:47
virtual void done(bool success, int total_iterations, double final_cost, const Eigen::MatrixXd &parameters) override
Called by the Stomp at the end of the optimization process.
This is the base class for all stomp update filters.


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