-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #148 from utiasDSL/mpc_examples
Added MPC and Linear MPC examples
- Loading branch information
Showing
22 changed files
with
804 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
examples/mpc/config_overrides/cartpole/cartpole_stabilization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
task_config: | ||
seed: 42 | ||
info_in_reset: True | ||
ctrl_freq: 15 | ||
pyb_freq: 750 | ||
physics: pyb | ||
|
||
init_state_randomization_info: | ||
init_x: | ||
distrib: 'uniform' | ||
low: -2 | ||
high: 2 | ||
init_x_dot: | ||
distrib: 'uniform' | ||
low: -0.1 | ||
high: 0.1 | ||
init_theta: | ||
distrib: 'uniform' | ||
low: -0.2 | ||
high: 0.2 | ||
init_theta_dot: | ||
distrib: 'uniform' | ||
low: -0.1 | ||
high: 0.1 | ||
|
||
task: stabilization | ||
task_info: | ||
stabilization_goal: [1.0, 0.0] | ||
stabilization_goal_tolerance: 0.0 | ||
|
||
episode_len_sec: 6 | ||
cost: quadratic | ||
done_on_out_of_bound: True | ||
|
||
constraints: | ||
- constraint_form: default_constraint | ||
constrained_variable: input | ||
- constraint_form: default_constraint | ||
constrained_variable: state |
42 changes: 42 additions & 0 deletions
42
examples/mpc/config_overrides/cartpole/cartpole_tracking.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
task_config: | ||
seed: 42 | ||
info_in_reset: True | ||
ctrl_freq: 15 | ||
pyb_freq: 750 | ||
physics: pyb | ||
|
||
init_state_randomization_info: | ||
init_x: | ||
distrib: 'uniform' | ||
low: -1 | ||
high: 1 | ||
init_x_dot: | ||
distrib: 'uniform' | ||
low: -0.1 | ||
high: 0.1 | ||
init_theta: | ||
distrib: 'uniform' | ||
low: -0.2 | ||
high: 0.2 | ||
init_theta_dot: | ||
distrib: 'uniform' | ||
low: -0.1 | ||
high: 0.1 | ||
|
||
task: traj_tracking | ||
task_info: | ||
trajectory_type: 'circle' | ||
num_cycles: 2 | ||
trajectory_plane: 'zx' | ||
trajectory_position_offset: [0, 0] | ||
trajectory_scale: 1 | ||
|
||
episode_len_sec: 6 | ||
cost: quadratic | ||
done_on_out_of_bound: True | ||
|
||
constraints: | ||
- constraint_form: default_constraint | ||
constrained_variable: input | ||
- constraint_form: default_constraint | ||
constrained_variable: state |
17 changes: 17 additions & 0 deletions
17
examples/mpc/config_overrides/cartpole/linear_mpc_cartpole_stabilization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
algo: linear_mpc | ||
algo_config: | ||
horizon: 20 | ||
r_mpc: | ||
- 0.1 | ||
q_mpc: | ||
- 5.0 | ||
- 0.1 | ||
- 5.0 | ||
- 0.1 | ||
# Prior info | ||
prior_info: | ||
prior_prop: null | ||
randomize_prior_prop: False | ||
prior_prop_rand_info: null | ||
warmstart: True | ||
solver: qrqp |
17 changes: 17 additions & 0 deletions
17
examples/mpc/config_overrides/cartpole/linear_mpc_cartpole_tracking.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
algo: linear_mpc | ||
algo_config: | ||
horizon: 40 | ||
r_mpc: | ||
- 0.1 | ||
q_mpc: | ||
- 5.0 | ||
- 0.1 | ||
- 5.0 | ||
- 0.1 | ||
# Prior info | ||
prior_info: | ||
prior_prop: null | ||
randomize_prior_prop: False | ||
prior_prop_rand_info: null | ||
warmstart: True | ||
solver: qrqp |
17 changes: 17 additions & 0 deletions
17
examples/mpc/config_overrides/cartpole/mpc_cartpole_stabilization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
algo: mpc | ||
algo_config: | ||
horizon: 20 | ||
r_mpc: | ||
- 0.1 | ||
q_mpc: | ||
- 5.0 | ||
- 0.1 | ||
- 5.0 | ||
- 0.1 | ||
# Prior info | ||
prior_info: | ||
prior_prop: null | ||
randomize_prior_prop: False | ||
prior_prop_rand_info: null | ||
warmstart: True | ||
solver: ipopt |
17 changes: 17 additions & 0 deletions
17
examples/mpc/config_overrides/cartpole/mpc_cartpole_tracking.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
algo: mpc | ||
algo_config: | ||
horizon: 20 | ||
r_mpc: | ||
- 0.1 | ||
q_mpc: | ||
- 5.0 | ||
- 0.1 | ||
- 5.0 | ||
- 0.1 | ||
# Prior info | ||
prior_info: | ||
prior_prop: null | ||
randomize_prior_prop: False | ||
prior_prop_rand_info: null | ||
warmstart: True | ||
solver: ipopt |
20 changes: 20 additions & 0 deletions
20
examples/mpc/config_overrides/quadrotor_2D/linear_mpc_quadrotor_2D_stabilization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
algo: linear_mpc | ||
algo_config: | ||
horizon: 20 | ||
r_mpc: | ||
- 0.1 | ||
- 0.1 | ||
q_mpc: | ||
- 5.0 | ||
- 0.1 | ||
- 5.0 | ||
- 0.1 | ||
- 0.1 | ||
- 0.1 | ||
# Prior info | ||
prior_info: | ||
prior_prop: null | ||
randomize_prior_prop: False | ||
prior_prop_rand_info: null | ||
warmstart: True | ||
solver: qrqp |
20 changes: 20 additions & 0 deletions
20
examples/mpc/config_overrides/quadrotor_2D/linear_mpc_quadrotor_2D_tracking.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
algo: linear_mpc | ||
algo_config: | ||
horizon: 40 | ||
r_mpc: | ||
- 0.1 | ||
- 0.1 | ||
q_mpc: | ||
- 1.0 | ||
- 0.1 | ||
- 1.0 | ||
- 0.1 | ||
- 0.1 | ||
- 0.1 | ||
# Prior info | ||
prior_info: | ||
prior_prop: null | ||
randomize_prior_prop: False | ||
prior_prop_rand_info: null | ||
warmstart: True | ||
solver: qrqp |
20 changes: 20 additions & 0 deletions
20
examples/mpc/config_overrides/quadrotor_2D/mpc_quadrotor_2D_stabilization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
algo: mpc | ||
algo_config: | ||
horizon: 20 | ||
r_mpc: | ||
- 0.1 | ||
- 0.1 | ||
q_mpc: | ||
- 5.0 | ||
- 0.1 | ||
- 5.0 | ||
- 0.1 | ||
- 0.1 | ||
- 0.1 | ||
# Prior info | ||
prior_info: | ||
prior_prop: null | ||
randomize_prior_prop: False | ||
prior_prop_rand_info: null | ||
warmstart: True | ||
solver: ipopt |
20 changes: 20 additions & 0 deletions
20
examples/mpc/config_overrides/quadrotor_2D/mpc_quadrotor_2D_tracking.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
algo: mpc | ||
algo_config: | ||
horizon: 20 | ||
r_mpc: | ||
- 0.1 | ||
- 0.1 | ||
q_mpc: | ||
- 5.0 | ||
- 0.1 | ||
- 5.0 | ||
- 0.1 | ||
- 0.1 | ||
- 0.1 | ||
# Prior info | ||
prior_info: | ||
prior_prop: null | ||
randomize_prior_prop: False | ||
prior_prop_rand_info: null | ||
warmstart: True | ||
solver: ipopt |
51 changes: 51 additions & 0 deletions
51
examples/mpc/config_overrides/quadrotor_2D/quadrotor_2D_stabilization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
task_config: | ||
seed: 1337 | ||
info_in_reset: True | ||
ctrl_freq: 50 | ||
pyb_freq: 1000 | ||
gui: False | ||
physics: pyb | ||
quad_type: 2 | ||
|
||
init_state_randomization_info: | ||
init_x: | ||
distrib: 'uniform' | ||
low: -1 | ||
high: 1 | ||
init_x_dot: | ||
distrib: 'uniform' | ||
low: -0.1 | ||
high: 0.1 | ||
init_z: | ||
distrib: 'uniform' | ||
low: 0.5 | ||
high: 1.5 | ||
init_z_dot: | ||
distrib: 'uniform' | ||
low: -0.1 | ||
high: 0.1 | ||
init_theta: | ||
distrib: 'uniform' | ||
low: -0.2 | ||
high: 0.2 | ||
init_theta_dot: | ||
distrib: 'uniform' | ||
low: -0.1 | ||
high: 0.1 | ||
randomized_init: True | ||
randomized_inertial_prop: False | ||
|
||
task: stabilization | ||
task_info: | ||
stabilization_goal: [0, 1] | ||
stabilization_goal_tolerance: 0.0 | ||
|
||
episode_len_sec: 6 | ||
cost: quadratic | ||
done_on_out_of_bound: True | ||
|
||
constraints: | ||
- constraint_form: default_constraint | ||
constrained_variable: input | ||
- constraint_form: default_constraint | ||
constrained_variable: state |
54 changes: 54 additions & 0 deletions
54
examples/mpc/config_overrides/quadrotor_2D/quadrotor_2D_tracking.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
task_config: | ||
seed: 1337 | ||
info_in_reset: True | ||
ctrl_freq: 50 | ||
pyb_freq: 1000 | ||
gui: False | ||
physics: pyb | ||
quad_type: 2 | ||
|
||
init_state_randomization_info: | ||
init_x: | ||
distrib: 'uniform' | ||
low: -1 | ||
high: 1 | ||
init_x_dot: | ||
distrib: 'uniform' | ||
low: -0.1 | ||
high: 0.1 | ||
init_z: | ||
distrib: 'uniform' | ||
low: 0.5 | ||
high: 1.5 | ||
init_z_dot: | ||
distrib: 'uniform' | ||
low: -0.1 | ||
high: 0.1 | ||
init_theta: | ||
distrib: 'uniform' | ||
low: -0.2 | ||
high: 0.2 | ||
init_theta_dot: | ||
distrib: 'uniform' | ||
low: -0.1 | ||
high: 0.1 | ||
randomized_init: True | ||
randomized_inertial_prop: False | ||
|
||
task: traj_tracking | ||
task_info: | ||
trajectory_type: figure8 | ||
num_cycles: 1 | ||
trajectory_plane: 'xz' | ||
trajectory_position_offset: [0, 1] | ||
trajectory_scale: 0.75 | ||
|
||
episode_len_sec: 6 | ||
cost: quadratic | ||
done_on_out_of_bound: True | ||
|
||
constraints: | ||
- constraint_form: default_constraint | ||
constrained_variable: input | ||
- constraint_form: default_constraint | ||
constrained_variable: state |
28 changes: 28 additions & 0 deletions
28
examples/mpc/config_overrides/quadrotor_3D/linear_mpc_quadrotor_3D_stabilization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
algo: linear_mpc | ||
algo_config: | ||
horizon: 20 | ||
r_mpc: | ||
- 0.1 | ||
- 0.1 | ||
- 0.1 | ||
- 0.1 | ||
q_mpc: | ||
- 5.0 | ||
- 0.1 | ||
- 5.0 | ||
- 0.1 | ||
- 5.0 | ||
- 0.1 | ||
- 0.1 | ||
- 0.1 | ||
- 0.1 | ||
- 0.1 | ||
- 0.1 | ||
- 0.1 | ||
# Prior info | ||
prior_info: | ||
prior_prop: null | ||
randomize_prior_prop: False | ||
prior_prop_rand_info: null | ||
warmstart: True | ||
solver: qrqp |
Oops, something went wrong.