Skip to content

Commit

Permalink
Fixed the links to matlab scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
ayonga committed Jul 20, 2018
1 parent 44d1c04 commit 971e230
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The last command will move the compiled library `libcassie_dynamics.a` to the `l

## Generate other functions and optimization configuration files ##

Next, run [`cassie_opt.m`](https://github.com/UMich-BipedLab/Cassie_CFROST/blob/master/Cassie_example/opt_two_step/cassie_opt.m) script in MATLAB to generate other functions and configuration files. This script should create two folders:
Next, run [`cassie_opt.m`](https://github.com/UMich-BipedLab/Cassie_CFROST/blob/master/Cassie_Example/opt_two_step/cassie_opt.m) script in MATLAB to generate other functions and configuration files. This script should create two folders:

* `gen`: export and compile MEX binaries used for FROST in MATLAB (you can run the optimization in MATLAB as before)
* `periodic`: export all functions and configuration files required for C-FROST.
Expand Down Expand Up @@ -74,15 +74,15 @@ The input arguments are:
* --solution: the output file to export the optimization results (structured data, more information)
* --output: another output file to export the optimization results (just the vector of solution from IPOPT)

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).
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).

# Run multiple gait optimization #

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.

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.

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.
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.

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.
```shell
Expand All @@ -94,4 +94,4 @@ You can use `time` to measure the run time:
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}
```

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.
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.

0 comments on commit 971e230

Please sign in to comment.