Biorbd
Release_1.13.0
Toggle main menu visibility
Loading...
Searching...
No Matches
ActuatorConstant.cpp
1
#define BIORBD_API_EXPORTS
2
#include "InternalForces/Actuators/ActuatorConstant.h"
3
4
#include "RigidBody/GeneralizedCoordinates.h"
5
#include "Utils/String.h"
6
7
using namespace
BIORBD_NAMESPACE;
8
9
internal_forces::actuator::ActuatorConstant::ActuatorConstant
()
10
:
Actuator
(),
m_Tmax
(std::make_shared<utils::Scalar>(0)) {
11
setType
();
12
}
13
14
internal_forces::actuator::ActuatorConstant::ActuatorConstant
(
15
const
internal_forces::actuator::ActuatorConstant
&other)
16
:
Actuator
(other),
m_Tmax
(other.
m_Tmax
) {}
17
18
internal_forces::actuator::ActuatorConstant::ActuatorConstant
(
19
int
direction
,
20
const
utils::Scalar &Tmax,
21
size_t
dofIdx)
22
:
Actuator
(
direction
, dofIdx),
23
m_Tmax
(std::make_shared<utils::Scalar>(Tmax)) {
24
setType
();
25
}
26
27
internal_forces::actuator::ActuatorConstant::ActuatorConstant
(
28
int
direction
,
29
const
utils::Scalar &Tmax,
30
size_t
dofIdx,
31
const
utils::String
&jointName)
32
:
Actuator
(
direction
, dofIdx, jointName),
33
m_Tmax
(std::make_shared<utils::Scalar>(Tmax)) {
34
setType
();
35
}
36
37
internal_forces::actuator::ActuatorConstant
38
internal_forces::actuator::ActuatorConstant::DeepCopy
()
const
{
39
internal_forces::actuator::ActuatorConstant
copy;
40
copy.
DeepCopy
(*
this
);
41
return
copy;
42
}
43
44
void
internal_forces::actuator::ActuatorConstant::DeepCopy
(
45
const
internal_forces::actuator::ActuatorConstant
&other) {
46
internal_forces::actuator::Actuator::DeepCopy
(other);
47
*
m_Tmax
= *other.
m_Tmax
;
48
}
49
50
utils::Scalar
internal_forces::actuator::ActuatorConstant::torqueMax
() {
51
return
*
m_Tmax
;
52
}
53
54
void
internal_forces::actuator::ActuatorConstant::setType
() {
55
*
m_type
= internal_forces::actuator::TYPE::CONSTANT;
56
}
BIORBD_NAMESPACE::internal_forces::actuator::ActuatorConstant
Class ActuatorConstant is a joint actuator type which maximum is contant.
Definition
ActuatorConstant.h:16
BIORBD_NAMESPACE::internal_forces::actuator::ActuatorConstant::torqueMax
virtual utils::Scalar torqueMax()
Return the maximal torque.
Definition
ActuatorConstant.cpp:50
BIORBD_NAMESPACE::internal_forces::actuator::ActuatorConstant::m_Tmax
std::shared_ptr< utils::Scalar > m_Tmax
Maximal torque that can be done.
Definition
ActuatorConstant.h:73
BIORBD_NAMESPACE::internal_forces::actuator::ActuatorConstant::setType
virtual void setType()
Set the type of the constant actuator.
Definition
ActuatorConstant.cpp:54
BIORBD_NAMESPACE::internal_forces::actuator::ActuatorConstant::DeepCopy
ActuatorConstant DeepCopy() const
Deep copy of the constant actuator.
Definition
ActuatorConstant.cpp:38
BIORBD_NAMESPACE::internal_forces::actuator::ActuatorConstant::ActuatorConstant
ActuatorConstant()
Construct a constant actuator.
Definition
ActuatorConstant.cpp:9
BIORBD_NAMESPACE::internal_forces::actuator::Actuator::DeepCopy
void DeepCopy(const Actuator &other)
Deep copy of actuator.
Definition
Actuator.cpp:48
BIORBD_NAMESPACE::internal_forces::actuator::Actuator::direction
int direction() const
Return the direction of the actuator.
Definition
Actuator.cpp:58
BIORBD_NAMESPACE::internal_forces::actuator::Actuator::m_type
std::shared_ptr< TYPE > m_type
The type of the actuator.
Definition
Actuator.h:90
BIORBD_NAMESPACE::internal_forces::actuator::Actuator::Actuator
Actuator()
Construct actuator.
Definition
Actuator.cpp:9
BIORBD_NAMESPACE::utils::String
Wrapper around the std::string class with augmented functionality.
Definition
String.h:18
src
InternalForces
Actuators
ActuatorConstant.cpp
Generated by
1.18.0