Biorbd Release_1.13.0
Loading...
Searching...
No Matches
Actuators.h
1#ifndef BIORBD_ACTUATORS_ACTUATORS_H
2#define BIORBD_ACTUATORS_ACTUATORS_H
3
4#include "biorbdConfig.h"
5
6#include <memory>
7#include <vector>
8
9#include "Utils/Scalar.h"
10
11namespace BIORBD_NAMESPACE {
12namespace utils {
13class Vector;
14}
15
16namespace rigidbody {
20} // namespace rigidbody
21
22namespace internal_forces {
23namespace actuator {
24class Actuator;
28class BIORBD_API Actuators {
29 public:
33 Actuators();
34
39 Actuators(const Actuators& other);
40
44 virtual ~Actuators();
45
50 void DeepCopy(const Actuators& other);
51
56 void addActuator(const Actuator& a);
57
62 void closeActuator();
63
71 std::pair<rigidbody::GeneralizedTorque, rigidbody::GeneralizedTorque>
75
86 const utils::Vector& activation,
89
100 const utils::Vector& activation,
103
104 // Get and set
110 const std::pair<std::shared_ptr<Actuator>, std::shared_ptr<Actuator>>&
111 actuator(size_t dof);
112
120 const Actuator& actuator(size_t dof, bool concentric);
121
126 size_t nbActuators() const;
127
128 protected:
129 std::shared_ptr<std::vector<
130 std::pair<std::shared_ptr<Actuator>, std::shared_ptr<Actuator>>>>
132 std::shared_ptr<std::vector<bool>> m_isDofSet;
133 std::shared_ptr<bool> m_isClose;
134
143 utils::Scalar getTorqueMaxDirection(
144 const std::shared_ptr<Actuator> actuator,
146 const rigidbody::GeneralizedVelocity& Qdot) const;
147};
148
149} // namespace actuator
150} // namespace internal_forces
151} // namespace BIORBD_NAMESPACE
152
153#endif // BIORBD_ACTUATORS_ACTUATORS_H
size_t nbActuators() const
Return the toal number of actuators.
std::pair< rigidbody::GeneralizedTorque, rigidbody::GeneralizedTorque > torqueMax(const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot)
Return two vectors of max torque (it is impossible to know if eccentric or concentric is required,...
rigidbody::GeneralizedTorque torque(const utils::Vector &activation, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot)
Return the generalized torque.
const std::pair< std::shared_ptr< Actuator >, std::shared_ptr< Actuator > > & actuator(size_t dof)
Return a specific concentric/eccentric actuator.
utils::Scalar getTorqueMaxDirection(const std::shared_ptr< Actuator > actuator, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot) const
getTorqueMaxDirection Get the max torque of a specific actuator (interface necessary because of CasAD...
std::shared_ptr< bool > m_isClose
If the set is ready.
Definition Actuators.h:133
void DeepCopy(const Actuators &other)
Deep copy of the actuator holder from other actuator holder.
Definition Actuators.cpp:42
void closeActuator()
Indicate to biorbd to are done adding actuators, sanity checks are performed.
std::shared_ptr< std::vector< bool > > m_isDofSet
If DoF all dof are set.
Definition Actuators.h:132
void addActuator(const Actuator &a)
Add an actuator to the set of actuators.
std::shared_ptr< std::vector< std::pair< std::shared_ptr< Actuator >, std::shared_ptr< Actuator > > > > m_all
All the actuators reunited /pair (+ or -).
Definition Actuators.h:131
Wrapper of the Eigen VectorXd.
Definition Vector.h:21