Skip to content
Snippets Groups Projects
Commit 38553b3f authored by Pierre-Alexandre Leziart's avatar Pierre-Alexandre Leziart
Browse files

Example of walking gait

parent 9cb07cd6
No related branches found
No related tags found
No related merge requests found
...@@ -30,7 +30,7 @@ void Gait::initialize(double dt_in, double T_gait_in, double T_mpc_in, int N_gai ...@@ -30,7 +30,7 @@ void Gait::initialize(double dt_in, double T_gait_in, double T_mpc_in, int N_gai
if((n_steps_ > N_gait) || ((int)std::lround(T_gait_in / dt_in) > N_gait)) if((n_steps_ > N_gait) || ((int)std::lround(T_gait_in / dt_in) > N_gait))
throw std::invalid_argument("Sizes of matrices are too small for considered durations. Increase N_gait in config file."); throw std::invalid_argument("Sizes of matrices are too small for considered durations. Increase N_gait in config file.");
create_trot(); create_walk();
create_gait_f(); create_gait_f();
} }
......
...@@ -9,8 +9,8 @@ robot: ...@@ -9,8 +9,8 @@ robot:
envID: 0 # Identifier of the environment to choose in which one the simulation will happen envID: 0 # Identifier of the environment to choose in which one the simulation will happen
velID: 2 # Identifier of the reference velocity profile to choose which one will be sent to the robot velID: 2 # Identifier of the reference velocity profile to choose which one will be sent to the robot
dt_mpc: 0.02 # Time step of the model predictive control dt_mpc: 0.02 # Time step of the model predictive control
T_gait: 0.32 # Duration of one gait period T_gait: 0.64 # Duration of one gait period
T_mpc: 0.32 # Duration of the prediction horizon T_mpc: 0.64 # Duration of the prediction horizon
N_SIMULATION: 3000 # Number of simulated wbc time steps N_SIMULATION: 3000 # Number of simulated wbc time steps
type_MPC: true # Which MPC solver you want to use: True to have PA's MPC, to False to have Thomas's MPC type_MPC: true # Which MPC solver you want to use: True to have PA's MPC, to False to have Thomas's MPC
use_flat_plane: true # If True the ground is flat, otherwise it has bumps use_flat_plane: true # If True the ground is flat, otherwise it has bumps
......
...@@ -190,7 +190,7 @@ int main(int argc, char** argv) { ...@@ -190,7 +190,7 @@ int main(int argc, char** argv) {
std::cout << desiredGait_ << std::endl; std::cout << desiredGait_ << std::endl;
std::cout << "##" << std::endl; std::cout << "##" << std::endl;
*/ */
Gait gait = Gait(); /*Gait gait = Gait();
gait.initialize(0.02, 0.32, 0.16); gait.initialize(0.02, 0.32, 0.16);
std::cout << gait.getPastGait() << std::endl << "##" << std::endl; std::cout << gait.getPastGait() << std::endl << "##" << std::endl;
...@@ -204,7 +204,7 @@ int main(int argc, char** argv) { ...@@ -204,7 +204,7 @@ int main(int argc, char** argv) {
std::cout << gait.getPastGait() << std::endl << "##" << std::endl; std::cout << gait.getPastGait() << std::endl << "##" << std::endl;
std::cout << gait.getCurrentGait() << std::endl << "##" << std::endl; std::cout << gait.getCurrentGait() << std::endl << "##" << std::endl;
std::cout << gait.getDesiredGait() << std::endl << "##" << std::endl; std::cout << gait.getDesiredGait() << std::endl << "##" << std::endl;
} }*/
return EXIT_SUCCESS; return EXIT_SUCCESS;
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment