Skip to content

Commit 5ad6f61

Browse files
committed
adding optcon examples to documentation
1 parent 64afaea commit 5ad6f61

File tree

6 files changed

+91
-14
lines changed

6 files changed

+91
-14
lines changed

ct/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
cmake_minimum_required(VERSION 2.6)
2-
project(ct)
3-
find_package(catkin REQUIRED)
4-
catkin_metapackage()
1+
cmake_minimum_required(VERSION 3.3)
2+
project(ct VERSION 3.0.1 LANGUAGES CXX)
53

64
#Make sure metapackage does not fail when building documentation
75
add_custom_target(doc

ct_core/examples/CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
11
add_executable(ex_DampedOscillatorCustomController src/DampedOscillatorCustomController.cpp)
22
target_link_libraries(ex_DampedOscillatorCustomController ct_core)
3+
list(APPEND core_ex_TARGETS ex_DampedOscillatorCustomController)
34

45
add_executable(ex_DampedOscillator src/DampedOscillator.cpp)
56
target_link_libraries(ex_DampedOscillator ct_core)
7+
list(APPEND core_ex_TARGETS ex_DampedOscillator)
68

79
add_executable(ex_MasspointIntegration src/MasspointIntegration.cpp)
810
target_link_libraries(ex_MasspointIntegration ct_core)
11+
list(APPEND core_ex_TARGETS ex_MasspointIntegration)
912

1013
add_executable(plotTest src/plot/plotTest.cpp)
11-
target_link_libraries(plotTest ct_core)
14+
target_link_libraries(plotTest ct_core
15+
list(APPEND core_ex_TARGETS plotTest)
1216

1317
if(QWT_ENABLED)
1418
add_executable(plotQwtTest src/plot/plotQwtTest.cpp)
1519
target_link_libraries(plotQwtTest ct_core)
20+
list(APPEND core_ex_TARGETS plotQwtTest)
1621
endif()
1722

23+
## install examples
24+
include(GNUInstallDirs)
25+
install(
26+
TARGETS ${core_ex_TARGETS}
27+
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/ct_core
28+
)
29+

ct_doc/doc/changelog.dox

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@
33
\page changelog Change Log
44
@tableofcontents
55

6-
For a complete list of changes, we encourage you to check out our git repository at https://bitbucket.org/adrlab/ct
6+
For a complete list of changes, we encourage you to check out our git repository at https://github.com/ethz-adrl/control-toolbox
77

8-
\section cl_v30 Version 3.0
8+
\section cl_v301 Version 3.0.1
9+
- enabled compatibility with pure cmake (no catkin or ROS required anymore)
10+
- fixed bug in explicit template prespecification
11+
- fixed bug in exporting dependencies on external solvers
12+
- default linear solver for NLPs is now a non-commercial one
13+
14+
\section cl_v300 Version 3.0.0
915
- cleaned up the state-estimation headers and fixed bugs in disturbance estimator
16+
- renamed a costfunction-headers to avoid naming conflicts when unzipping on windows.
17+
- migrating to C++14 minimal requirement
1018
- migrated to github
1119

1220
\section cl_v23 Version 2.3

ct_doc/doc/ct_doc.doxyfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,6 @@ INPUT = mainpage.dox \
763763
core_tutorial.dox \
764764
optcon_tutorial.dox \
765765
rbd_tutorial.dox \
766-
ik_tutorial.dox \
767766
performance.dox \
768767
application_examples.dox \
769768
changelog.dox \

ct_doc/doc/optcon_tutorial.dox

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ a Nonlinear Optimal Controller (NLOC), a Nonlinear Model Predictive Controller (
99
- \subpage optcon_tut_nloc_gen_constrained
1010
- \subpage optcon_tut_mpc
1111
- \subpage optcon_tut_dms
12+
- \subpage optcon_tut_nlp
13+
- \subpage optcon_tut_ekf
14+
- \subpage optcon_tut_disturbance_ekf
15+
1216

1317
\page optcon_tut_lqr LQR Control of a Damped Oscillator
1418
In this example, we will take an existing damped oscillator model, linearize the (already linear) dynamics around the steady state
@@ -25,7 +29,7 @@ rosrun ct_optcon ex_LQR
2529
\note Make sure you have built the examples before trying to run it.
2630

2731

28-
\page optcon_tut_nloc NLOC of a Damped Oscillator
32+
\page optcon_tut_nloc Optimal control of a Damped Oscillator
2933

3034
This example shows how to use the nonlinear optimal control solvers iLQR, unconstrained Gauss-Newton-Multiple-Shooting (GNMS),
3135
as well as the hybrid methods iLQR-GNMS(M), where M denotes the number of multiple-shooting intervals.
@@ -66,7 +70,7 @@ rosrun ct_optcon ex_NLOC_generalConstrained
6670
\endcode
6771

6872

69-
\page optcon_tut_mpc NLOC-MPC of a Damped Oscillator
73+
\page optcon_tut_mpc Model Predictive Control for a Damped Oscillator
7074

7175
In this example we show how to use a Nonlinear Optimal Control solver (here iLQG) in combination with the MPC-class for out-of-the box Model Predictive Control.
7276

@@ -97,4 +101,53 @@ rosrun ct_optcon ex_DMS
97101
\endcode
98102

99103

104+
\page optcon_tut_nlp Simple Examples for Nonlinear Programming
105+
106+
\note these examples show how to set up a very simple nonlinear program and solve it using IPOPT.
107+
108+
\include nlp/Nlp2D.cpp
109+
110+
You can run this example with the following command
111+
\code{.sh}
112+
rosrun ct_optcon ex_Nlp_2D
113+
\endcode
114+
115+
116+
\include nlp/Nlp3D.cpp
117+
118+
You can run this example with the following command
119+
\code{.sh}
120+
rosrun ct_optcon ex_Nlp_3D
121+
\endcode
122+
123+
124+
125+
\page optcon_tut_ekf Extended Kalman Filtering
126+
127+
This example demonstrates how to set up an Extended Kalman Filter. We simulate a system, add noise to the observations and then
128+
compute state estimates using the EKF class.
129+
130+
\include KalmanFiltering.cpp
131+
132+
You can run this example with the following command
133+
134+
\code{.sh}
135+
rosrun ct_optcon ex_KalmanFiltering
136+
\endcode
137+
138+
139+
\page optcon_tut_disturbance_ekf Extended Kalman Filter as Disturbance Observer
140+
141+
Here, we use an Extended Kalman Filter to observer an input-disturbance to a simple example system.
142+
We simulate a system, subjet to noise and a time-varying disturbance, add noise to the observations and then
143+
compute state and disturbance estimates using an EKF.
144+
145+
\include KalmanDisturbanceFiltering.cpp
146+
147+
You can run this example with the following command
148+
149+
\code{.sh}
150+
rosrun ct_optcon ex_KalmanDisturbanceFiltering
151+
\endcode
152+
100153
*/

ct_models/examples/CMakeLists.txt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11

2-
set(CT_MODELS_EXAMPLE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
3-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/exampleDir.h.in ${CMAKE_CURRENT_SOURCE_DIR}/exampleDir.h)
2+
set(CT_MODELS_EXAMPLE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
3+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/exampleDir.h.in ${CMAKE_CURRENT_SOURCE_DIR}/exampleDir.h)
44

5-
add_executable(ex_NLOC_MPC_invertedPendulum mpc/InvertedPendulum/NLOC_MPC.cpp)
6-
target_link_libraries(ex_NLOC_MPC_invertedPendulum ct_rbd)
5+
add_executable(ex_NLOC_MPC_invertedPendulum mpc/InvertedPendulum/NLOC_MPC.cpp)
6+
target_link_libraries(ex_NLOC_MPC_invertedPendulum ct_rbd)
7+
8+
## install examples
9+
include(GNUInstallDirs)
10+
install(
11+
TARGETS ex_NLOC_MPC_invertedPendulum
12+
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/ct_models
13+
)

0 commit comments

Comments
 (0)