40 HebiGroupPtr internal_;
45 const int number_of_modules_;
50 std::mutex handler_lock_;
56 std::vector<GroupFeedbackHandler> handlers_;
58 #ifndef DOXYGEN_OMIT_INTERNAL 63 friend void callbackWrapper(HebiGroupFeedbackPtr group_feedback,
void* user_data);
64 #endif // DOXYGEN_OMIT_INTERNAL 70 void callAttachedHandlers(HebiGroupFeedbackPtr group_feedback);
79 #ifndef DOXYGEN_OMIT_INTERNAL 85 Group(HebiGroupPtr group,
float initial_feedback_frequency = 0.0f, int32_t initial_command_lifetime = 0);
86 #endif // DOXYGEN_OMIT_INTERNAL 207 std::
string startLog(const std::
string& dir) const;
219 std::
string startLog(const std::
string& dir, const std::
string& file) const;
void addFeedbackHandler(GroupFeedbackHandler handler)
Adds a handler function to be called by the internal feedback request thread.
Definition: group.cpp:144
std::shared_ptr< LogFile > stopLog() const
Stops any active log.
Definition: group.cpp:129
A list of Feedback objects that can be received from a Group of modules; the size() must match the nu...
Definition: group_feedback.hpp:18
void clearFeedbackHandlers()
Removes all feedback handlers presently added.
Definition: group.cpp:151
Represents a group of physical HEBI modules, and allows Command, Feedback, and Info objects to be sen...
Definition: group.hpp:35
A list of Info objects that can be received from a Group of modules; the size() must match the number...
Definition: group_info.hpp:18
float getFeedbackFrequencyHz()
Gets the frequency of the internal feedback request + callback thread.
Definition: group.cpp:142
~Group() noexcept
Destructor cleans up group.
Definition: group.cpp:42
bool sendCommandWithAcknowledgement(const GroupCommand &group_command, int32_t timeout_ms=DEFAULT_TIMEOUT_MS)
Send a command to the given group, requesting an acknowledgement of transmission to be sent back.
Definition: group.cpp:61
InfoExtraFields
Definition: group.hpp:25
int size()
Returns the number of modules in the group.
Definition: group.cpp:48
static const int32_t DEFAULT_TIMEOUT_MS
The default timeout for any send-with-acknowledgement or request operation is 500 ms.
Definition: group.hpp:77
bool sendCommand(const GroupCommand &group_command)
Send a command to the given group without requesting an acknowledgement.
Definition: group.cpp:54
bool setCommandLifetimeMs(int32_t ms)
Sets the command lifetime for the modules in this group.
Definition: group.cpp:50
bool requestInfoExtra(GroupInfo &info, InfoExtraFields extra_fields, int32_t timeout_ms=DEFAULT_TIMEOUT_MS)
Request info from the group, and store it in the passed-in info object. Include extra fields.
Definition: group.cpp:84
#define HEBI_DISABLE_COPY_MOVE(Class)
Definition: util.hpp:6
Definition: log_file.hpp:11
static std::shared_ptr< Group > createImitation(size_t size)
Creates an imitation group of provided size.
Definition: group.cpp:38
bool getNextFeedback(GroupFeedback &feedback, int32_t timeout_ms=DEFAULT_TIMEOUT_MS)
Returns the most recently stored feedback from a sent feedback request, or returns the next one recei...
Definition: group.cpp:70
std::string startLog(const std::string &dir) const
Starts log (stopping any active log).
Definition: group.cpp:91
std::function< void(const GroupFeedback &)> GroupFeedbackHandler
Definition of a callback function for GroupFeedback returned from a Group of modules.
Definition: group.hpp:23
A list of Command objects appropriate for sending to a Group of modules; the size() must match the nu...
Definition: group_command.hpp:19
bool requestInfo(GroupInfo &info, int32_t timeout_ms=DEFAULT_TIMEOUT_MS)
Request info from the group, and store it in the passed-in info object.
Definition: group.cpp:77
bool setFeedbackFrequencyHz(float frequency)
Sets the frequency of the internal feedback request + callback thread.
Definition: group.cpp:138
bool sendFeedbackRequest()
Requests feedback from the group.
Definition: group.cpp:68