Go to the documentation of this file.
7 #define M_PI 3.14159265358979323846
13 : internal_(internal), field_(field) {}
20 ret = std::numeric_limits<float>::quiet_NaN();
40 return std::numeric_limits<double>::quiet_NaN();
42 return (
static_cast<double>(revolutions) * 2.0 *
M_PI +
static_cast<double>(radian_offset));
48 *radian_offset = std::numeric_limits<float>::quiet_NaN();
53 double revolutions_raw = radians / 2.0 /
M_PI;
54 double revolutions_int_d;
55 double radian_offset_d = std::modf(revolutions_raw, &revolutions_int_d);
56 radian_offset_d = radian_offset_d * 2.0 *
M_PI;
58 int64_t revolutions_int = std::isnan(revolutions_int_d) ? 0 :
static_cast<int64_t
>(revolutions_int_d);
59 float radian_offset =
static_cast<float>(radian_offset_d);
79 ret = std::numeric_limits<float>::quiet_NaN();
100 return static_cast<bool>(ret);
104 auto val =
static_cast<int>(value);
124 auto buffer =
new char[length];
126 std::string tmp(buffer, length - 1);
132 const char* buffer = value.c_str();
133 size_t length = value.size();
197 return Color(r, g, b, a);
224 : internal_(other.internal_),
226 settings_(internal_, internal_ref_),
227 actuator_(internal_ref_),
bool has() const
True if (and only if) the field has a value.
HebiStatusCode floatGetter(const RefT &ref, MetadataT &metadata, int field, float *value)
@ HebiCommandFlagClearLog
Stop the module from automatically booting into application.
void hebiCommandSetBool(HebiCommandRef &command, HebiCommandBoolField field, const int32_t *value)
void clear()
Removes any currently set value for this field.
void set(double radians)
Sets the field to a given double value (in radians). Note that double precision floating point number...
StringField(HebiCommandPtr internal, HebiCommandStringField field)
Structure to describe an RGB color.
@ HebiCommandFlagReset
Indicates if the module should save the current values of all of its settings.
void hebiCommandSetHighResAngle(HebiCommandRef &command, HebiCommandHighResAngleField field, const int64_t *int_part, const float *dec_part)
void hebiCommandSetNumberedFloat(HebiCommandRef &command, HebiCommandNumberedFloatField field, size_t number, const float *value)
@ HebiCommandStringAppendLog
The family for this module. The string must be null-terminated and less than 21 characters.
@ HebiCommandFlagBoot
Restart the module.
HebiCommandFloatField
Command Enums.
HebiStatusCode ledGetter(const RefT &ref, MetadataT &metadata, int field, uint8_t *r, uint8_t *g, uint8_t *b, uint8_t *a)
void hebiCommandSetIoPinFloat(HebiCommandRef &command, HebiCommandIoPinBank bank, size_t pin_number, const float *value)
void hebiCommandGetReference(HebiCommandPtr command, HebiCommandRef *ref)
void set(size_t fieldNumber, float value)
Sets the particular numbered subvalue of this field to a given value.
void clear()
Removes any currently set value for this field, so that the module maintains its previous state of LE...
std::string get() const
If the field has a value, returns a copy of that value; otherwise, returns a default.
void clear()
Removes any currently set value for this field.
bool hasInt(size_t pinNumber) const
True if (and only if) the particular numbered pin in this bank has an integer (e.g....
NumberedFloatField(HebiCommandRef &internal, HebiCommandNumberedFloatField field)
HebiCommandNumberedFloatField
void set(bool value)
Sets the field to a given value.
HebiCommandRef internal_ref_
@ HebiCommandFlagStopBoot
Boot the module from bootloader into application.
bool has() const
True if (and only if) the field has a value.
bool flagGetter(const RefT &ref, MetadataT &metadata, int field)
void hebiCommandSetLed(HebiCommandRef &command, HebiCommandLedField field, const Color *color)
HighResAngleField(HebiCommandRef &internal, HebiCommandHighResAngleField field)
void clear(size_t fieldNumber)
Removes any currently set value for the numbered subvalue of this field.
struct HebiCommand_ * HebiCommandPtr
Typedefs.
bool has() const
True if (and only if) the field has a value.
bool get() const
If the field has a value, returns that value; otherwise, returns false.
void hebiCommandSetString(HebiCommandPtr command, HebiCommandStringField field, const char *buffer, const size_t *length)
double get() const
If the field has a value, returns that value as a double; otherwise, returns a default.
@ HebiCommandNumberedFloatDebug
NumberedFloatField debug_
HebiStatusCode highResAngleGetter(const RefT &ref, MetadataT &metadata, int field, int64_t *revs, float *offset)
void clear()
Clears this flag (e.g., sets it to false/off).
void hebiCommandSetIoPinInt(HebiCommandRef &command, HebiCommandIoPinBank bank, size_t pin_number, const int64_t *value)
void setFloat(size_t pinNumber, float value)
Sets the particular pin to a floating point value (representing a PWM output).
void set(float value)
Sets the field to a given value.
int64_t getInt(size_t pinNumber) const
If this numbered pin in this bank has an integer (e.g., digital) value, returns that value; otherwise...
Color get() const
Returns the current LED command.
HebiStatusCode boolGetter(const RefT &ref, MetadataT &metadata, int field, bool *value)
bool has() const
True if (and only if) the field has a value.
HebiCommandHighResAngleField
FlagField(HebiCommandRef &internal, HebiCommandFlagField field)
Command objects have various fields that can be set; when sent to the module, these fields control in...
void clear()
Removes any currently set value for this field.
FloatField(HebiCommandRef &internal, HebiCommandFloatField field)
void clear(size_t pinNumber)
Removes any currently set value for this pin.
void setInt(size_t pinNumber, int64_t value)
Sets the particular pin to a integer value (representing a digital output).
HebiStatusCode hebiCommandGetString(HebiCommandPtr command, HebiCommandStringField field, char *buffer, size_t *length)
Command API.
bool has(size_t fieldNumber) const
True if (and only if) the particular numbered subvalue of this field has a value.
Command(HebiCommandPtr)
Wraps an existing C-style object that is managed by its parent. NOTE: this should not be used except ...
void hebiCommandSetFlag(HebiCommandRef &command, HebiCommandFlagField field, int32_t value)
BoolField(HebiCommandRef &internal, HebiCommandBoolField field)
float get() const
If the field has a value, returns that value; otherwise, returns a default.
IoBank(HebiCommandRef &internal, HebiCommandIoPinBank bank)
HebiStatusCode intIoPinGetter(const RefT &ref, MetadataT &metadata, int index, size_t pin_number, int64_t *value)
float get(size_t fieldNumber) const
If the particular numbered subvalue of this field has a value, returns that value; otherwise returns ...
float getFloat(size_t pinNumber) const
If this numbered pin in this bank has an floating point (e.g., analog or PWM) value,...
bool has() const
Returns true if the LED command has been set, and false otherwise.
void set(const std::string &value)
Sets the field to a given value.
HebiStatusCode numberedFloatGetter(const RefT &ref, MetadataT &metadata, int field, size_t number, float *value)
bool has() const
Returns true if the flag is set, false if it is cleared.
void clear()
Removes any currently set value for this field.
void hebiCommandSetFloat(HebiCommandRef &command, HebiCommandFloatField field, const float *value)
HebiStatusCode floatIoPinGetter(const RefT &ref, MetadataT &metadata, int index, size_t pin_number, float *value)
bool hasFloat(size_t pinNumber) const
True if (and only if) the particular numbered pin in this bank has an floating point (e....
void set()
Sets this flag.
void set(const Color &color)
Commands a color that overrides the module's control of the LED (if the alpha channel is 255),...
LedField(HebiCommandRef &internal, HebiCommandLedField field)
hebi_cpp_api_ros
Author(s): Chris Bollinger
, Matthew Tesch
autogenerated on Fri Aug 2 2024 08:35:18