Skip to content

Commit f925e9b

Browse files
authored
Merge pull request #64 from ethz-adrl/feature/devel
applying a few cosmetic corrections
2 parents d4e0d4e + 59e9246 commit f925e9b

Some content is hidden

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

48 files changed

+313
-227
lines changed

.clang-format

+1-5
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ BreakBeforeBinaryOperators: None
3535
BreakBeforeBraces: Custom
3636
BreakBeforeTernaryOperators: false
3737
BreakConstructorInitializersBeforeComma: false
38-
BreakAfterJavaFieldAnnotations: false
39-
BreakStringLiterals: true
38+
#BreakStringLiterals: true
4039
ColumnLimit: 120
4140
CommentPragmas: '^ IWYU pragma:'
4241
ConstructorInitializerAllOnOneLineOrOnePerLine: true
@@ -54,12 +53,9 @@ IncludeCategories:
5453
Priority: 2
5554
- Regex: '.*'
5655
Priority: 3
57-
IncludeIsMainRegex: '([-_](test|unittest))?$'
5856
IndentCaseLabels: true
5957
IndentWidth: 4
6058
IndentWrappedFunctionNames: false
61-
JavaScriptQuotes: Leave
62-
JavaScriptWrapImports: true
6359
KeepEmptyLinesAtTheStartOfBlocks: false
6460
MacroBlockBegin: ''
6561
MacroBlockEnd: ''

README.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,16 @@ The CT was designed with the following features in mind:
5656

5757
The Control Toolbox has been used for Hardware and Simulation control tasks on flying, walking and ground robots.
5858

59-
[![ct example](https://img.youtube.com/vi/Y7-1CBqs4x4/0.jpg)](https://www.youtube.com/embed/Y7-1CBqs4x4)
60-
[![ct_example](https://img.youtube.com/vi/vuCSKtP67E4/0.jpg)](https://www.youtube.com/embed/vuCSKtP67E4)
61-
[![ct_example](https://img.youtube.com/vi/rWmw-ERGyz4/0.jpg)](https://www.youtube.com/embed/rWmw-ERGyz4)
62-
[![ct_example](https://img.youtube.com/vi/rVu1L_tPCoM/0.jpg)](https://www.youtube.com/embed/rVu1L_tPCoM)
59+
<a href="http://www.youtube.com/watch?feature=player_embedded&v=Y7-1CBqs4x4" target="_blank"><img src="http://img.youtube.com/vi/Y7-1CBqs4x4/0.jpg"
60+
alt="Control Toolbox example video" width="360" height="270" border="10" /></a>
61+
<a href="http://www.youtube.com/watch?feature=player_embedded&v=vuCSKtP67E4" target="_blank"><img src="http://img.youtube.com/vi/vuCSKtP67E4/0.jpg"
62+
alt="Control Toolbox example video" width="360" height="270" border="10" /></a>
63+
64+
<a href="http://www.youtube.com/watch?feature=player_embedded&v=rWmw-ERGyz4" target="_blank"><img src="http://img.youtube.com/vi/rWmw-ERGyz4/0.jpg"
65+
alt="Control Toolbox example video" width="360" height="270" border="10" /></a>
66+
<a href="http://www.youtube.com/watch?feature=player_embedded&v=rVu1L_tPCoM" target="_blank"><img src="http://img.youtube.com/vi/rVu1L_tPCoM/0.jpg"
67+
alt="Control Toolbox example video" width="360" height="270" border="10" /></a>
68+
6369

6470

6571
## What is the CT?

ct_core/cmake/FindCppAD.cmake

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11

2+
UNSET(CPPAD_INCLUDE_DIRS CACHE)
3+
UNSET(CPPAD_LIBRARIES CACHE)
4+
5+
26
IF (CPPAD_INCLUDES AND CPPAD_LIBRARIES)
37
SET(CPPAD_FIND_QUIETLY TRUE)
48
ENDIF ()
59

610

711
IF(DEFINED CPPAD_HOME)
8-
12+
913
FIND_PATH(CPPAD_INCLUDE_DIR NAMES cppad/cppad.hpp
1014
PATHS "${CPPAD_HOME}"
1115
NO_DEFAULT_PATH)

ct_core/include/ct/core/common/activations/ActivationBase.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ class ActivationBase
1919
{
2020
public:
2121
//! constructor
22-
ActivationBase() {}
22+
ActivationBase() = default;
2323
//! destructor
24-
virtual ~ActivationBase() {}
24+
virtual ~ActivationBase() = default;
2525
//! load activations from file
2626
virtual void loadConfigFile(const std::string& filename, const std::string& termName, bool verbose = false)
2727
{

ct_core/include/ct/core/core-prespec.h

+4
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@ Licensed under the BSD-2 license (see LICENSE file in main directory)
1111
#include <cstdlib>
1212
#include <functional>
1313

14+
#ifdef CPPADCG
1415
#include <cppad/cg.hpp>
16+
#endif
1517

18+
#ifdef CPPAD
1619
#include <cppad/cppad.hpp>
1720
#include <cppad/example/cppad_eigen.hpp>
1821
#include <cppad/example/eigen_mat_inv.hpp>
1922
#include "internal/autodiff/CppadParallel.h"
23+
#endif
2024

2125
// Include file for convenience
2226
#include <Eigen/Core>

ct_core/include/ct/core/core.h

+4
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ Licensed under the BSD-2 license (see LICENSE file in main directory)
1212
#include <algorithm>
1313
#include <cstdlib>
1414

15+
#ifdef CPPADCG
1516
#include <cppad/cg.hpp>
17+
#endif
1618

19+
#ifdef CPPAD
1720
#include <cppad/cppad.hpp>
1821
#include <cppad/example/cppad_eigen.hpp>
1922
#include <cppad/example/eigen_mat_inv.hpp>
2023
#include "internal/autodiff/CppadParallel.h"
24+
#endif
2125

2226
// Include file for convenience
2327
#include <Eigen/Core>

ct_core/include/ct/core/integration/Integrator.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -285,22 +285,23 @@ class Integrator
285285
{
286286
}
287287

288+
#ifdef CPPADCG
288289
template <typename S = SCALAR>
289290
typename std::enable_if<std::is_same<S, ADCGScalar>::value, void>::type initializeODEIntSteppers(
290291
const IntegrationType& intType)
291292
{
292293
}
293-
294+
#endif
294295

295296
/**
296-
* @brief Initializes the ODEint fixed size steppers. Does not work for
297+
* @brief Initializes the ODEint fixed size steppers for double type. Does not work for
297298
* ad types
298299
*
299300
* @param[in] intType The int type
300301
*
301302
*/
302303
template <typename S = SCALAR>
303-
typename std::enable_if<!std::is_same<S, ADCGScalar>::value, void>::type initializeODEIntSteppers(
304+
typename std::enable_if<std::is_same<S, double>::value, void>::type initializeODEIntSteppers(
304305
const IntegrationType& intType)
305306
{
306307
switch (intType)
@@ -349,6 +350,7 @@ class Integrator
349350
}
350351
}
351352

353+
352354
//! resets the observer
353355
void reset();
354356

ct_core/include/ct/core/internal/traits/TraitSelectorSpecs.h

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,33 @@ Licensed under the BSD-2 license (see LICENSE file in main directory)
55

66
#pragma once
77

8+
#ifdef CPPADCG
89
#include "CppADCodegenTrait.h"
10+
#endif
11+
#ifdef CPPAD
912
#include "CppADDoubleTrait.h"
13+
#endif
1014
#include <ct/core/internal/traits/TraitSelector.h>
1115

1216
namespace ct {
1317
namespace core {
1418
namespace tpl {
1519

20+
#ifdef CPPAD
1621
template <>
1722
struct TraitSelector<CppAD::AD<double>>
1823
{
1924
typedef internal::CppADDoubleTrait Trait;
2025
};
26+
#endif
2127

28+
#ifdef CPPADCG
2229
template <>
2330
struct TraitSelector<CppAD::AD<CppAD::cg::CG<double>>>
2431
{
2532
typedef internal::CppADCodegenTrait Trait;
2633
};
27-
34+
#endif
2835

2936
} // namespace tpl
3037
} // namespace core

ct_core/include/ct/core/types/AutoDiff.h

+10-1
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,24 @@ Licensed under the BSD-2 license (see LICENSE file in main directory)
55

66
#pragma once
77

8+
#ifdef CPPADCG
89
#include <cppad/cg.hpp>
10+
#endif
11+
12+
#ifdef CPPAD
913
#include <cppad/cppad.hpp>
14+
#endif
1015

1116
namespace ct {
1217
namespace core {
1318

19+
#ifdef CPPAD
1420
typedef CppAD::AD<double> ADScalar;
15-
typedef CppAD::cg::CG<double> ADCGValueType;
21+
#endif
1622

23+
#ifdef CPPADCG
24+
typedef CppAD::cg::CG<double> ADCGValueType;
1725
typedef CppAD::AD<ADCGValueType> ADCGScalar; //!< scalar type
26+
#endif
1827
}
1928
}

0 commit comments

Comments
 (0)