ros2_control - galactic
Loading...
Searching...
No Matches
controller_interface::ControllerInterface Class Referenceabstract
Inheritance diagram for controller_interface::ControllerInterface:
Collaboration diagram for controller_interface::ControllerInterface:

Public Member Functions

virtual CONTROLLER_INTERFACE_PUBLIC InterfaceConfiguration command_interface_configuration () const =0
virtual CONTROLLER_INTERFACE_PUBLIC InterfaceConfiguration state_interface_configuration () const =0
CONTROLLER_INTERFACE_PUBLIC void assign_interfaces (std::vector< hardware_interface::LoanedCommandInterface > &&command_interfaces, std::vector< hardware_interface::LoanedStateInterface > &&state_interfaces)
CONTROLLER_INTERFACE_PUBLIC void release_interfaces ()
virtual CONTROLLER_INTERFACE_PUBLIC LifecycleNodeInterface::CallbackReturn on_init ()=0
virtual CONTROLLER_INTERFACE_PUBLIC return_type init (const std::string &controller_name)
virtual CONTROLLER_INTERFACE_PUBLIC return_type update (const rclcpp::Time &time, const rclcpp::Duration &period)=0
CONTROLLER_INTERFACE_PUBLIC std::shared_ptr< rclcpp::Node > get_node ()
template<typename ParameterT>
auto auto_declare (const std::string &name, const ParameterT &default_value)
 Declare and initialize a parameter with a type.
CONTROLLER_INTERFACE_PUBLIC const rclcpp_lifecycle::State & configure ()
CONTROLLER_INTERFACE_PUBLIC const rclcpp_lifecycle::State & cleanup ()
CONTROLLER_INTERFACE_PUBLIC const rclcpp_lifecycle::State & deactivate ()
CONTROLLER_INTERFACE_PUBLIC const rclcpp_lifecycle::State & activate ()
CONTROLLER_INTERFACE_PUBLIC const rclcpp_lifecycle::State & shutdown ()
CONTROLLER_INTERFACE_PUBLIC const rclcpp_lifecycle::State & get_state () const
CONTROLLER_INTERFACE_PUBLIC unsigned int get_update_rate () const

Protected Attributes

std::vector< hardware_interface::LoanedCommandInterface > command_interfaces_
std::vector< hardware_interface::LoanedStateInterface > state_interfaces_
std::shared_ptr< rclcpp::Node > node_
rclcpp_lifecycle::State lifecycle_state_
unsigned int update_rate_ = 0

Member Function Documentation

◆ auto_declare()

template<typename ParameterT>
auto controller_interface::ControllerInterface::auto_declare ( const std::string & name,
const ParameterT & default_value )
inline

Declare and initialize a parameter with a type.

Wrapper function for templated node's declare_parameter() which checks if parameter is already declared. For use in all components that inherit from ControllerInterface

◆ command_interface_configuration()

◆ configure()

const rclcpp_lifecycle::State & controller_interface::ControllerInterface::configure ( )

The methods below are a substitute to the LifecycleNode methods with the same name. The Life cycle is shown in ROS2 design document: https://design.ros2.org/articles/node_lifecycle.html We cannot use a LifecycleNode because it would expose change-state services to the rest of the ROS system. Only the Controller Manager should have possibility to change state of a controller.

Hopefully in the future we can use a LifecycleNode where we disable modifications from the outside.

◆ state_interface_configuration()


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