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