Skip to content

Commit

Permalink
Merge pull request #3 from ethz-adrl/feature/elementaryCleanup
Browse files Browse the repository at this point in the history
Feature/elementary cleanup
  • Loading branch information
markusgft authored Apr 27, 2019
2 parents b48930e + 8b86b18 commit 036629c
Show file tree
Hide file tree
Showing 18 changed files with 89 additions and 96 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ solution.mat
*.tmp
*.mat
.settings/
*.aux
*.doc*
10 changes: 5 additions & 5 deletions ct/cmake/clang-cxx-dev-tools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ find_program(CLANG_FORMAT_BIN "clang-format")
if(NOT CLANG_FORMAT_BIN)
find_program(CLANG_FORMAT_BIN "clang-format-3.9")
endif()
message(WARNING "CLANG FORMAT IS: " ${CLANG_FORMAT_BIN})
message(STATUS "CLANG FORMAT IS: " ${CLANG_FORMAT_BIN})
if(NOT CLANG_FORMAT_BIN)
message (WARNING "CLANG-FORMAT not found. You can ignore this message if you are not a CT developer.")
message (STATUS "CLANG-FORMAT not found. You can ignore this message if you are not a CT developer.")
add_custom_target(clang-format
COMMAND ${CMAKE_COMMAND} -E echo_append "clang-format executable not found"
VERBATIM)
else()
message (WARNING "FOUND CLANG-FORMAT")
message (STATUS "FOUND CLANG-FORMAT")
add_custom_target(
clang-format
COMMAND ${CLANG_FORMAT_BIN}
Expand Down Expand Up @@ -94,13 +94,13 @@ function(ct_configure_clang_tidy TIDY_INC_DIRS)
if(NOT CLANG_TIDY_BIN)
find_program(CLANG_TIDY_BIN "clang_tidy")
endif()
message(${CLANG_TIDY_BIN})
message(STATUS ${CLANG_TIDY_BIN})
if(NOT CLANG_TIDY_BIN)
add_custom_target(clang-tidy
COMMAND ${CMAKE_COMMAND} -E echo_append "clang-tidy executable not found"
VERBATIM)
else()
message (WARNING "FOUND CLANG-TIDY")
message (STATUS "FOUND CLANG-TIDY")
set(CLANG_TIDY_COMMAND COMMAND ${CLANG_TIDY_BIN} ${ALL_CXX_SOURCE_FILES} -config='' -header-filter=\".*\\/ct\\/.*\" -- -std=c++11 -fopenmp ${CURRENT_INC_DIRS})

add_custom_target(
Expand Down
14 changes: 1 addition & 13 deletions ct/cmake/compilerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ option(BUILD_EXAMPLES "Compile all examples for ct" false)
option(BUILD_HYQ_FULL "Compile all examples for HyQ (takes long, should use clang)" false)
option(BUILD_HYQ_LINEARIZATION_TIMINGS "Build linearization timing tests for HyQ (takes long, should use clang)" false)
option(BUILD_HYA_LINEARIZATION_TIMINGS "Build linearization timing tests for HyA (takes long, should use clang)" false)
option(USE_LAPACKE "Use lapacke bindings for Eigen" false)
option(USE_BLAS "Use blas bindings for Eigen" false)
option(HPIPM "Build HPIPM Optimal Control solver" false)

## option to activate/deactivate explicit template prespecs
Expand All @@ -32,14 +30,4 @@ if(USE_INTEL)
SET (CMAKE_C_COMPILER ${INTEL_C_COMPILER})
SET (CMAKE_CXX_COMPILER ${INTEL_CXX_COMPILER})
set(CMAKE_CXX_LINKER_FLAGS "${CMAKE_CXX_LINKER_FLAGS} -L${MKLROOT}/lib/intel64 -llibblas -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -llapacke -lblas -llapack -lliblapack -liblapacke")
endif(USE_INTEL)


if(USE_LAPACKE)
add_definitions(-DEIGEN_USE_LAPACKE)
set(CMAKE_CXX_LINKER_FLAGS "${CMAKE_CXX_LINKER_FLAGS} -llapacke -lblas ")
endif()

if(USE_BLAS)
add_definitions(-DEIGEN_USE_BLAS)
endif()
endif(USE_INTEL)
18 changes: 7 additions & 11 deletions ct_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,9 @@ endif()
include_directories(
${BOOST_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
)

include_directories (
include
include/external
${EIGEN3_INCLUDE_DIR}
${EIGEN3_INCLUDE_DIR}
include
include/external
)

## dummy prespec libs
Expand All @@ -72,14 +69,13 @@ catkin_package(
examples
${EIGEN3_INCLUDE_DIR}
LIBRARIES
dl
ct_core
${PRESPEC_LIB_NAMES}
ct_core
dl #required for gcc-compatibility
${PRESPEC_LIB_NAMES}
DEPENDS
EIGEN3
EIGEN3
)


set(CODEGEN_TEMPLATE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/templates")
set(CODEGEN_OUTPUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/generated")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/ct/core/templateDir.h.in ${CMAKE_CURRENT_SOURCE_DIR}/include/ct/core/templateDir.h)
Expand Down
3 changes: 1 addition & 2 deletions ct_core/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
<name>ct_core</name>
<version>0.3.0</version>
<description>
ADRL control toolbox - core module
Control toolbox - core module.
</description>
<maintainer email="[email protected]">Markus Giftthaler</maintainer>
<maintainer email="[email protected]">Michael Neunert</maintainer>
<license>BSD-2</license>
<buildtool_depend>catkin</buildtool_depend>

</package>
2 changes: 1 addition & 1 deletion ct_doc/doc/ct_doc.doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = ct
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = v2.3
PROJECT_NUMBER = v3.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
7 changes: 0 additions & 7 deletions ct_doc/doc/developer_info.dox
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ to align the development with ongoing activities.
\section Code Formatting
We support clang-format and provide a style template to automatically format the source code.
Please refer to the clang-format style sheet in the package root directory for our conventions.
Or simply rely on clang-format to do the formatting for you.

Note for developers using the *Eclipse IDE*: you can conveniently integrate clang-format (and our .clang-format
configuration file) in your project using the "CppStyle" plugin (see http://www.cppstyle.com/ for
detailed information). To automatically format the code according to ct-style, just mark the source-code
and press *Ctrl+Shift+f*.


Example command for running clang-tidy:
\code
Expand Down
86 changes: 55 additions & 31 deletions ct_doc/doc/installation.dox
Original file line number Diff line number Diff line change
@@ -1,43 +1,78 @@
/*!

\page install_guide Installation
- \subpage requirements
- \subpage install


\page requirements Requirements
@tableofcontents
This library is written in C++11. It is tested under Ubuntu 14.04 and 16.04 with
library versions as provided in the package sources.

\section req Requirements:

- Ubuntu 16.04 or 18.04
- a compiler with C++14 support, e.g. gcc or clang

\section dep Dependencies

- C++ compiler with C++11 support (we recommend gcc-5.4.1 or greater or clang-3.5 or greater)
- <a href="http://eigen.tuxfamily.org/index.php?title=Main_Page">Eigen 3</a>
- <a href="http://wiki.ros.org/catkin">catkin</a> (build system, easy to switch to CMakeLists.txt where needed). We recommend using <a href="http://catkin-tools.readthedocs.io/en/latest/verbs/catkin_build.html">catkin_tools</a>
- boost 1.54 or greater (soon optional)
- <a href="https://github.com/ethz-asl/kindr">kindr</a>, a kinematics library for robotics,
which is required for building ct_rbd. Ideally, clone the newest version into your
catkin workspace:
\section dep Dependencies and building the library
- install ROS, please follow the steps in <a href="http://wiki.ros.org/Installation/Ubuntu"> this tutorial</a> for your Linux distribution.
- install <a href="http://eigen.tuxfamily.org/index.php?title=Main_Page">Eigen 3</a> via
\code{.sh}
sudo apt-get update
sudo apt-get install libeigen3-dev
\endcode
- install the <a href="http://catkin-tools.readthedocs.io/en/latest/verbs/catkin_build.html">catkin_tools</a> build system
\code{.sh}
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list'
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install python-catkin-tools
\endcode
- install boost
\code{.sh}
$ git clone https://github.com/ethz-asl/kindr.git
sudo apt-get install libboost-all-dev
\endcode
- create a catkin workspace and initialize it
\code{.sh}
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws
catkin init
\endcode

- install the <a href="https://github.com/ethz-asl/kindr">kindr</a> library
\code{.sh}
cd ~/catkin_ws/src
git clone https://github.com/ANYbotics/kindr.git
\endcode

- finally, clone the control toolbox and build your workspace
\code{.sh}
cd ~/catkin_ws/src
git clone https://github.com/ethz-adrl/control-toolbox.git
catkin build -DCMAKE_BUILD_TYPE=Release
\endcode

- if you would like to run an example, build the library with
\code{.sh}
cd ~/catkin_ws/src
catkin build -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=true
\endcode
Now, try to run the examples, e.g. the optimal control and optimal filtering examples:
\code{.sh}
cd ~/catkin_ws/src
catkin build -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=true
rosrun ct_optcon ex_NLOC
rosrun ct_optcon ex_KalmanFiltering
\endcode


\section opt_dep Optional Dependencies and Bindings
The following dependencies and bindings are optional but can help to enhance the functionality or performance of the CT

- <a href="http://www.netlib.org/lapack/">lapack</a> (enables Schur method as an alternative to iterative method in ct::optcon::LQR)
\code{.sh} $ sudo apt-get install liblapack-dev \endcode

- <a href="https://clang.llvm.org/">clang</a> compiler (faster compilation for large linear models), install from command-line via
\code{.sh} $ sudo apt-get install clang \endcode
and possibly replace `clang` with a more specific version, e.g. `clang-3.8`.
Please make sure that the `clang` and `clang++` commands are in your path.
You may need to create a symbolic link in `/usr/bin` or use a bash alias.

- <a href="http://wiki.ros.org/indigo">ROS Indigo</a> or <a href="http://wiki.ros.org/kinetic">Kinetic</a> (for ROS bindings, visualization and extended examples), see <a href="../../../../ct_ros/ct_ros_nodes/doc/html/index.html">ct_ros_nodes</a>, <a href="../../../../ct_ros/ct_ros_nodes/doc/html/index.html">ct_ros_msgs</a>

- <a href="https://projects.coin-or.org/Ipopt">IPOPT</a> or <a href="http://www.sbsi-sol-optimize.com/asp/sol_product_snopt.htm">SNOPT</a>
(for ct::optcon::SnoptSolver and ct::optcon::IpoptSolver as used by ct::optcon::DMS)

Expand All @@ -61,19 +96,8 @@ The following dependencies and bindings are optional but can help to enhance the
\endcode


\page install Compile
@tableofcontents

\section build_lib Build the library

In order to build the library, execute the following commands in your terminal
\code{.sh}
cd catkin_ws/src
git clone https://github.com/ethz-asl/kindr.git
git clone https://bitbucket.org/adrlab/ct.git
catkin build -DCMAKE_BUILD_TYPE=RELEASE
\endcode

\section Additional build arguments
The following additional build flags are available, which can be appended to the build command above

Build Flag | Default value | Description
Expand All @@ -95,7 +119,7 @@ To build the documentation do
\code{.sh}
catkin build ct_doc -v --make-args doc # build the doc
\endcode
This will build the documentation and open it in your browser.
This will build the documentation. The index.html can be found in ct_doc.


\section run_tests Run Unit Tests
Expand Down
20 changes: 7 additions & 13 deletions ct_doc/doc/mainpage.dox
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

\section ct1 Control Toolbox

This is the ADRL Control Toolbox ('CT'), an open-source C++ library for efficient modelling, control,
The Control Toolbox ('CT'), an open-source C++ library for efficient modelling, control,
estimation, trajectory optimization and model predictive control.
The CT is applicable to a broad class of dynamic systems, but features additional modelling tools specially designed for robotics.
This page outlines its general concept, its major building blocks and highlights selected application examples.
Expand Down Expand Up @@ -47,7 +47,7 @@ The CT was designed with the following features in mind:
- all algorithm flavors and solver backends are available through simple configuration files.


The CT is hosted on bitbucket: <a href="https://bitbucket.org/adrlab/ct" target="_blank">https://bitbucket.org/adrlab/ct</a>
The CT is hosted on github: <a href="https://github.com/ethz-adrl/control-toolbox" target="_blank">https://github.com/ethz-adrl/control-toolbox</a>



Expand Down Expand Up @@ -212,11 +212,6 @@ The four different main modules are detailed in the following.
- <a href="../../../ct_models/doc/html/index.html">quick link to ct_models</a>


\section source_code Source Code

The source code is available at <a href="https://bitbucket.org/adrlab/ct" target="_blank">https://bitbucket.org/adrlab/ct</a>

Examples for interfacing with ROS and advanced application examples are available at <a href="https://bitbucket.org/adrlab/ct_ros/src/master/" target="_blank">ct_ros</a>.

\section gs How to use the Control Toolbox

Expand All @@ -226,15 +221,15 @@ To get started with the control toolbox, please see \ref getting_started "Gettin
\section contact Support

For any questions, issues or other troubleshooting please either
- create an issue: https://bitbucket.org/adrlab/ct/issues
- create an issue: https://github.com/ethz-adrl/control-toolbox/issues
- contact the devs: [email protected]


\section ct_doc_acknowledgement Acknowledgements

\subsection contribs Contributors
- Michael Neunert
- Markus Giftthaler
- Michael Neunert
- Markus Stäuble
- Farbod Farshidian
- Diego Pardo
Expand All @@ -243,12 +238,11 @@ For any questions, issues or other troubleshooting please either
- Ruben Grandia
- Hamza Merzic

\subsection lead_overview Project Lead and Maintenance
- Michael Neunert, neunertm (at) gmail (dot) com
\subsection lead_overview Maintenance
- Markus Giftthaler, markusgft (at) gmail (dot) com

\subsection funding Funding
This software has been developed at the <a href="http://www.adrl.ethz.ch" target="_blank">Agile & Dexterous Robotics Lab</a>
\subsection funding Funding 2014-2018
The core of this software has been developed at the <a href="http://www.adrl.ethz.ch" target="_blank">Agile & Dexterous Robotics Lab</a>
at <a href="http://www.ethz.ch/en" target="_blank">ETH Zurich</a>, Switzerland between 2014 and 2018.
During that time, development has been made possible through financial support from the <a href="http://www.snf.ch/en/" target="_blank">Swiss National Science Foundation (SNF)</a>
through a SNF Professorship award to Jonas Buchli and the National Competence Centers in Research (NCCR)
Expand Down
Empty file removed ct_doc/doc/tags/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion ct_models/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ endif(USE_PRESPEC)

################ HyQ #################
add_executable(HyQLinearizationCodgen src/HyQ/codegen/HyQLinearizationCodgen.cpp)
target_link_libraries(HyQLinearizationCodgen ${catkin_LIBRARIES} )
target_link_libraries(HyQLinearizationCodgen ${catkin_LIBRARIES})

if (BUILD_HYQ_FULL)
if (NOT USE_CLANG)
Expand Down
2 changes: 1 addition & 1 deletion ct_models/doc/ct_models.doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = ct_models
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = v2.3
PROJECT_NUMBER = v3.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
3 changes: 0 additions & 3 deletions ct_models/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@

<buildtool_depend>catkin</buildtool_depend>

<depend>roscpp</depend>
<depend>std_msgs</depend>
<depend>ct_core</depend>
<depend>ct_rbd</depend>

</package>
2 changes: 1 addition & 1 deletion ct_optcon/doc/ct_optcon.doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = ct_optcon
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = v2.3
PROJECT_NUMBER = v3.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
7 changes: 5 additions & 2 deletions ct_optcon/package.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
<package format="2">
<name>ct_optcon</name>

<version>0.3.0</version>

<description>Optimal Control package of the ADRL Control Toolbox</description>

<license>BSD-2</license>

<maintainer email="[email protected]">Markus Giftthaler</maintainer>
<maintainer email="[email protected]">Michael Neunert</maintainer>
<license>BSD-2</license>

<author>Markus Giftthaler</author>
<author>Michael Neunert</author>

<buildtool_depend>catkin</buildtool_depend>

<depend>roscpp</depend>
<depend>ct_core</depend>
<depend>cmake_modules</depend>

Expand Down
Loading

0 comments on commit 036629c

Please sign in to comment.