-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
3,798 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(nmpc_cgmres) | ||
|
||
add_compile_options(-std=c++17) | ||
|
||
# Options | ||
option(OPTIMIZE_FOR_NATIVE "Enable -march=native" OFF) | ||
|
||
find_package(catkin REQUIRED COMPONENTS | ||
roscpp | ||
) | ||
|
||
# Eigen | ||
find_package(Eigen3 REQUIRED) | ||
include_directories(${EIGEN3_INCLUDE_DIR}) | ||
|
||
catkin_package( | ||
CATKIN_DEPENDS | ||
roscpp | ||
DEPENDS EIGEN3 | ||
INCLUDE_DIRS include | ||
LIBRARIES nmpc_cgmres | ||
) | ||
|
||
add_library(nmpc_cgmres | ||
src/CgmresSolver.cpp | ||
) | ||
target_include_directories(nmpc_cgmres PUBLIC | ||
include | ||
${catkin_INCLUDE_DIRS} | ||
) | ||
target_link_libraries(nmpc_cgmres PUBLIC | ||
${catkin_LIBRARIES} | ||
) | ||
if(OPTIMIZE_FOR_NATIVE) | ||
target_compile_options(nmpc_cgmres INTERFACE -march=native) | ||
endif() | ||
|
||
if(CATKIN_ENABLE_TESTING) | ||
add_subdirectory(tests) | ||
endif() | ||
|
||
OPTION(INSTALL_DOCUMENTATION "Generate and install the documentation" OFF) | ||
if(INSTALL_DOCUMENTATION) | ||
add_subdirectory(doc) | ||
endif() |
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 @@ | ||
# nmpc_cgmres | ||
Non-linear model predictive control (NMPC) with continuation/GMRES method (C/GMRES) | ||
|
||
[](https://github.com/isri-aist/NMPC/actions/workflows/ci.yaml) | ||
[](https://isri-aist.github.io/NMPC/nmpc_cgmres/index.html) | ||
|
||
## Control method | ||
See the following for a detailed algorithm. | ||
- T Ohtsuka. Continuation/GMRES method for fast computation of nonlinear receding horizon control. Automatica. 2004. | ||
- https://www.coronasha.co.jp/np/isbn/9784339033182/ | ||
- https://www.coronasha.co.jp/np/isbn/9784339032109/ | ||
|
||
## Examples | ||
Make sure that it is built with `--catkin-make-args tests` option. | ||
|
||
### Semiactive damper | ||
```bash | ||
$ rosrun nmpc_cgmres TestCgmresSolver --gtest_filter=*SemiactiveDamperProblem | ||
$ rosrun nmpc_cgmres plotCgmresData.py | ||
``` | ||
 | ||
|
||
### Cart-pole | ||
```bash | ||
$ rosrun nmpc_cgmres TestCgmresSolver --gtest_filter=*CartPoleProblem | ||
$ rosrun nmpc_cgmres plotCgmresData.py | ||
``` | ||
 |
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,13 @@ | ||
find_package(Doxygen REQUIRED) | ||
|
||
if(DOXYGEN_FOUND) | ||
set(DOXYFILE_PATH ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) | ||
|
||
configure_file(Doxyfile.in ${DOXYFILE_PATH}) | ||
|
||
add_custom_target(nmpc_cgmres_doc ALL | ||
${DOXYGEN_EXECUTABLE} ${DOXYFILE_PATH} | ||
DEPENDS ${DOXYFILE_PATH} | ||
COMMENT "Generating Doxygen documentation" | ||
) | ||
endif() |
Oops, something went wrong.