Skip to content

Commit af3ea07

Browse files
authored
Merge pull request #57 from ethz-adrl/devel
prepare release 3.0.2
2 parents f5f8cf9 + afaaae6 commit af3ea07

File tree

708 files changed

+3729
-163156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

708 files changed

+3729
-163156
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ CMakeCache.txt
33
*.cmake
44
!clang-cxx-dev-tools.cmake
55
!compilerSettings.cmake
6+
!ct-cmake-helpers.cmake
67
!FindIPOPT.cmake
78
!Findblasfeo.cmake
89
!Findhpipm.cmake
10+
!FindCppAD.cmake
11+
!FindCppADCG.cmake
12+
!Findllvm.cmake
13+
!Findclang.cmake
914
!ct_core/cmake/ct_coreConfig.cmake
1015
!ct_optcon/cmake/ct_optconConfig.cmake
1116
!ct_rbd/cmake/ct_rbdConfig.cmake

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ cache:
55
language: generic
66
matrix:
77
include:
8-
- name: "Xenial kinetic"
9-
dist: xenial
10-
env: ROS_DISTRO=kinetic
8+
- name: "Bionic melodic"
9+
dist: bionic
10+
env: ROS_DISTRO=melodic
1111

1212
env:
1313
global:
@@ -82,7 +82,7 @@ script:
8282
- cd ~/catkin_ws
8383
- catkin clean --all
8484
- catkin config --blacklist ct_doc
85-
- catkin build -DBUILD_TESTS=true -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-w"
85+
- catkin build -DUSE_CLANG=true -DBUILD_TESTS=true -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-w"
8686
# Run the tests, ensuring the path is set correctly.
8787
# we do not want to run the kindr tests
8888
- catkin config --blacklist kindr

NOTICE.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,11 @@ Copyright 2014-2018 ETH Zurich
77
This software has been developed at the Agile & Dexterous Robotics Lab
88
at ETH Zurich under the lead of Michael Neunert and Markus Giftthaler.
99

10-
Software included in any folder named "external" and any subsequent
11-
subfolders is software developed by third parties and not by the
12-
authors above. Thererfore, neither the developers nor the institution
13-
listed above holds copyright for this external software. Furthermore,
14-
external software might be distributed under different licences
15-
agreements included in the subfolders.
1610

1711
Authors:
1812

19-
Michael Neunert,
2013
Markus Giftthaler,
14+
Michael Neunert,
2115
Markus Stäuble,
2216
Diego Pardo,
2317
Farbod Farshidian,

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Control Toolbox
2-
![Travis (.org) branch](https://img.shields.io/travis/ethz-adrl/control-toolbox/3.0.1.svg?style=popout-square)
2+
![Travis (.org) branch](https://img.shields.io/travis/ethz-adrl/control-toolbox/3.0.2.svg?style=popout-square)
33
![GitHub top language](https://img.shields.io/github/languages/top/ethz-adrl/control-toolbox.svg?style=social)
44
![GitHub](https://img.shields.io/github/license/ethz-adrl/control-toolbox.svg?style=social)
55

ct/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.3)
2-
project(ct VERSION 3.0.1 LANGUAGES CXX)
2+
project(ct VERSION 3.0.2 LANGUAGES CXX)
33

44
#Make sure metapackage does not fail when building documentation
55
add_custom_target(doc

ct/cmake/ct-cmake-helpers.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
# import interface compile definitions from ext_target as cmake option
3+
function(importInterfaceCompileDefinitionsAsOptions ext_target)
4+
5+
get_property(_if_compile_defs TARGET ${ext_target} PROPERTY INTERFACE_COMPILE_DEFINITIONS)
6+
7+
foreach( i ${_if_compile_defs} )
8+
set(${i} ON PARENT_SCOPE) # mark all interface compile definitions as options
9+
message(STATUS "Importing compile definition " ${i} " as option.")
10+
endforeach()
11+
12+
endfunction()

ct/install_cppadcg.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
## get llvm
4+
yes Y | sudo apt-get install llvm
5+
6+
## get clang
7+
# todo
8+
9+
## install CppAD
10+
mkdir /tmp/cppadcg_deps
11+
cd /tmp/cppadcg_deps
12+
wget https://github.com/coin-or/CppAD/archive/20190200.4.tar.gz
13+
tar -xzf 20190200.4.tar.gz
14+
cd CppAD-20190200.4
15+
mkdir build
16+
cd build
17+
cmake -Dcppad_prefix:PATH='/usr/local' ..
18+
sudo make install
19+
20+
21+
## install CppADCodeGen
22+
git clone https://github.com/joaoleal/CppADCodeGen.git /tmp/CppADCodeGen
23+
cd /tmp/CppADCodeGen
24+
mkdir -p build
25+
cd build
26+
cmake .. #-DLLVM_VERSION=6.0
27+
make
28+
sudo make install

ct/install_deps.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,25 @@
33
sudo apt-get update
44

55
## get lapack
6-
sudo apt-get install liblapack-dev
6+
yes Y | sudo apt-get install liblapack-dev
77

88
## get eigen3
9-
sudo apt-get install libeigen3-dev
9+
yes Y | sudo apt-get install libeigen3-dev
1010

1111
## get cmake
12-
sudo apt-get install cmake
12+
yes Y | sudo apt-get install cmake
1313

1414
## get IPOPT
15-
sudo apt-get install coinor-libipopt-dev
15+
yes Y | sudo apt-get install coinor-libipopt-dev
1616

1717
## get boost
18-
sudo apt-get install libboost-all-dev
18+
yes Y | sudo apt-get install libboost-all-dev
19+
20+
## get open mp
21+
yes Y | sudo apt install libomp-dev
22+
23+
## get clang
24+
yes Y | sudo apt install clang
25+
26+
## get CppAD and CppADCodeGen
27+
sudo ./install_cppadcg.sh

ct/install_hpipm.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
## get blasfeo 0.1.1
4+
echo "now installing blasfeo 0.1.1 ..."
5+
cd /tmp
6+
git clone https://github.com/giaf/blasfeo.git
7+
cd /tmp/blasfeo
8+
git checkout 0.1.1 # we currently are on this release
9+
make static_library
10+
sudo make install_static
11+
12+
## get hpipm 0.1.1
13+
echo "now installing hpipm 0.1.1 ..."
14+
cd /tmp
15+
git clone https://github.com/giaf/hpipm.git
16+
cd /tmp/hpipm
17+
git checkout 806c845
18+
make static_library
19+
make examples
20+
sudo make install_static

ct/package.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<package>
22
<name>ct</name>
3-
<version>3.0.1</version>
3+
<version>3.0.2</version>
44
<description>
5-
ADRL Control Toolbox 3.0.1
5+
ADRL Control Toolbox 3.0.2
66
</description>
77
<maintainer email="markusgft@gmail.com">Markus Giftthaler</maintainer>
88
<license>BSD-2</license>

ct_core/CMakeLists.txt

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/../ct/cmake/explicitTemplateHelpers.cmake)
55
include(${CMAKE_CURRENT_SOURCE_DIR}/../ct/cmake/clang-cxx-dev-tools.cmake)
66

77

8-
project(ct_core VERSION 3.0.1 LANGUAGES CXX)
8+
project(ct_core VERSION 3.0.2 LANGUAGES CXX)
99

1010

1111
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
@@ -14,13 +14,44 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread -std=c++14 -Wall
1414
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
1515

1616

17+
set(ct_core_LIBS "")
18+
1719
## find and include required dependencies
1820
find_package(Eigen3 REQUIRED)
1921
find_package(Boost COMPONENTS REQUIRED)
2022

21-
set(ct_core_LIBS "")
22-
2323
## find and include optional dependencies
24+
find_package(llvm QUIET)
25+
find_package(clang QUIET)
26+
if(LLVM_FOUND AND CLANG_FOUND)
27+
message(STATUS "Found LLVM/CLANG version " ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR})
28+
set (LLVM ON)
29+
list(APPEND ct_core_COMPILE_DEFINITIONS LLVM_VERSION_MAJOR=${LLVM_VERSION_MAJOR})
30+
list(APPEND ct_core_COMPILE_DEFINITIONS LLVM_VERSION_MINOR=${LLVM_VERSION_MINOR})
31+
list(APPEND ct_core_LIBS ${CLANG_LIBS})
32+
list(APPEND ct_core_LIBS ${LLVM_MODULE_LIBS})
33+
list(APPEND ct_core_target_include_dirs ${LLVM_INCLUDE_DIRS})
34+
list(APPEND ct_core_target_include_dirs ${CLANG_INCLUDE_DIRS})
35+
else()
36+
message(STATUS "Could not find LLVM/CLANG, LLVM-JIT will not be available")
37+
endif()
38+
find_package(CppAD QUIET)
39+
if(CPPAD_FOUND)
40+
set(CPPAD ON)
41+
list(APPEND ct_core_COMPILE_DEFINITIONS CPPAD)
42+
list(APPEND ct_core_target_include_dirs ${CPPAD_INCLUDE_DIRS})
43+
else()
44+
message(STATUS "Could not find CppAD, auto-diff will not be available")
45+
endif()
46+
find_package(CppADCG QUIET)
47+
if(CPPADCG_FOUND)
48+
set(CPPADCG ON)
49+
list(APPEND ct_core_COMPILE_DEFINITIONS CPPADCG)
50+
list(APPEND ct_core_target_include_dirs ${CPPADCG_INCLUDE_DIRS})
51+
else()
52+
message(STATUS "Could not find CppADCodeGen, derivative code generation will not be available")
53+
endif()
54+
2455
find_package(Qwt QUIET)
2556
find_package(Qt4 QUIET)
2657
if(QWT_FOUND AND Qt4_FOUND)
@@ -32,15 +63,14 @@ else()
3263
message(STATUS "COMPILING WITHOUT QWT")
3364
endif()
3465

35-
## find and include optional dependencies
3666
find_package(PythonLibs 2.7 QUIET)
3767
if (PYTHONLIBS_FOUND)
38-
message(STATUS "Python found")
39-
list(APPEND ct_plot_COMPILE_DEFINITIONS PLOTTING_ENABLED)
68+
message(STATUS "Found python 2.7")
69+
list(APPEND ct_core_COMPILE_DEFINITIONS PLOTTING_ENABLED)
4070
message(STATUS "Python library path ... " ${PYTHON_LIBRARY})
4171
list(APPEND ct_core_LIBS ${PYTHON_LIBRARY})
4272
else()
43-
message(STATUS "Python not found")
73+
message(STATUS "Python not found, plotting will not be available")
4474
endif()
4575

4676

@@ -55,16 +85,12 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/ct/core/templateDir.h.in ${CM
5585
###################
5686

5787
## define the directories to be included in all ct_core targets
58-
set(ct_core_target_include_dirs
59-
${EIGEN3_INCLUDE_DIR}
60-
${PYTHON_INCLUDE_DIRS}
61-
${QWT_INCLUDE_DIR}
62-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
63-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/ct/external>
64-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/examples/include>
65-
$<INSTALL_INTERFACE:include>
66-
$<INSTALL_INTERFACE:include/ct/external>
67-
)
88+
list(APPEND ct_core_target_include_dirs ${EIGEN3_INCLUDE_DIR})
89+
list(APPEND ct_core_target_include_dirs ${PYTHON_INCLUDE_DIRS})
90+
list(APPEND ct_core_target_include_dirs ${QWT_INCLUDE_DIR})
91+
list(APPEND ct_core_target_include_dirs $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
92+
list(APPEND ct_core_target_include_dirs $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/examples/include>)
93+
list(APPEND ct_core_target_include_dirs $<INSTALL_INTERFACE:include>)
6894

6995
## declare prespec libraries
7096
set(PRESPEC_LIB_NAMES "")
@@ -88,11 +114,12 @@ endif()
88114
## create ct_core libraries
89115
add_library(ct_plot SHARED src/core/plot/plot.cpp)
90116
target_include_directories(ct_plot PUBLIC ${ct_core_target_include_dirs})
91-
target_compile_definitions(ct_plot PUBLIC ${ct_plot_COMPILE_DEFINITIONS})
117+
target_compile_definitions(ct_plot PUBLIC ${ct_core_COMPILE_DEFINITIONS})
92118
target_link_libraries(ct_plot ${ct_core_LIBS})
93119

94120
add_library(ct_core INTERFACE)
95121
target_include_directories(ct_core INTERFACE ${ct_core_target_include_dirs})
122+
target_compile_definitions(ct_core INTERFACE ${ct_core_COMPILE_DEFINITIONS})
96123
target_link_libraries(ct_core INTERFACE
97124
${ct_core_LIBS}
98125
${PRESPEC_LIB_NAMES}
@@ -135,7 +162,6 @@ include(GNUInstallDirs)
135162

136163
## copy the header files
137164
install(DIRECTORY include/ct/core DESTINATION include/ct)
138-
install(DIRECTORY include/ct/external DESTINATION include/ct)
139165
install(DIRECTORY examples/include/ct/core DESTINATION include/ct)
140166

141167
## copy the cmake files required for find_package()

ct_core/cmake/FindCppAD.cmake

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
2+
IF (CPPAD_INCLUDES AND CPPAD_LIBRARIES)
3+
SET(CPPAD_FIND_QUIETLY TRUE)
4+
ENDIF ()
5+
6+
7+
IF(DEFINED CPPAD_HOME)
8+
9+
FIND_PATH(CPPAD_INCLUDE_DIR NAMES cppad/cppad.hpp
10+
PATHS "${CPPAD_HOME}"
11+
NO_DEFAULT_PATH)
12+
13+
FIND_LIBRARY(CPPAD_IPOPT_LIBRARY
14+
cppad_ipopt
15+
PATHS "${CPPAD_HOME}/lib"
16+
NO_DEFAULT_PATH)
17+
18+
SET(CPPAD_INCLUDE_DIRS ${CPPAD_INCLUDE_DIR})
19+
SET(CPPAD_LIBRARIES ${CPPAD_IPOPT_LIBRARY})
20+
21+
ELSE()
22+
23+
FIND_PACKAGE(PkgConfig)
24+
25+
IF( PKG_CONFIG_FOUND )
26+
pkg_check_modules( CPPAD QUIET cppad)
27+
ENDIF()
28+
29+
30+
IF( NOT CPPAD_FOUND )
31+
FIND_PATH(CPPAD_INCLUDE_DIR NAMES cppad/cppad.hpp
32+
HINTS "$ENV{CPPAD_HOME}"
33+
"/usr/include" )
34+
35+
FIND_LIBRARY(CPPAD_IPOPT_LIBRARY
36+
cppad_ipopt
37+
HINTS "$ENV{CPPAD_HOME}/lib"
38+
"/usr/lib" )
39+
40+
IF( CPPAD_INCLUDE_DIR )
41+
SET(CPPAD_INCLUDE_DIRS ${CPPAD_INCLUDE_DIR})
42+
ENDIF()
43+
44+
IF( CPPAD_IPOPT_LIBRARY )
45+
SET(CPPAD_LIBRARIES ${CPPAD_IPOPT_LIBRARY})
46+
ENDIF()
47+
48+
INCLUDE(FindPackageHandleStandardArgs)
49+
# handle the QUIETLY and REQUIRED arguments and set CPPAD_FOUND to TRUE
50+
# if all listed variables are TRUE
51+
find_package_handle_standard_args(CppAD DEFAULT_MSG
52+
CPPAD_INCLUDE_DIRS)
53+
54+
MARK_AS_ADVANCED(CPPAD_INCLUDE_DIRS CPPAD_LIBRARIES)
55+
56+
ENDIF()
57+
ENDIF()
58+
59+
60+
IF( CPPAD_FOUND AND NOT CPPAD_FIND_QUIETLY )
61+
MESSAGE(STATUS "package CppAD found")
62+
ENDIF()
63+

0 commit comments

Comments
 (0)