26 #ifndef INDUSTRIAL_MOVEIT_STOMP_CORE_INCLUDE_STOMP_CORE_STOMP_UTILS_H_ 27 #define INDUSTRIAL_MOVEIT_STOMP_CORE_INCLUDE_STOMP_CORE_STOMP_UTILS_H_ 57 namespace DerivativeOrders
64 STOMP_ACCELERATION = 2,
69 namespace TrajectoryInitializations
72 enum TrajectoryInitialization
74 LINEAR_INTERPOLATION = 1,
75 CUBIC_POLYNOMIAL_INTERPOLATION,
103 static const int FINITE_DIFF_RULE_LENGTH = 7;
106 static const double FINITE_CENTRAL_DIFF_COEFFS[FINITE_DIFF_RULE_LENGTH][FINITE_DIFF_RULE_LENGTH] = {
107 {0, 0 , 0 , 1 , 0 , 0 , 0 },
108 {0, 1.0/12.0 , -2.0/3.0 , 0 , 2.0/3.0 , -1.0/12.0 , 0 },
109 {0, -1/12.0 , 16/12.0 , -30/12.0 , 16/12.0 , -1/12.0 , 0 },
110 {0, 1/12.0 , -17/12.0 , 46/12.0 , -46/12.0 , 17/12.0 , -1/12.0}
114 static const double FINITE_FORWARD_DIFF_COEFFS[FINITE_DIFF_RULE_LENGTH][FINITE_DIFF_RULE_LENGTH] = {
115 {1 , 0 , 0 , 0 , 0 , 0 , 0 },
116 {-25.0/12.0 , 4.0 , -3.0 , 4.0/3.0, -1.0/4.0 , 0 , 0 },
117 {15.0/4.0 , -77.0/6.0 , 107.0/6.0 , -13.0 , 61.0/12.0, -5.0/6.0 , 0 },
118 {-49/8 , 29 , -461/8 , 62 , -307/8 , 13 , -15/8}
128 void generateFiniteDifferenceMatrix(
int num_time_steps, DerivativeOrders::DerivativeOrder order,
double dt,
129 Eigen::MatrixXd& diff_matrix);
138 void differentiate(
const Eigen::VectorXd& parameters, DerivativeOrders::DerivativeOrder order,
139 double dt, Eigen::VectorXd& derivatives );
147 void generateSmoothingMatrix(
int num_time_steps,
double dt, Eigen::MatrixXd& projection_matrix_M);
156 void toVector(
const Eigen::MatrixXd& m,std::vector<Eigen::VectorXd>& v);
163 std::string toString(
const std::vector<Eigen::VectorXd>& data);
170 std::string toString(
const Eigen::VectorXd& data);
177 std::string toString(
const Eigen::MatrixXd& data);
int num_rollouts
Number of noisy trajectories.
The data structure used to store information about a single rollout.
Eigen::VectorXd state_costs
A vector [num_time_steps] of the cost at each timestep.
int num_iterations
Maximum number of iteration allowed.
double control_cost_weight
Percentage of the trajectory accelerations cost to be applied in the total cost calculation > ...
int num_dimensions
Parameter dimensionality.
double exponentiated_cost_sensitivity
Default exponetiated cost sensitivity coefficient.
Eigen::MatrixXd probabilities
A matrix [num_dimensions][num_time_steps] of the probability for each parameter at every timestep...
std::vector< double > full_costs
A vector [num_dimensions] of the full coss, state_cost + control_cost for each joint over the entire ...
The data structure used to store STOMP configuration parameters.
Eigen::MatrixXd parameters_noise
A matrix [num_dimensions][num_time_steps] of the sum of parameters + noise.
int initialization_method
TrajectoryInitializations::TrajectoryInitialization.
double importance_weight
importance sampling weight
double total_cost
combined state + control cost over the entire trajectory for all joints
Eigen::MatrixXd noise
A matrix [num_dimensions][num_time_steps] of random noise applied to the parameters.
int max_rollouts
The combined number of new and old rollouts during each iteration shouldn't exceed this value...
std::vector< double > full_probabilities
A vector [num_dimensions] of the probabilities for the full trajectory.
double delta_t
Time change between consecutive points.
Eigen::MatrixXd total_costs
A matrix [num_dimensions][num_time_steps] of the total cost, where total_cost[d] = state_costs_ + con...
int num_iterations_after_valid
Stomp will stop optimizing this many iterations after finding a valid solution.
Eigen::MatrixXd control_costs
A matrix [num_dimensions][num_time_steps] of the control cost for each parameter at every timestep...
int num_timesteps
Number of timesteps.