Biorbd Release_1.13.0
Loading...
Searching...
No Matches
Actuator.cpp
1#define BIORBD_API_EXPORTS
2#include "InternalForces/Actuators/Actuator.h"
3
4#include "Utils/Error.h"
5#include "Utils/String.h"
6
7using namespace BIORBD_NAMESPACE;
8
10 : m_type(
11 std::make_shared<internal_forces::actuator::TYPE>(
12 internal_forces::actuator::TYPE::NO_TYPE)),
13 m_direction(std::make_shared<int>(0)),
14 m_jointName(std::make_shared<utils::String>("")),
15 m_dofIdx(std::make_shared<size_t>(-1)) {}
16
23
25 : m_type(
26 std::make_shared<internal_forces::actuator::TYPE>(
27 internal_forces::actuator::TYPE::NO_TYPE)),
28 m_direction(std::make_shared<int>(direction)),
29 m_jointName(std::make_shared<utils::String>("")),
30 m_dofIdx(std::make_shared<size_t>(dofIdx)) {}
31
33 int direction,
34 size_t dofIdx,
35 const utils::String &jointName)
36 : m_type(
37 std::make_shared<internal_forces::actuator::TYPE>(
38 internal_forces::actuator::TYPE::NO_TYPE)),
39 m_direction(std::make_shared<int>(direction)),
40 m_jointName(std::make_shared<utils::String>(jointName)),
41 m_dofIdx(std::make_shared<size_t>(dofIdx)) {
43 *m_direction == -1 || *m_direction == 1, "Direction should be -1 or 1");
44}
45
47
55
57
61
62internal_forces::actuator::TYPE internal_forces::actuator::Actuator::type()
63 const {
64 return *m_type;
65}
std::shared_ptr< utils::String > m_jointName
Name of the parent joint.
Definition Actuator.h:94
void DeepCopy(const Actuator &other)
Deep copy of actuator.
Definition Actuator.cpp:48
std::shared_ptr< int > m_direction
The direction of the actuator (+1 or -1).
Definition Actuator.h:92
TYPE type() const
Return the type of the actuator.
Definition Actuator.cpp:62
int direction() const
Return the direction of the actuator.
Definition Actuator.cpp:58
virtual ~Actuator()
Destroy class properly.
Definition Actuator.cpp:46
std::shared_ptr< TYPE > m_type
The type of the actuator.
Definition Actuator.h:90
size_t index() const
Return the index of the DoF associated with actuator.
Definition Actuator.cpp:56
std::shared_ptr< size_t > m_dofIdx
Index of the DoF associated with the actuator.
Definition Actuator.h:96
static void check(bool cond, const String &message)
Assert that raises the error message if false.
Definition Error.cpp:10
Wrapper around the std::string class with augmented functionality.
Definition String.h:18