Struct JointState¶
Defined in File messages.hpp
Struct Documentation¶
-
struct JointState¶
The state of a single joint (revolute or prismatic).
Public Functions
-
FoxgloveError encode(uint8_t *ptr, size_t len, size_t *encoded_len)¶
Encoded the JointState as protobuf to the provided buffer.
On success, writes the serialized length to *encoded_len. If the provided buffer has insufficient capacity, writes the required capacity to *encoded_len and returns FoxgloveError::BufferTooShort. If the message cannot be encoded, writes the reason to stderr and returns FoxgloveError::EncodeError.
- Parameters:
ptr – the destination buffer. must point to at least len valid bytes.
len – the length of the destination buffer.
encoded_len – where the serialized length or required capacity will be written to.
Public Members
-
std::string name¶
Joint name.
-
std::optional<double> position = std::nullopt¶
Joint position. Radians for revolute joints, meters for prismatic joints.
-
std::optional<double> velocity = std::nullopt¶
Joint velocity. Rad/s for revolute joints, m/s for prismatic joints.
-
std::optional<double> acceleration = std::nullopt¶
Joint acceleration. Rad/s² for revolute joints, m/s² for prismatic joints.
-
std::optional<double> effort = std::nullopt¶
Joint effort (force or torque). Nm for revolute joints, N for prismatic joints.
Public Static Functions
-
static Schema schema()¶
Get the JointState schema.
The schema data returned is statically allocated.
-
FoxgloveError encode(uint8_t *ptr, size_t len, size_t *encoded_len)¶