Biorbd
Actuators.h
1 #ifndef BIORBD_ACTUATORS_ACTUATORS_H
2 #define BIORBD_ACTUATORS_ACTUATORS_H
3 
4 #include <vector>
5 #include <memory>
6 #include "biorbdConfig.h"
7 #include "Utils/Scalar.h"
8 
9 namespace biorbd {
10 namespace utils {
11 class Vector;
12 }
13 
14 namespace rigidbody {
15 class GeneralizedCoordinates;
16 class GeneralizedVelocity;
17 class GeneralizedTorque;
18 }
19 
20 namespace actuator {
21 class Actuator;
25 class BIORBD_API Actuators
26 {
27 public:
31  Actuators();
32 
37  Actuators(
38  const biorbd::actuator::Actuators& other);
39 
43  virtual ~Actuators();
44 
49  void DeepCopy(
50  const biorbd::actuator::Actuators& other);
51 
56  void addActuator(
58 
62  void closeActuator();
63 
70  std::pair<biorbd::rigidbody::GeneralizedTorque, biorbd::rigidbody::GeneralizedTorque> torqueMax(
73 
82  const biorbd::utils::Vector &activation,
85 
94  const biorbd::utils::Vector &activation,
97 
98  // Get and set
104  const std::pair<std::shared_ptr<biorbd::actuator::Actuator>, std::shared_ptr<biorbd::actuator::Actuator>>&
105  actuator(unsigned int dof);
106 
113  const biorbd::actuator::Actuator& actuator(unsigned int dof, bool concentric);
114 
119  unsigned int nbActuators() const;
120 
121 protected:
122  std::shared_ptr<std::vector<std::pair<std::shared_ptr<biorbd::actuator::Actuator>, std::shared_ptr<biorbd::actuator::Actuator>>>> m_all;
123  std::shared_ptr<std::vector<bool>> m_isDofSet;
124  std::shared_ptr<bool> m_isClose;
125 
133  biorbd::utils::Scalar getTorqueMaxDirection(
134  const std::shared_ptr<Actuator> actuator,
136  const rigidbody::GeneralizedVelocity &Qdot) const;
137 
138 };
139 
140 }}
141 
142 #endif // BIORBD_ACTUATORS_ACTUATORS_H
biorbd::actuator::Actuators
Class holder for a set of actuators.
Definition: Actuators.h:26
biorbd::utils::Vector
Wrapper of the Eigen VectorXd.
Definition: Vector.h:20
biorbd::actuator::Actuator
Class Actuator.
Definition: Actuator.h:20
biorbd::actuator::Actuators::m_isDofSet
std::shared_ptr< std::vector< bool > > m_isDofSet
If DoF all dof are set.
Definition: Actuators.h:123
biorbd::rigidbody::GeneralizedCoordinates
Class GeneralizedCoordinates.
Definition: GeneralizedCoordinates.h:15
biorbd::actuator::Actuators::m_isClose
std::shared_ptr< bool > m_isClose
If the set is ready.
Definition: Actuators.h:124
biorbd::rigidbody::GeneralizedTorque
Class GeneralizedTorque.
Definition: GeneralizedTorque.h:15
biorbd::rigidbody::GeneralizedVelocity
Class GeneralizedVelocity.
Definition: GeneralizedVelocity.h:15
biorbd::actuator::Actuators::m_all
std::shared_ptr< std::vector< std::pair< std::shared_ptr< biorbd::actuator::Actuator >, std::shared_ptr< biorbd::actuator::Actuator > > > > m_all
All the actuators reunited /pair (+ or -)
Definition: Actuators.h:122