Skip to content

Commit 56cb053

Browse files
committed
updated multiple gait optimization tutorials.
1 parent ff83fe1 commit 56cb053

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

Cassie_example/opt_two_step/cassie_opt.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@
191191
if ~exist(fullfile(CFROST_OPT_PATH, 'ipopt.opt'), 'file')
192192
copyfile(fullfile('res', 'ipopt.opt'), fullfile(CFROST_OPT_PATH, 'ipopt.opt'));
193193
end
194-
copyfile(fullfile('res', 'run_all.sh'), fullfile(c_code_path, 'run_all.sh'));
195194
end
196195

197196
% Example commands

Cassie_example/opt_two_step/res/run_all.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
This repository contains an example using C-FROST to generate a library of walking gaits for Cassie series robot. The code depends on [FROST](https://github.com/ayonga/frost-dev) and [C-FROST](https://github.com/UMich-BipedLab/C-Frost). The Cassie model used in this example can be found [here](https://github.com/UMich-BipedLab/Cassie_Model). These dependant packages are also included as [git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) for convenience.
44

5+
This example has been tested on Ubuntu 16.04 and Windows Subsystem on Linux (WSL).
6+
57
# Download #
68

79
To download this example with submodules, run:
@@ -75,3 +77,23 @@ The input arguments are:
7577
C-FROST will export the optimization results to the specified JSON file. This can be easily imported to MATLAB to further analyze the optimal gait. A simple example of loading this file, see [`analyze_solution.m`](https://github.com/UMich-BipedLab/Cassie_CFROST/blob/master/Cassie_example/opt_two_step/analyze_solution.m).
7678

7779
# Run multiple gait optimization #
80+
81+
With C-FROST, it is easy to run multiple gait optimization in parallel. You do not need to recompile the program as long as these optimizations use the same problem strcuture (same set of variables, constraints and cost functions). To run multiple optimization with different bounds, you would need to generate the bound JSON files for all optimization a priori.
82+
83+
In this example, we generate 11x11x11=1,331 gaits with different walking speeds and ground inclinations. This can be done by changing the constraints bounds in the same optimization problem.
84+
85+
In MATLAB, run [`generate_multiple_bounds.m`](https://github.com/UMich-BipedLab/Cassie_CFROST/blob/master/Cassie_example/opt_two_step/generate_multiple_bounds.m) script to generate all bound files first. The process may take a while to finish.
86+
87+
Once done, you can use run multiple optimization in parallel from the terminal. We particularly use [GNU Parallel](https://www.gnu.org/software/parallel/) package for this process.
88+
```shell
89+
parallel ./program --initial 'res/init.json' --options '../ipopt.opt' --data 'res/data.json' --bounds "res/bounds_{}.json" --solution "../local/output/sol_{}.json" ">" "../local/log/log_{}.txt" ::: {1..1331}
90+
```
91+
92+
You can use `time` to measure the run time:
93+
```shell
94+
time parallel ./program --initial 'res/init.json' --options '../ipopt.opt' --data 'res/data.json' --bounds "res/bounds_{}.json" --solution "../local/output/sol_{}.json" ">" "../local/log/log_{}.txt" ::: {1..1331}
95+
```
96+
97+
The optimization results will be saved to `local/output/` folder, and the terminal outputs will be save to `local/log` folder. The scripts [`export_all_gaits.m`](https://github.com/UMich-BipedLab/Cassie_CFROST/blob/master/Cassie_example/opt_two_step/export_all_gaits.m) and [`check_logs.m`](https://github.com/UMich-BipedLab/Cassie_CFROST/blob/master/Cassie_example/opt_two_step/check_logs.m) can be used to import the resuls into MATLAB and check the log files.
98+
99+

0 commit comments

Comments
 (0)