staubli_driver_ros2 main
ROS2 control driver for Staubli robots
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
staubli_robot_driver::RobotCommandMessage Class Reference

Robot command message. More...

#include <messages.hpp>

Inheritance diagram for staubli_robot_driver::RobotCommandMessage:
[legend]
Collaboration diagram for staubli_robot_driver::RobotCommandMessage:
[legend]

Public Member Functions

 RobotCommandMessage ()
 
 ~RobotCommandMessage ()=default
 
bool serialize (uint8_t *buffer, size_t buffer_size) const override
 Serialize message to bytes.
 
bool deserialize (uint8_t *buffer, size_t buffer_size) override
 Deserialize bytes to message.
 
size_t get_serialized_size () const override
 Size of the entire message in bytes.
 
virtual bool serialize (uint8_t *buffer, size_t buffer_size) const=0
 Serialize message to bytes.
 
bool serialize (std::vector< uint8_t > &data) const
 Serialize message to vector.
 
virtual bool deserialize (uint8_t *buffer, size_t buffer_size)=0
 Deserialize bytes to message.
 
bool deserialize (std::vector< uint8_t > &data)
 Deserialize message from vector.
 
- Public Member Functions inherited from staubli_robot_driver::Message
 Message ()=default
 
virtual ~Message ()=default
 
bool serialize (std::vector< uint8_t > &data) const
 Serialize message to vector.
 
bool deserialize (std::vector< uint8_t > &data)
 Deserialize message from vector.
 

Static Public Member Functions

static size_t message_size ()
 Get the size of the message, static version.
 

Public Attributes

CommandType command_type = CommandType::STOP
 
double controller_period = -1.0
 
std::array< double, 6 > command_reference
 Command reference for the robot.
 
std::array< bool, 16 > digital_outputs
 
std::array< double, 4 > analog_outputs
 
- Public Attributes inherited from staubli_robot_driver::Message
FrameHeader header
 Message header.
 
rclcpp::Time reception_timestamp = rclcpp::Time(0)
 Timestamp of the message reception (local clock)
 

Detailed Description

Robot command message.

Constructor & Destructor Documentation

◆ RobotCommandMessage()

staubli_robot_driver::RobotCommandMessage::RobotCommandMessage ( )

◆ ~RobotCommandMessage()

staubli_robot_driver::RobotCommandMessage::~RobotCommandMessage ( )
default

Member Function Documentation

◆ serialize() [1/3]

bool staubli_robot_driver::RobotCommandMessage::serialize ( uint8_t buffer,
size_t  buffer_size 
) const
overridevirtual

Serialize message to bytes.

Implements staubli_robot_driver::Message.

◆ deserialize() [1/3]

bool staubli_robot_driver::RobotCommandMessage::deserialize ( uint8_t buffer,
size_t  buffer_size 
)
overridevirtual

Deserialize bytes to message.

Implements staubli_robot_driver::Message.

◆ message_size()

static size_t staubli_robot_driver::RobotCommandMessage::message_size ( )
static

Get the size of the message, static version.

◆ get_serialized_size()

size_t staubli_robot_driver::RobotCommandMessage::get_serialized_size ( ) const
inlineoverridevirtual

Size of the entire message in bytes.

Implements staubli_robot_driver::Message.

◆ serialize() [2/3]

virtual bool staubli_robot_driver::Message::serialize ( uint8_t buffer,
size_t  buffer_size 
) const
virtual

Serialize message to bytes.

Implements staubli_robot_driver::Message.

◆ serialize() [3/3]

bool staubli_robot_driver::Message::serialize ( std::vector< uint8_t > &  data) const

Serialize message to vector.

Warning
This method modifies the input vector by resizing it to the size of the message.
Parameters
dataOutput data buffer. Capacity must be at least message.get_serialized_size().
Returns
true if serialization was successful, false otherwise

◆ deserialize() [2/3]

virtual bool staubli_robot_driver::Message::deserialize ( uint8_t buffer,
size_t  buffer_size 
)
virtual

Deserialize bytes to message.

Implements staubli_robot_driver::Message.

◆ deserialize() [3/3]

bool staubli_robot_driver::Message::deserialize ( std::vector< uint8_t > &  data)

Deserialize message from vector.

Warning
The input vector must be at least the size of the message.
Parameters
dataInput data buffer
Returns
true if deserialization was successful, false otherwise

Member Data Documentation

◆ command_type

CommandType staubli_robot_driver::RobotCommandMessage::command_type = CommandType::STOP

◆ controller_period

double staubli_robot_driver::RobotCommandMessage::controller_period = -1.0

◆ command_reference

std::array<double, 6> staubli_robot_driver::RobotCommandMessage::command_reference

Command reference for the robot.

This array contains the target values for the robot's joints. The interpretation of these values depends on the command type:

  • JOINT_POSITION: Target joint positions in radians
  • JOINT_VELOCITY: Target joint velocities in radians/s
  • JOINT_TORQUE: Target joint torques in Nm
  • STOP: Ignored, should be filled with zeros

◆ digital_outputs

std::array<bool, 16> staubli_robot_driver::RobotCommandMessage::digital_outputs

◆ analog_outputs

std::array<double, 4> staubli_robot_driver::RobotCommandMessage::analog_outputs

The documentation for this class was generated from the following file: