HEBI C++ API  3.1.0
group_feedback.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "hebi.h"
4 
5 #include <vector>
6 
7 #include "Eigen/Eigen"
8 #include "feedback.hpp"
9 
10 namespace hebi {
11 
16 class GroupFeedback final {
17 public:
18 #ifndef DOXYGEN_OMIT_INTERNAL
19 
23  HebiGroupFeedbackPtr internal_;
24 #endif // DOXYGEN_OMIT_INTERNAL
25 
26 private:
31  const bool manage_pointer_lifetime_;
35  const size_t number_of_modules_;
39  std::vector<Feedback> feedbacks_;
40 
41 public:
45  GroupFeedback(size_t number_of_modules);
46 #ifndef DOXYGEN_OMIT_INTERNAL
47 
52  GroupFeedback(HebiGroupFeedbackPtr group_feedback);
53 #endif // DOXYGEN_OMIT_INTERNAL
54 
58  ~GroupFeedback() noexcept; /* annotating specified destructor as noexcept is best-practice */
59 
63  size_t size() const;
64 
68  const Feedback& operator[](size_t index) const;
69 
78  double getTime() const;
79 
88  uint64_t getTimeUs() const;
89 
93  Eigen::VectorXd getBoardTemperature() const;
97  Eigen::VectorXd getProcessorTemperature() const;
101  Eigen::VectorXd getVoltage() const;
105  Eigen::VectorXd getDeflection() const;
109  Eigen::VectorXd getDeflectionVelocity() const;
113  Eigen::VectorXd getMotorVelocity() const;
117  Eigen::VectorXd getMotorCurrent() const;
121  Eigen::VectorXd getMotorSensorTemperature() const;
125  Eigen::VectorXd getMotorWindingCurrent() const;
129  Eigen::VectorXd getMotorWindingTemperature() const;
133  Eigen::VectorXd getMotorHousingTemperature() const;
134 
138  Eigen::VectorXd getPosition() const;
142  Eigen::VectorXd getVelocity() const;
146  Eigen::VectorXd getEffort() const;
147 
151  Eigen::VectorXd getPositionCommand() const;
155  Eigen::VectorXd getVelocityCommand() const;
159  Eigen::VectorXd getEffortCommand() const;
160 
164  Eigen::MatrixX3d getAccelerometer() const;
168  Eigen::MatrixX3d getGyro() const;
169 
173  void getBoardTemperature(Eigen::VectorXd& out) const;
177  void getProcessorTemperature(Eigen::VectorXd& out) const;
181  void getVoltage(Eigen::VectorXd& out) const;
185  void getDeflection(Eigen::VectorXd& out) const;
189  void getDeflectionVelocity(Eigen::VectorXd& out) const;
193  void getMotorVelocity(Eigen::VectorXd& out) const;
197  void getMotorCurrent(Eigen::VectorXd& out) const;
201  void getMotorSensorTemperature(Eigen::VectorXd& out) const;
205  void getMotorWindingCurrent(Eigen::VectorXd& out) const;
209  void getMotorWindingTemperature(Eigen::VectorXd& out) const;
213  void getMotorHousingTemperature(Eigen::VectorXd& out) const;
214 
218  void getPosition(Eigen::VectorXd& out) const;
222  void getVelocity(Eigen::VectorXd& out) const;
226  void getEffort(Eigen::VectorXd& out) const;
227 
231  void getPositionCommand(Eigen::VectorXd& out) const;
235  void getVelocityCommand(Eigen::VectorXd& out) const;
239  void getEffortCommand(Eigen::VectorXd& out) const;
240 
244  void getAccelerometer(Eigen::MatrixX3d& out) const;
248  void getGyro(Eigen::MatrixX3d& out) const;
249 };
250 
251 } // namespace hebi
A list of Feedback objects that can be received from a Group of modules; the size() must match the nu...
Definition: group_feedback.hpp:16
Eigen::VectorXd getVelocity() const
Convenience function for returning feedback velocity values.
Definition: group_feedback.cpp:152
Eigen::MatrixX3d getGyro() const
Convenience function for returning feedback gyroscope values.
Definition: group_feedback.cpp:211
Eigen::VectorXd getDeflection() const
Convenience function for returning feedback deflection values.
Definition: group_feedback.cpp:78
Eigen::VectorXd getVelocityCommand() const
Convenience function for returning commanded velocity values.
Definition: group_feedback.cpp:177
Eigen::VectorXd getMotorCurrent() const
Convenience function for returning feedback motor current values.
Definition: group_feedback.cpp:102
Eigen::VectorXd getBoardTemperature() const
Convenience function for returning feedback board temperature values.
Definition: group_feedback.cpp:53
Definition: bit_set.hpp:5
Eigen::VectorXd getPosition() const
Convenience function for returning feedback position values.
Definition: group_feedback.cpp:144
Eigen::VectorXd getEffort() const
Convenience function for returning feedback effort values.
Definition: group_feedback.cpp:160
Eigen::VectorXd getMotorWindingTemperature() const
Convenience function for returning feedback motor winding temperature values.
Definition: group_feedback.cpp:127
double getTime() const
Gets a single wall-clock timestamp (in seconds since the epoch) associated with the entire group feed...
Definition: group_feedback.cpp:30
Eigen::MatrixX3d getAccelerometer() const
Convenience function for returning feedback accelerometer values.
Definition: group_feedback.cpp:194
Feedback objects have various fields representing feedback from modules; which fields are populated d...
Definition: feedback.hpp:32
Eigen::VectorXd getEffortCommand() const
Convenience function for returning commanded effort values.
Definition: group_feedback.cpp:185
Eigen::VectorXd getVoltage() const
Convenience function for returning feedback voltage values.
Definition: group_feedback.cpp:69
const Feedback & operator[](size_t index) const
Access the feedback for an individual module.
Definition: group_feedback.cpp:28
Eigen::VectorXd getMotorHousingTemperature() const
Convenience function for returning feedback motor housing temperature values.
Definition: group_feedback.cpp:135
GroupFeedback(size_t number_of_modules)
Create a group feedback with the specified number of modules.
Definition: group_feedback.cpp:5
uint64_t getTimeUs() const
Gets a single wall-clock timestamp (in microseconds since the epoch) associated with the entire group...
Definition: group_feedback.cpp:42
size_t size() const
Returns the number of module feedbacks in this group feedback.
Definition: group_feedback.cpp:26
Eigen::VectorXd getPositionCommand() const
Convenience function for returning commanded position values.
Definition: group_feedback.cpp:169
Eigen::VectorXd getProcessorTemperature() const
Convenience function for returning feedback processor temperature values.
Definition: group_feedback.cpp:61
Eigen::VectorXd getMotorWindingCurrent() const
Convenience function for returning feedback motor winding current values.
Definition: group_feedback.cpp:118
~GroupFeedback() noexcept
Destructor cleans up group feedback object as necessary.
Definition: group_feedback.cpp:21
Eigen::VectorXd getMotorVelocity() const
Convenience function for returning feedback motor velocity values.
Definition: group_feedback.cpp:94
Eigen::VectorXd getDeflectionVelocity() const
Convenience function for returning feedback deflection velocity values.
Definition: group_feedback.cpp:86
Eigen::VectorXd getMotorSensorTemperature() const
Convenience function for returning feedback motor sensor temperature values.
Definition: group_feedback.cpp:110