Go to the documentation of this file.
10 #ifndef DOXYGEN_OMIT_INTERNAL
12 reinterpret_cast<Group*
>(user_data)->callAttachedHandlers(group_feedback);
14 #endif // DOXYGEN_OMIT_INTERNAL
21 for (
unsigned int i = 0; i <
handlers_.size(); i++) {
32 if (initial_feedback_frequency != 0)
34 if (initial_command_lifetime != 0)
79 char* buffer =
new char[len];
81 std::string ret(buffer, --len);
98 char* buffer =
new char[len];
100 std::string ret(buffer, --len);
112 if (
internal ==
nullptr) {
113 return std::shared_ptr<LogFile>();
HebiStatusCode hebiGroupGetNextFeedback(HebiGroupPtr group, HebiGroupFeedbackPtr feedback, int32_t timeout_ms)
Returns the most recently stored feedback from a sent feedback request, or returns the next one recei...
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.
float hebiGroupGetFeedbackFrequencyHz(HebiGroupPtr group)
Returns the current feedback request loop frequency (in Hz).
struct HebiGroupFeedback_ * HebiGroupFeedbackPtr
The C-style's API representation of a feedback object for a group of modules.
struct HebiGroup_ * HebiGroupPtr
The C-style's API representation of a group.
A list of Feedback objects that can be received from a Group of modules; the size() must match the nu...
void hebiGroupClearFeedbackHandlers(HebiGroupPtr group)
Removes all feedback handling functions from the queue to be called on receipt of group feedback.
HebiStatusCode hebiGroupStartLog(HebiGroupPtr group, const char *dir, const char *file, HebiStringPtr *ret)
Starts logging data to a file.
A list of Command objects appropriate for sending to a Group of modules; the size() must match the nu...
HebiStatusCode hebiGroupSendCommandWithAcknowledgement(HebiGroupPtr group, HebiGroupCommandPtr command, int32_t timeout_ms)
Sends a command to the given group, requesting an acknowledgement of transmission to be sent back.
bool setFeedbackFrequencyHz(float frequency)
Sets the frequency of the internal feedback request + callback thread.
HebiStatusCode hebiGroupSetCommandLifetime(HebiGroupPtr group, int32_t lifetime_ms)
Sets the command lifetime for the group, in milliseconds.
bool sendCommand(const GroupCommand &group_command)
Send a command to the given group without requesting an acknowledgement.
HebiStatusCode hebiGroupSendFeedbackRequest(HebiGroupPtr group)
Requests feedback from the group.
void hebiStringRelease(HebiStringPtr str)
Releases a string instance.
void hebiGroupRelease(HebiGroupPtr group)
Release resources for a given group; group should not be used after this call.
HebiGroupPtr hebiGroupCreateImitation(size_t size)
Group API.
HebiStatusCode hebiGroupRegisterFeedbackHandler(HebiGroupPtr group, GroupFeedbackHandlerFunction handler, void *user_data)
Add a function that is called whenever feedback is returned from the group.
HebiGroupFeedbackPtr internal_
static std::shared_ptr< Group > createImitation(size_t size)
Creates an imitation group of provided size.
HebiLogFilePtr hebiGroupStopLog(HebiGroupPtr group)
Stops logging data to a file.
void clearFeedbackHandlers()
Removes all feedback handlers presently added.
float getFeedbackFrequencyHz()
Gets the frequency of the internal feedback request + callback thread.
HebiStatusCode hebiGroupSendCommand(HebiGroupPtr group, HebiGroupCommandPtr command)
Sends a command to the given group without requesting an acknowledgement.
struct HebiString_ * HebiStringPtr
The C-style's API representation of a string.
size_t hebiGroupGetSize(HebiGroupPtr group)
Returns the number of modules in a group.
HebiGroupCommandPtr internal_
std::function< void(const GroupFeedback &)> GroupFeedbackHandler
Definition of a callback function for GroupFeedback returned from a Group of modules.
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.
std::shared_ptr< LogFile > stopLog()
Stops any active log.
~Group() noexcept
Destructor cleans up group.
A list of Info objects that can be received from a Group of modules; the size() must match the number...
std::vector< GroupFeedbackHandler > handlers_
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...
void callAttachedHandlers(HebiGroupFeedbackPtr group_feedback)
friend void callbackWrapper(HebiGroupFeedbackPtr group_feedback, void *user_data)
void addFeedbackHandler(GroupFeedbackHandler handler)
Adds a handler function to be called by the internal feedback request thread.
size_t hebiLogFileGetNumberOfModules(HebiLogFilePtr log_file)
Retrieve the number of modules in the group represented by an opened log file.
HebiStatusCode hebiGroupSetFeedbackFrequencyHz(HebiGroupPtr group, float frequency)
Sets the feedback request loop frequency (in Hz).
HebiGroupInfoPtr internal_
const int number_of_modules_
HebiStatusCode hebiGroupRequestInfo(HebiGroupPtr group, HebiGroupInfoPtr info, int32_t timeout_ms)
Requests info from the group, and writes it to the provided info object.
HebiStatusCode hebiStringGetString(HebiStringPtr str, char *buffer, size_t *length)
String Functions.
bool setCommandLifetimeMs(int32_t ms)
Sets the command lifetime for the modules in this group.
Group(HebiGroupPtr group, float initial_feedback_frequency=0.0f, int32_t initial_command_lifetime=0)
int size()
Returns the number of modules in the group.
void callbackWrapper(HebiGroupFeedbackPtr group_feedback, void *user_data)
std::string startLog(const std::string &dir)
Starts log (stopping any active log).
bool sendFeedbackRequest()
Requests feedback from the group.
Represents a group of physical HEBI modules, and allows Command, Feedback, and Info objects to be sen...
hebi_cpp_api_ros
Author(s): Chris Bollinger
, Matthew Tesch
autogenerated on Fri Aug 2 2024 08:35:18