7 manage_pointer_lifetime_(true),
8 number_of_modules_(number_of_modules)
45 res[i] = (fbk) ? fbk.get() : std::numeric_limits<float>::quiet_NaN();
54 auto& fbk =
feedbacks_[i].processorTemperature();
55 res[i] = (fbk) ? fbk.get() : std::numeric_limits<float>::quiet_NaN();
65 res[i] = (fbk) ? fbk.get() : std::numeric_limits<float>::quiet_NaN();
76 res[i] = (
cmd) ?
cmd.get() : std::numeric_limits<float>::quiet_NaN();
86 res[i] = (
cmd) ?
cmd.get() : std::numeric_limits<float>::quiet_NaN();
96 res[i] = (
cmd) ?
cmd.get() : std::numeric_limits<float>::quiet_NaN();
105 auto& fbk =
feedbacks_[i].actuator().motorCurrent();
106 res[i] = (fbk) ? fbk.get() : std::numeric_limits<float>::quiet_NaN();
115 auto& fbk =
feedbacks_[i].actuator().motorSensorTemperature();
116 res[i] = (fbk) ? fbk.get() : std::numeric_limits<float>::quiet_NaN();
125 auto& fbk =
feedbacks_[i].actuator().motorWindingCurrent();
126 res[i] = (fbk) ? fbk.get() : std::numeric_limits<float>::quiet_NaN();
136 auto&
cmd =
feedbacks_[i].actuator().motorWindingTemperature();
137 res[i] = (
cmd) ?
cmd.get() : std::numeric_limits<float>::quiet_NaN();
146 auto&
cmd =
feedbacks_[i].actuator().motorHousingTemperature();
147 res[i] = (
cmd) ?
cmd.get() : std::numeric_limits<float>::quiet_NaN();
157 auto& fbk =
feedbacks_[i].actuator().position();
158 res[i] = (fbk) ? fbk.get() : std::numeric_limits<float>::quiet_NaN();
167 auto& fbk =
feedbacks_[i].actuator().velocity();
168 res[i] = (fbk) ? fbk.get() : std::numeric_limits<float>::quiet_NaN();
177 auto& fbk =
feedbacks_[i].actuator().effort();
178 res[i] = (fbk) ? fbk.get() : std::numeric_limits<float>::quiet_NaN();
189 res[i] = (
cmd) ?
cmd.get() : std::numeric_limits<float>::quiet_NaN();
199 res[i] = (
cmd) ?
cmd.get() : std::numeric_limits<float>::quiet_NaN();
209 res[i] = (
cmd) ?
cmd.get() : std::numeric_limits<float>::quiet_NaN();
219 auto& fbk =
feedbacks_[i].imu().accelerometer();
222 auto vec = fbk.get();
223 res(i, 0) = vec.getX();
224 res(i, 1) = vec.getY();
225 res(i, 2) = vec.getZ();
229 res(i, 0) = std::numeric_limits<double>::quiet_NaN();
230 res(i, 1) = std::numeric_limits<double>::quiet_NaN();
231 res(i, 2) = std::numeric_limits<double>::quiet_NaN();
244 auto vec = fbk.get();
245 res(i, 0) = vec.getX();
246 res(i, 1) = vec.getY();
247 res(i, 2) = vec.getZ();
251 res(i, 0) = std::numeric_limits<double>::quiet_NaN();
252 res(i, 1) = std::numeric_limits<double>::quiet_NaN();
253 res(i, 2) = std::numeric_limits<double>::quiet_NaN();
269 out[i] = (fbk) ? fbk.get() : std::numeric_limits<float>::quiet_NaN();
281 auto& fbk =
feedbacks_[i].processorTemperature();
282 out[i] = (fbk) ? fbk.get() : std::numeric_limits<float>::quiet_NaN();
295 out[i] = (fbk) ? fbk.get() : std::numeric_limits<float>::quiet_NaN();
309 out[i] = (
cmd) ?
cmd.get() : std::numeric_limits<float>::quiet_NaN();
322 out[i] = (
cmd) ?
cmd.get() : std::numeric_limits<float>::quiet_NaN();
335 out[i] = (
cmd) ?
cmd.get() : std::numeric_limits<float>::quiet_NaN();
347 auto& fbk =
feedbacks_[i].actuator().motorCurrent();
348 out[i] = (fbk) ? fbk.get() : std::numeric_limits<float>::quiet_NaN();
360 auto& fbk =
feedbacks_[i].actuator().motorSensorTemperature();
361 out[i] = (fbk) ? fbk.get() : std::numeric_limits<float>::quiet_NaN();
373 auto& fbk =
feedbacks_[i].actuator().motorWindingCurrent();
374 out[i] = (fbk) ? fbk.get() : std::numeric_limits<float>::quiet_NaN();
387 auto&
cmd =
feedbacks_[i].actuator().motorWindingTemperature();
388 out[i] = (
cmd) ?
cmd.get() : std::numeric_limits<float>::quiet_NaN();
400 auto&
cmd =
feedbacks_[i].actuator().motorHousingTemperature();
401 out[i] = (
cmd) ?
cmd.get() : std::numeric_limits<float>::quiet_NaN();
414 auto& fbk =
feedbacks_[i].actuator().position();
415 out[i] = (fbk) ? fbk.get() : std::numeric_limits<float>::quiet_NaN();
427 auto& fbk =
feedbacks_[i].actuator().velocity();
428 out[i] = (fbk) ? fbk.get() : std::numeric_limits<float>::quiet_NaN();
440 auto& fbk =
feedbacks_[i].actuator().effort();
441 out[i] = (fbk) ? fbk.get() : std::numeric_limits<float>::quiet_NaN();
455 out[i] = (
cmd) ?
cmd.get() : std::numeric_limits<float>::quiet_NaN();
468 out[i] = (
cmd) ?
cmd.get() : std::numeric_limits<float>::quiet_NaN();
481 out[i] = (
cmd) ?
cmd.get() : std::numeric_limits<float>::quiet_NaN();
494 auto& fbk =
feedbacks_[i].imu().accelerometer();
497 auto vec = fbk.get();
498 out(i, 0) = vec.getX();
499 out(i, 1) = vec.getY();
500 out(i, 2) = vec.getZ();
504 out(i, 0) = std::numeric_limits<double>::quiet_NaN();
505 out(i, 1) = std::numeric_limits<double>::quiet_NaN();
506 out(i, 2) = std::numeric_limits<double>::quiet_NaN();
522 auto vec = fbk.get();
523 out(i, 0) = vec.getX();
524 out(i, 1) = vec.getY();
525 out(i, 2) = vec.getZ();
529 out(i, 0) = std::numeric_limits<double>::quiet_NaN();
530 out(i, 1) = std::numeric_limits<double>::quiet_NaN();
531 out(i, 2) = std::numeric_limits<double>::quiet_NaN();
const Feedback & operator[](size_t index) const
Access the feedback for an individual module.
Eigen::VectorXd getVelocityCommand() const
Convenience function for returning commanded velocity values.
Eigen::VectorXd getBoardTemperature() const
Convenience function for returning feedback board temperature values.
Eigen::VectorXd getEffort() const
Convenience function for returning feedback effort values.
HebiGroupFeedbackPtr hebiGroupFeedbackCreate(size_t size)
Creates a GroupFeedback for a group with the specified number of modules.
struct _HebiGroupFeedback * HebiGroupFeedbackPtr
The C-style's API representation of group feedback.
Eigen::VectorXd getDeflection() const
Convenience function for returning feedback deflection values.
size_t size() const
Returns the number of module feedbacks in this group feedback.
Eigen::VectorXd getVelocity() const
Convenience function for returning feedback velocity values.
Eigen::VectorXd getProcessorTemperature() const
Convenience function for returning feedback processor temperature values.
Feedback objects have various fields representing feedback from modules; which fields are populated d...
Eigen::MatrixX3d getGyro() const
Convenience function for returning feedback gyroscope values.
const bool manage_pointer_lifetime_
GroupFeedback(size_t number_of_modules)
Create a group feedback with the specified number of modules.
HebiFeedbackPtr hebiGroupFeedbackGetModuleFeedback(HebiGroupFeedbackPtr fbk, size_t module_index)
Get an individual feedback for a particular module at index module_index.
Eigen::VectorXd getMotorSensorTemperature() const
Convenience function for returning feedback motor sensor temperature values.
std::vector< Feedback > feedbacks_
Eigen::VectorXd getDeflectionVelocity() const
Convenience function for returning feedback deflection velocity values.
Eigen::VectorXd getVoltage() const
Convenience function for returning feedback voltage values.
HebiGroupFeedbackPtr internal_
const size_t number_of_modules_
Eigen::VectorXd getMotorWindingCurrent() const
Convenience function for returning feedback motor winding current values.
size_t hebiGroupFeedbackGetSize(HebiGroupFeedbackPtr fbk)
Return the number of modules in this group Feedback.
Eigen::VectorXd getMotorVelocity() const
Convenience function for returning feedback motor velocity values.
Eigen::MatrixX3d getAccelerometer() const
Convenience function for returning feedback accelerometer values.
Eigen::VectorXd getMotorHousingTemperature() const
Convenience function for returning feedback motor housing temperature values.
void hebiGroupFeedbackRelease(HebiGroupFeedbackPtr fbk)
Frees resources created by the GroupFeedback object.
Eigen::VectorXd getMotorCurrent() const
Convenience function for returning feedback motor current values.
~GroupFeedback() noexcept
Destructor cleans up group feedback object as necessary.
Eigen::VectorXd getPositionCommand() const
Convenience function for returning commanded position values.
Eigen::VectorXd getEffortCommand() const
Convenience function for returning commanded effort values.
Eigen::VectorXd getPosition() const
Convenience function for returning feedback position values.
Eigen::VectorXd getMotorWindingTemperature() const
Convenience function for returning feedback motor winding temperature values.