Skip to content

Commit 4ae40bb

Browse files
committed
added a simple bash script to install ct
1 parent 340f885 commit 4ae40bb

File tree

4 files changed

+75
-29
lines changed

4 files changed

+75
-29
lines changed

ct/build_ct.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
3+
build_module(){
4+
# if module directory exists
5+
if [ -d "../$1" ]; then
6+
7+
echo " === Starting module " $1 " === "
8+
# go to that module
9+
cd ../$1
10+
echo "Current directory is " $PWD
11+
12+
# collect array of all args, remove first arg because that is equal to the module to be built
13+
build_flags=( "$@" )
14+
unset build_flags[0]
15+
16+
# make and go to build directory
17+
mkdir -p build && cd build
18+
19+
echo "Building with the following flags ... "
20+
printf '%s\n' "${build_flags[@]}"
21+
22+
make clean
23+
cmake .. ${build_flags[*]}
24+
make -j4
25+
sudo make install >/dev/null
26+
cd ..
27+
echo " === completed " $1 " === "
28+
else
29+
echo "ERROR: you need to start the installer from the control-toolbox/ct directory."
30+
exit 1
31+
fi
32+
}
33+
34+
# check number of user input args
35+
# no args
36+
if [ -z "$1" ]
37+
then
38+
echo "No build flags supplied, using -DCMAKE_BUILD_TYPE=Release"
39+
BUILD_FLAGS="-DCMAKE_BUILD_TYPE=Release"
40+
else
41+
# entire user input is interpreted as build flags
42+
BUILD_FLAGS="$@"
43+
fi
44+
45+
build_module ct_core $BUILD_FLAGS
46+
build_module ct_optcon $BUILD_FLAGS
47+
build_module ct_rbd $BUILD_FLAGS
48+
build_module ct_models $BUILD_FLAGS
49+
50+
exit 0

ct_doc/doc/getting_started.dox

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ follow the Tutorials below.
99
- \subpage core_tutorials "ct core Tutorials"
1010
- \subpage optcon_tutorials "ct optcon Tutorials"
1111
- \subpage rbd_tutorials "ct rbd Tutorials"
12-
- \subpage ik_tutorials "Inverse kinematics Tutorials"
1312

1413
If you need additional support, feel free to create an issue on Bitbucket or contact the developers.
1514

ct_doc/doc/installation.dox

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,37 @@
1010

1111

1212
\section dep Dependencies and building the library
13-
- install ROS, please follow the steps in <a href="http://wiki.ros.org/Installation/Ubuntu"> this tutorial</a> for your Linux distribution.
1413
- install <a href="http://eigen.tuxfamily.org/index.php?title=Main_Page">Eigen 3</a> via
1514
\code{.sh}
1615
sudo apt-get update
1716
sudo apt-get install libeigen3-dev
1817
\endcode
19-
- install the <a href="http://catkin-tools.readthedocs.io/en/latest/verbs/catkin_build.html">catkin_tools</a> build system
20-
\code{.sh}
21-
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list'
22-
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
23-
sudo apt-get update
24-
sudo apt-get install python-catkin-tools
25-
\endcode
2618
- install boost
2719
\code{.sh}
2820
sudo apt-get install libboost-all-dev
2921
\endcode
30-
- create a catkin workspace and initialize it
31-
\code{.sh}
32-
mkdir -p ~/catkin_ws/src
33-
cd ~/catkin_ws
34-
catkin init
35-
\endcode
36-
3722
- install the <a href="https://github.com/ethz-asl/kindr">kindr</a> library
3823
\code{.sh}
3924
cd ~/catkin_ws/src
4025
git clone https://github.com/ANYbotics/kindr.git
4126
\endcode
42-
4327
- finally, clone the control toolbox and build your workspace
4428
\code{.sh}
4529
cd ~/catkin_ws/src
4630
git clone https://github.com/ethz-adrl/control-toolbox.git
4731
catkin build -DCMAKE_BUILD_TYPE=Release
4832
\endcode
49-
33+
- VARIANT A, if you are a ROS-user: create a catkin workspace and build the CT using catkin tools
34+
\code{.sh}
35+
mkdir -p ~/catkin_ws/src
36+
cd ~/catkin_ws
37+
catkin init
38+
catkin build -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=true
39+
\endcode
40+
- VARIANT B, if you prefer plain cmake.
41+
\code{.sh}
42+
todo ...
43+
\endcode
5044
- if you would like to run an example, build the library with
5145
\code{.sh}
5246
cd ~/catkin_ws/src
@@ -62,7 +56,7 @@
6256

6357

6458
\section opt_dep Optional Dependencies and Bindings
65-
The following dependencies and bindings are optional but can help to enhance the functionality or performance of the CT
59+
The following dependencies and bindings are optional but can help to enhance the user-experience or performance of the CT
6660

6761
- <a href="http://www.netlib.org/lapack/">lapack</a> (enables Schur method as an alternative to iterative method in ct::optcon::LQR)
6862
\code{.sh} $ sudo apt-get install liblapack-dev \endcode
@@ -81,6 +75,14 @@ The following dependencies and bindings are optional but can help to enhance the
8175
about blasefeo can be found <a href="https://arxiv.org/abs/1704.02457">here</a>.
8276
Both packages were developed by <a href="https://www.syscop.de/people/dr-gianluca-frison">Gianluca Frison</a>, <a href="https://www.syscop.de/">University of Freiburg</a>.
8377

78+
- install the <a href="http://catkin-tools.readthedocs.io/en/latest/verbs/catkin_build.html">catkin_tools</a> build system
79+
\code{.sh}
80+
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list'
81+
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
82+
sudo apt-get update
83+
sudo apt-get install python-catkin-tools
84+
\endcode
85+
8486
- <a href="http://qwt.sourceforge.net/">Qwt</a> (for basic plotting)
8587

8688
- MATLAB (for Matlab logging)

ct_doc/doc/mainpage.dox

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66

77
\section ct1 Control Toolbox
88

9-
The Control Toolbox ('CT'), an open-source C++ library for efficient modelling, control,
10-
estimation, trajectory optimization and model predictive control.
11-
The CT is applicable to a broad class of dynamic systems, but features additional modelling tools specially designed for robotics.
9+
The Control Toolbox ('CT'), is a C++ library for modelling, control, estimation, trajectory optimization and model predictive control.
10+
The CT is applicable to a broad class of dynamic systems, but features additional tools specially designed for robotics.
1211
This page outlines its general concept, its major building blocks and highlights selected application examples.
1312

14-
The library contains several tools to design and evaluate controllers, model dynamical systems and solve optimal control problems.
13+
The library contains several tools to design and evaluate controllers, model dynamical systems and numerically solve optimal control problems.
1514
The CT was designed with the following features in mind:
1615

1716
- **Systems and dynamics**:
@@ -35,7 +34,7 @@ The CT was designed with the following features in mind:
3534
- solve large scale optimal control problems in MPC fashion.
3635

3736
- **Robot Modelling, Rigid Body Kinematics and Dynamics**:
38-
- straight-forward interface to a state-of the art rigid body dynamics modelling tool.
37+
- straight-forward interface to a state-of the art rigid body dynamics modelling tool.
3938
- implementation of a basic nonlinear-programming-based inverse kinematics solver.
4039

4140
- **Automatic Differentiation**:
@@ -171,7 +170,6 @@ The four different main modules are detailed in the following.
171170
- Derivatives/Jacobians of general functions using **Numerical Differentiation** (ct::core::DerivativesNumDiff)
172171
or **Automatic-Differentiation** with code-generation (ct::core::DerivativesCppadCG) and just-in-time (JIT)
173172
compilation (ct::core::DerivativesCppadJIT)
174-
- <a href="../../../ct_core/doc/html/index.html">quick link to ct_core</a>
175173

176174

177175
\subsection ct_optcon_overview CT Optimal Control
@@ -187,10 +185,9 @@ The four different main modules are detailed in the following.
187185
- Non-Linear **Model Predictive Control** (ct::optcon::MPC)
188186
- Definitions for Nonlinear Programming Problems (**NLPs**, ct::optcon::Nlp) and interfaces to third-party **NLP Solvers**
189187
(ct::optcon::SnoptSolver and ct::optcon::IpoptSolver)
190-
- <a href="../../../ct_optcon/doc/html/index.html">quick link to ct_optcon</a>
191188

192189

193-
\subsection ct_rbd_overview CT Rigid Body Dynamics
190+
\subsection ct_rbd_overview CT Rigid Body Dynamics (Robot)
194191

195192
- Standard models for Rigid Body Dynamics
196193
- Definitions for the state of a Rigid Body System expressed as general coordinates (ct::rbd::RBDState)
@@ -201,15 +198,13 @@ The four different main modules are detailed in the following.
201198
- **Actuator dynamics** (ct::rbd::ActuatorDynamics)
202199
- Backend uses <a href="https://bitbucket.org/mfrigerio17/roboticscodegenerator/" target="_blank">RobCoGen</a> \cite frigerioCodeGen,
203200
a highly efficient Rigid Body Dynamics library
204-
- <a href="../../../ct_rbd/doc/html/index.html">quick link to ct_rbd</a>
205201

206202

207203
\subsection ct_models_overview CT Models:
208204

209205
- Various standard models for testing and evaluation including UAVs (ct::models::Quadrotor), ground robots,
210206
legged robots (ct::models::HyQ), robot arms (ct::models::HyA), inverted pendulums etc.
211207
- Means of creating linear approximation of these models
212-
- <a href="../../../ct_models/doc/html/index.html">quick link to ct_models</a>
213208

214209

215210

0 commit comments

Comments
 (0)