68 const double gravity_ = 9.81);
266 WMG (
const unsigned int N_,
267 const unsigned int T_,
268 const double step_height_ = 0.0135,
269 double bezier_weight_1_ = 1.0,
270 double bezier_weight_2_ = 2.0,
271 double bezier_inclination_1_ = 0.01,
272 double bezier_inclination_2_ = 0.008,
273 bool use_fsr_constraints =
false);
292 const unsigned int def_periods,
293 const unsigned int ds_periods,
294 const unsigned int ds_number,
295 bool use_user_constraints_ =
false);
309 const unsigned int def_time_ms_,
310 const unsigned int ds_time_ms_,
311 const unsigned int ds_number,
312 bool use_user_constraints_ =
false);
358 const unsigned int shift_from_current_ms,
359 double * left_foot_pos,
360 double * right_foot_pos);
399 void FS2file(
const std::string filename,
const bool plot_ds =
true);
411 std::vector<double> &x_coord,
412 std::vector<double> &y_coord,
413 std::vector<double> &angle_rot);
420 std::vector<footstep>
FS;
double step_height
The maximum height, that can be reached by a swing foot.
int getPrevSS(const int, const fs_type type=FS_TYPE_AUTO)
Returns index of the previous SS.
void getDSFeetPositions(const int, double *, double *)
Determine position and orientation of feet in DS.
Defines the parameters of the Walking Pattern Generator.
double * zref_y
N reference coordinates of ZMP.
A container for parameters of the SMPC solver.
WMGret formPreviewWindow(smpc_parameters &)
Forms a preview window.
void getFootsteps(std::vector< double > &x_coord, std::vector< double > &y_coord, std::vector< double > &angle_rot)
Return coordinates of footstep reference points and rotation angles of footsteps (only for SS).
void getSSFeetPositions(const int, const double, double *, double *)
Determine position and orientation of feet (parabolic trajectory)
defConstraints def_constraints
Default SS and DS constraints.
double bezier_inclination_2
A container for a state in the original form:
void getSSFeetPositionsBezier(const int, const double, double *, double *)
Determine position and orientation of feet (using cubic Bezier curves)
double * zref_x
N reference coordinates of ZMP.
unsigned int last_time_decrement
Interface of the library.
double * fp_x
Coordinates of N points satisfying constraints,.
int getNextSS(const int, const fs_type type=FS_TYPE_AUTO)
Returns index of the next SS.
void setFootstepParametersMS(const unsigned int def_time_ms_, const unsigned int ds_time_ms_, const unsigned int ds_number, bool use_user_constraints_=false)
Set default parameters of footsteps.
void changeNextSSPosition(const double *posture, const bool zero_z_coordinate)
Changes position of the next SS.
double ds[4]
Both feet standing together.
Default footstep constraints.
bool use_user_constraints
Constraints given by the user, initialized to the default values on initialization.
unsigned int N
Number of iterations in a preview window.
double * lb
2*N bounds for coordinates of ZMP position.
void getFeetPositions(const unsigned int shift_from_current_ms, double *left_foot_pos, double *right_foot_pos)
Determine position and orientation of feet.
double auto_ds[4]
Automatically added DS.
bool isSupportSwitchNeeded()
Checks if the support foot switch is needed.
std::vector< footstep > FS
A vector of footsteps.
double h0
h = hCoM/gravity for each preview step
double * T
Norm of the acceleration due to gravity.
void FS2file(const std::string filename, const bool plot_ds=true)
Outputs the footsteps in FS to a Matlab/Octave script for plotting.
~smpc_parameters()
Default destructor.
unsigned int sampling_period
smpc_parameters(const unsigned int, const double, const double gravity_=9.81)
Allocate memory and initialize some of the parameters.
double user_constraints_auto_ds[4]
Constraints given by the user, initialized to the default values on initialization.
int first_preview_step
The first step in the current preview window.
double bezier_inclination_1
double user_constraints[4]
Constraints given by the user, initialized to the default values on initialization.
double * ub
2*N bounds for coordinates of ZMP position.
double ss_left[4]
Support constraints with safety margin.
double support_distance_y
Distance between reference points of the feet.
double gravity
Height of the CoM.
double * h
Preview sampling time.
smpc::state_com init_state
WMG(const unsigned int N_, const unsigned int T_, const double step_height_=0.0135, double bezier_weight_1_=1.0, double bezier_weight_2_=2.0, double bezier_inclination_1_=0.01, double bezier_inclination_2_=0.008, bool use_fsr_constraints=false)
Initializes a WMG object.
void setFootstepParameters(const unsigned int def_periods, const unsigned int ds_periods, const unsigned int ds_number, bool use_user_constraints_=false)
Set default parameters of footsteps, a wrapper around not so safe setFootstepParametersMS function.
int current_step_number
This is the step in FS that is at the start of the current preview window.
double * X
A chunk of memory allocated for solution.
void repositionFootsteps(const double diff_x, const double diff_y)
Reposition all subsequent footsteps that are not fixed at the current moment.
void addFootstep(const double, const double, const double, fs_type type=FS_TYPE_AUTO)
Adds a footstep to FS.
double * fp_y
Coordinates of N points satisfying constraints,.