goal_guided_multivariate_gaussian.h
Go to the documentation of this file.
1 
27 #ifndef STOMP_PLUGINS_INCLUDE_STOMP_PLUGINS_NOISE_GENERATORS_GOAL_GUIDED_MULTIVARIATE_GAUSSIAN_H_
28 #define STOMP_PLUGINS_INCLUDE_STOMP_PLUGINS_NOISE_GENERATORS_GOAL_GUIDED_MULTIVARIATE_GAUSSIAN_H_
29 
31 #include <stomp_moveit/utils/multivariate_gaussian.h>
33 
34 
35 namespace stomp_moveit
36 {
37 namespace noise_generators
38 {
39 
40 typedef boost::mt19937 RGNType;
41 typedef boost::variate_generator< RGNType, boost::uniform_real<> > RandomGenerator;
42 
52 {
53 public:
56 
64  virtual bool initialize(moveit::core::RobotModelConstPtr robot_model_ptr,
65  const std::string& group_name,const XmlRpc::XmlRpcValue& config) override;
66 
72  virtual bool configure(const XmlRpc::XmlRpcValue& config) override;
73 
82  virtual bool setMotionPlanRequest(const planning_scene::PlanningSceneConstPtr& planning_scene,
83  const moveit_msgs::MotionPlanRequest &req,
84  const stomp_core::StompConfiguration &config,
85  moveit_msgs::MoveItErrorCodes& error_code) override;
86 
98  virtual bool generateNoise(const Eigen::MatrixXd& parameters,
99  std::size_t start_timestep,
100  std::size_t num_timesteps,
101  int iteration_number,
102  int rollout_number,
103  Eigen::MatrixXd& parameters_noise,
104  Eigen::MatrixXd& noise) override;
105 
114  virtual void done(bool success,int total_iterations,double final_cost,const Eigen::MatrixXd& parameters){}
115 
116 
117  virtual std::string getName() const
118  {
119  return name_ + "/" + group_;
120  }
121 
122 
123  virtual std::string getGroupName() const
124  {
125  return group_;
126  }
127 
128 protected:
129 
130  virtual bool setupNoiseGeneration(const planning_scene::PlanningSceneConstPtr& planning_scene,
131  const moveit_msgs::MotionPlanRequest &req,
132  const stomp_core::StompConfiguration &config,
133  moveit_msgs::MoveItErrorCodes& error_code);
134 
135  virtual bool setupGoalConstraints(const planning_scene::PlanningSceneConstPtr& planning_scene,
136  const moveit_msgs::MotionPlanRequest &req,
137  const stomp_core::StompConfiguration &config,
138  moveit_msgs::MoveItErrorCodes& error_code);
139 
146  virtual bool generateRandomGoal(const Eigen::VectorXd& reference_joint_pose,Eigen::VectorXd& goal_joint_pose);
147 
148 protected:
149 
150  // names
151  std::string name_;
152  std::string group_;
153 
154  // goal constraints
155  std::string tool_link_;
156  Eigen::VectorXd tool_goal_tolerance_;
157 
158  // ros parameters
159  std::vector<double> stddev_;
161  // noisy trajectory generation
162  std::vector<utils::MultivariateGaussianPtr> traj_noise_generators_;
163  Eigen::VectorXd raw_noise_;
165  // random goal generation
168  // robot
169  moveit::core::RobotModelConstPtr robot_model_;
170  moveit::core::RobotStatePtr state_;
171  stomp_moveit::utils::kinematics::IKSolverPtr ik_solver_;
172 
173 };
174 
175 } /* namespace noise_generators */
176 } /* namespace stomp_moveit */
177 
178 #endif /* STOMP_PLUGINS_INCLUDE_STOMP_PLUGINS_NOISE_GENERATORS_GOAL_GUIDED_MULTIVARIATE_GAUSSIAN_H_ */
virtual bool configure(const XmlRpc::XmlRpcValue &config) override
Sets internal members of the plugin from the configuration data.
virtual bool generateRandomGoal(const Eigen::VectorXd &reference_joint_pose, Eigen::VectorXd &goal_joint_pose)
Genereates a random tool pose by apply noise on the redundant axis to a reference tool pose;...
virtual bool setupNoiseGeneration(const planning_scene::PlanningSceneConstPtr &planning_scene, const moveit_msgs::MotionPlanRequest &req, const stomp_core::StompConfiguration &config, moveit_msgs::MoveItErrorCodes &error_code)
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.
virtual bool initialize(moveit::core::RobotModelConstPtr robot_model_ptr, const std::string &group_name, const XmlRpc::XmlRpcValue &config) override
Initializes and configures.
boost::shared_ptr< RandomGenerator > goal_rand_generator_
Random generator for the tool goal pose.
virtual bool generateNoise(const Eigen::MatrixXd &parameters, std::size_t start_timestep, std::size_t num_timesteps, int iteration_number, int rollout_number, Eigen::MatrixXd &parameters_noise, Eigen::MatrixXd &noise) override
Generates a noisy trajectory from the parameters.
boost::variate_generator< RGNType, boost::uniform_real<> > RandomGenerator
This class generates noisy trajectories to an under-constrained cartesian goal pose.
std::vector< double > stddev_
The standard deviations applied to each joint, [num_dimensions x 1.
std::vector< utils::MultivariateGaussianPtr > traj_noise_generators_
Randomized numerical distribution generators, [6 x 1].
virtual void done(bool success, int total_iterations, double final_cost, const Eigen::MatrixXd &parameters)
Called by the Stomp at the end of the optimization process.
virtual bool setupGoalConstraints(const planning_scene::PlanningSceneConstPtr &planning_scene, const moveit_msgs::MotionPlanRequest &req, const stomp_core::StompConfiguration &config, moveit_msgs::MoveItErrorCodes &error_code)


stomp_plugins
Author(s): Jorge Nicho
autogenerated on Fri May 8 2020 03:35:53