ros2_control - jazzy
Loading...
Searching...
No Matches
hardware_interface::CommandInterface Class Reference
Inheritance diagram for hardware_interface::CommandInterface:
Collaboration diagram for hardware_interface::CommandInterface:

Public Types

using SharedPtr = std::shared_ptr<CommandInterface>

Public Member Functions

 CommandInterface (const InterfaceDescription &interface_description)
 CommandInterface (const CommandInterface &other)=delete
 CommandInterface copy constructor is actively deleted.
 CommandInterface (CommandInterface &&other)=default
void set_on_set_command_limiter (std::function< double(double, bool &)> on_set_command_limiter)
template<typename T>
bool set_limited_value (const T &value)
 A setter for the value of the command interface that triggers the limiter.
const bool & is_limited () const
void registerIntrospection () const
void unregisterIntrospection () const
 Handle (const std::string &prefix_name, const std::string &interface_name, double *value_ptr)
 Handle (const std::string &prefix_name, const std::string &interface_name, const std::string &data_type="double", const std::string &initial_value="")
 Handle (const InterfaceDescription &interface_description)
 Handle (const std::string &interface_name)
 Handle (const char *interface_name)
 Handle (const Handle &other) noexcept
 Handle (Handle &&other) noexcept
Public Member Functions inherited from hardware_interface::Handle
 Handle (const std::string &prefix_name, const std::string &interface_name, double *value_ptr)
 Handle (const std::string &prefix_name, const std::string &interface_name, const std::string &data_type="double", const std::string &initial_value="")
 Handle (const InterfaceDescription &interface_description)
 Handle (const std::string &interface_name)
 Handle (const char *interface_name)
 Handle (const Handle &other) noexcept
Handle & operator= (const Handle &other)
 Handle (Handle &&other) noexcept
Handle & operator= (Handle &&other)
 operator bool () const
 Returns true if handle references a value.
const std::string & get_name () const
const std::string & get_interface_name () const
const std::string & get_full_name () const
const std::string & get_prefix_name () const
double get_value () const
template<typename T = double>
std::optional< T > get_optional () const
 Get the value of the handle.
template<typename T = double>
std::optional< T > get_optional (std::shared_lock< std::shared_mutex > &lock) const
 Get the value of the handle.
template<typename T>
bool get_value (T &value) const
 Get the value of the handle.
template<typename T, typename = std::enable_if_t< !std::is_same_v<std::decay_t<T>, std::shared_lock<std::shared_mutex>>>>
bool get_value (T &value, bool wait_for_lock) const
 Get the value of the handle.
template<typename T>
bool set_value (const T &value, bool wait_for_lock)
 Set the value of the handle.
template<typename T>
bool set_value (const T &value)
 Set the value of the handle.
template<typename T>
bool set_value (std::unique_lock< std::shared_mutex > &lock, const T &value)
 Set the value of the handle.
std::shared_mutex & get_mutex () const
HandleDataType get_data_type () const
bool is_castable_to_double () const
 Returns true if the handle data type can be casted to double.
bool is_valid () const

Additional Inherited Members

Protected Member Functions inherited from hardware_interface::Handle
template<typename T>
bool get_value (std::shared_lock< std::shared_mutex > &lock, T &value) const
 Get the value of the handle.
Protected Attributes inherited from hardware_interface::Handle
std::string prefix_name_
std::string interface_name_
std::string handle_name_
HANDLE_DATATYPE value_ = std::monostate{}
HandleDataType data_type_ = HandleDataType::DOUBLE
double * value_ptr_ = nullptr
std::shared_mutex handle_mutex_

Constructor & Destructor Documentation

◆ CommandInterface()

hardware_interface::CommandInterface::CommandInterface ( const CommandInterface & other)
delete

CommandInterface copy constructor is actively deleted.

Command interfaces are having a unique ownership and thus can't be copied in order to avoid simultaneous writes to the same resource.

Member Function Documentation

◆ set_limited_value()

template<typename T>
bool hardware_interface::CommandInterface::set_limited_value ( const T & value)
inlinenodiscard

A setter for the value of the command interface that triggers the limiter.

Parameters
valueThe value to be set.
Returns
True if the value was set successfully, false otherwise.

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