Skip to content

Commit

Permalink
Merge pull request #64 from ethz-adrl/feature/devel
Browse files Browse the repository at this point in the history
applying a few cosmetic corrections
  • Loading branch information
markusgft committed Dec 28, 2019
2 parents d4e0d4e + 59e9246 commit f925e9b
Show file tree
Hide file tree
Showing 48 changed files with 313 additions and 227 deletions.
6 changes: 1 addition & 5 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
#BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
Expand All @@ -54,12 +53,9 @@ IncludeCategories:
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,16 @@ The CT was designed with the following features in mind:

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

[![ct example](https://img.youtube.com/vi/Y7-1CBqs4x4/0.jpg)](https://www.youtube.com/embed/Y7-1CBqs4x4)
[![ct_example](https://img.youtube.com/vi/vuCSKtP67E4/0.jpg)](https://www.youtube.com/embed/vuCSKtP67E4)
[![ct_example](https://img.youtube.com/vi/rWmw-ERGyz4/0.jpg)](https://www.youtube.com/embed/rWmw-ERGyz4)
[![ct_example](https://img.youtube.com/vi/rVu1L_tPCoM/0.jpg)](https://www.youtube.com/embed/rVu1L_tPCoM)
<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"
alt="Control Toolbox example video" width="360" height="270" border="10" /></a>
<a href="http://www.youtube.com/watch?feature=player_embedded&v=vuCSKtP67E4" target="_blank"><img src="http://img.youtube.com/vi/vuCSKtP67E4/0.jpg"
alt="Control Toolbox example video" width="360" height="270" border="10" /></a>

<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"
alt="Control Toolbox example video" width="360" height="270" border="10" /></a>
<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"
alt="Control Toolbox example video" width="360" height="270" border="10" /></a>



## What is the CT?
Expand Down
6 changes: 5 additions & 1 deletion ct_core/cmake/FindCppAD.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@

UNSET(CPPAD_INCLUDE_DIRS CACHE)
UNSET(CPPAD_LIBRARIES CACHE)


IF (CPPAD_INCLUDES AND CPPAD_LIBRARIES)
SET(CPPAD_FIND_QUIETLY TRUE)
ENDIF ()


IF(DEFINED CPPAD_HOME)

FIND_PATH(CPPAD_INCLUDE_DIR NAMES cppad/cppad.hpp
PATHS "${CPPAD_HOME}"
NO_DEFAULT_PATH)
Expand Down
4 changes: 2 additions & 2 deletions ct_core/include/ct/core/common/activations/ActivationBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class ActivationBase
{
public:
//! constructor
ActivationBase() {}
ActivationBase() = default;
//! destructor
virtual ~ActivationBase() {}
virtual ~ActivationBase() = default;
//! load activations from file
virtual void loadConfigFile(const std::string& filename, const std::string& termName, bool verbose = false)
{
Expand Down
4 changes: 4 additions & 0 deletions ct_core/include/ct/core/core-prespec.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ Licensed under the BSD-2 license (see LICENSE file in main directory)
#include <cstdlib>
#include <functional>

#ifdef CPPADCG
#include <cppad/cg.hpp>
#endif

#ifdef CPPAD
#include <cppad/cppad.hpp>
#include <cppad/example/cppad_eigen.hpp>
#include <cppad/example/eigen_mat_inv.hpp>
#include "internal/autodiff/CppadParallel.h"
#endif

// Include file for convenience
#include <Eigen/Core>
Expand Down
4 changes: 4 additions & 0 deletions ct_core/include/ct/core/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ Licensed under the BSD-2 license (see LICENSE file in main directory)
#include <algorithm>
#include <cstdlib>

#ifdef CPPADCG
#include <cppad/cg.hpp>
#endif

#ifdef CPPAD
#include <cppad/cppad.hpp>
#include <cppad/example/cppad_eigen.hpp>
#include <cppad/example/eigen_mat_inv.hpp>
#include "internal/autodiff/CppadParallel.h"
#endif

// Include file for convenience
#include <Eigen/Core>
Expand Down
8 changes: 5 additions & 3 deletions ct_core/include/ct/core/integration/Integrator.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,22 +285,23 @@ class Integrator
{
}

#ifdef CPPADCG
template <typename S = SCALAR>
typename std::enable_if<std::is_same<S, ADCGScalar>::value, void>::type initializeODEIntSteppers(
const IntegrationType& intType)
{
}

#endif

/**
* @brief Initializes the ODEint fixed size steppers. Does not work for
* @brief Initializes the ODEint fixed size steppers for double type. Does not work for
* ad types
*
* @param[in] intType The int type
*
*/
template <typename S = SCALAR>
typename std::enable_if<!std::is_same<S, ADCGScalar>::value, void>::type initializeODEIntSteppers(
typename std::enable_if<std::is_same<S, double>::value, void>::type initializeODEIntSteppers(
const IntegrationType& intType)
{
switch (intType)
Expand Down Expand Up @@ -349,6 +350,7 @@ class Integrator
}
}


//! resets the observer
void reset();

Expand Down
9 changes: 8 additions & 1 deletion ct_core/include/ct/core/internal/traits/TraitSelectorSpecs.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,33 @@ Licensed under the BSD-2 license (see LICENSE file in main directory)

#pragma once

#ifdef CPPADCG
#include "CppADCodegenTrait.h"
#endif
#ifdef CPPAD
#include "CppADDoubleTrait.h"
#endif
#include <ct/core/internal/traits/TraitSelector.h>

namespace ct {
namespace core {
namespace tpl {

#ifdef CPPAD
template <>
struct TraitSelector<CppAD::AD<double>>
{
typedef internal::CppADDoubleTrait Trait;
};
#endif

#ifdef CPPADCG
template <>
struct TraitSelector<CppAD::AD<CppAD::cg::CG<double>>>
{
typedef internal::CppADCodegenTrait Trait;
};

#endif

} // namespace tpl
} // namespace core
Expand Down
11 changes: 10 additions & 1 deletion ct_core/include/ct/core/types/AutoDiff.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,24 @@ Licensed under the BSD-2 license (see LICENSE file in main directory)

#pragma once

#ifdef CPPADCG
#include <cppad/cg.hpp>
#endif

#ifdef CPPAD
#include <cppad/cppad.hpp>
#endif

namespace ct {
namespace core {

#ifdef CPPAD
typedef CppAD::AD<double> ADScalar;
typedef CppAD::cg::CG<double> ADCGValueType;
#endif

#ifdef CPPADCG
typedef CppAD::cg::CG<double> ADCGValueType;
typedef CppAD::AD<ADCGValueType> ADCGScalar; //!< scalar type
#endif
}
}
Loading

0 comments on commit f925e9b

Please sign in to comment.