Loading [MathJax]/extensions/tex2jax.js
ros2_control - rolling
All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Public Member Functions | List of all members
semantic_components::LedRgbDevice Class Reference
Inheritance diagram for semantic_components::LedRgbDevice:
Inheritance graph
[legend]
Collaboration diagram for semantic_components::LedRgbDevice:
Collaboration graph
[legend]

Public Member Functions

 LedRgbDevice (const std::string &name, const std::string &interface_r, const std::string &interface_g, const std::string &interface_b)
 
bool set_values_from_message (const std_msgs::msg::ColorRGBA &message) override
 Set LED states from ColorRGBA message.
 
- Public Member Functions inherited from semantic_components::SemanticComponentCommandInterface< std_msgs::msg::ColorRGBA >
 SemanticComponentCommandInterface (const std::string &name, const std::vector< std::string > &interface_names)
 
bool assign_loaned_command_interfaces (std::vector< hardware_interface::LoanedCommandInterface > &command_interfaces)
 Assign loaned command interfaces from the hardware.
 
void release_interfaces ()
 Release loaned command interfaces from the hardware.
 
const std::vector< std::string > & get_command_interface_names () const
 Definition of command interface names for the component.
 
bool set_values (const std::vector< double > &values)
 Return all values.
 

Additional Inherited Members

- Protected Attributes inherited from semantic_components::SemanticComponentCommandInterface< std_msgs::msg::ColorRGBA >
std::string name_
 
std::vector< std::string > interface_names_
 
std::vector< std::reference_wrapper< hardware_interface::LoanedCommandInterface > > command_interfaces_
 

Constructor & Destructor Documentation

◆ LedRgbDevice()

semantic_components::LedRgbDevice::LedRgbDevice ( const std::string &  name,
const std::string &  interface_r,
const std::string &  interface_g,
const std::string &  interface_b 
)
inlineexplicit

Constructor for a LED RGB device with interface names set based on device name. The constructor sets the command interface names to "<name>/interface_r", "<name>/interface_g", "<name>/interface_b".

Parameters
[in]namename of the LED device, used as a prefix for the command interface names
[in]interface_rname of the command interface for the red channel
[in]interface_gname of the command interface for the green channel
[in]interface_bname of the command interface for the blue channel

Member Function Documentation

◆ set_values_from_message()

bool semantic_components::LedRgbDevice::set_values_from_message ( const std_msgs::msg::ColorRGBA &  message)
inlineoverridevirtual

Set LED states from ColorRGBA message.

Set the values of the LED RGB device from a ColorRGBA message.

Sets the values of the red, green, and blue channels from the message. If any of the values are out of the range [0, 1], the function fails and returns false.

Parameters
[in]messageColorRGBA message
Returns
true if all values were set, false otherwise

Implements semantic_components::SemanticComponentCommandInterface< std_msgs::msg::ColorRGBA >.


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