ros2_control - rolling
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
joint_limits::JointLimiterInterface< JointLimitsStateDataType > Class Template Referenceabstract
Inheritance diagram for joint_limits::JointLimiterInterface< JointLimitsStateDataType >:
Inheritance graph
[legend]

Public Member Functions

virtual bool init (const std::vector< std::string > &joint_names, const rclcpp::node_interfaces::NodeParametersInterface::SharedPtr &param_itf, const rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr &logging_itf, const std::string &robot_description_topic="/robot_description")
 Initialize every JointLimiter.
 
virtual bool init (const std::vector< std::string > &joint_names, const std::vector< joint_limits::JointLimits > &joint_limits, const std::vector< joint_limits::SoftJointLimits > &soft_joint_limits, const rclcpp::node_interfaces::NodeParametersInterface::SharedPtr &param_itf, const rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr &logging_itf)
 Initialize joints from directly provided names and limits.
 
virtual bool init (const std::vector< std::string > &joint_names, const rclcpp::Node::SharedPtr &node, const std::string &robot_description_topic="/robot_description")
 Initialize joints using a Node pointer.
 
virtual bool init (const std::vector< std::string > &joint_names, const rclcpp_lifecycle::LifecycleNode::SharedPtr &lifecycle_node, const std::string &robot_description_topic="/robot_description")
 Initialize joints using a LifecycleNode pointer.
 
virtual bool configure (const JointLimitsStateDataType &current_joint_states)
 
virtual bool enforce (const JointLimitsStateDataType &current_joint_states, JointLimitsStateDataType &desired_joint_states, const rclcpp::Duration &dt)
 Enforce joint limits to desired joint state for multiple physical quantities.
 
virtual void reset_internals ()=0
 

Protected Member Functions

virtual bool on_init ()=0
 Initialize the limiter's internal states and libraries.
 
virtual bool on_configure (const JointLimitsStateDataType &current_joint_states)=0
 Configure the limiter's internal states and libraries.
 
virtual bool on_enforce (const JointLimitsStateDataType &current_joint_states, JointLimitsStateDataType &desired_joint_states, const rclcpp::Duration &dt)=0
 Enforce joint limits for multiple dependent physical quantities.
 
bool has_logging_interface () const
 Checks if the logging interface is set.
 
bool has_parameter_interface () const
 Checks if the parameter interface is set.
 

Protected Attributes

size_t number_of_joints_
 
std::vector< std::string > joint_names_
 
std::vector< joint_limits::JointLimitsjoint_limits_
 
std::vector< joint_limits::SoftJointLimitssoft_joint_limits_
 
rclcpp::node_interfaces::NodeParametersInterface::SharedPtr node_param_itf_
 
rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr node_logging_itf_
 

Member Function Documentation

◆ enforce()

template<typename JointLimitsStateDataType >
virtual bool joint_limits::JointLimiterInterface< JointLimitsStateDataType >::enforce ( const JointLimitsStateDataType &  current_joint_states,
JointLimitsStateDataType &  desired_joint_states,
const rclcpp::Duration &  dt 
)
inlinevirtual

Enforce joint limits to desired joint state for multiple physical quantities.

Generic enforce method that calls implementation-specific on_enforce method.

Parameters
[in]current_joint_statescurrent joint states a robot is in.
[in,out]desired_joint_statesjoint state that should be adjusted to obey the limits.
[in]dttime delta to calculate missing integrals and derivation in joint limits.
Returns
true if limits are enforced, otherwise false.

◆ has_logging_interface()

template<typename JointLimitsStateDataType >
bool joint_limits::JointLimiterInterface< JointLimitsStateDataType >::has_logging_interface ( ) const
inlineprotected

Checks if the logging interface is set.

Returns
true if the logging interface is available, otherwise false.
Note
this way of interfacing would be useful for instances where the logging interface is not available, for example in the ResourceManager or ResourceStorage classes.

◆ has_parameter_interface()

template<typename JointLimitsStateDataType >
bool joint_limits::JointLimiterInterface< JointLimitsStateDataType >::has_parameter_interface ( ) const
inlineprotected

Checks if the parameter interface is set.

Returns
true if the parameter interface is available, otherwise false.
Note
this way of interfacing would be useful for instances where the logging interface is not available, for example in the ResourceManager or ResourceStorage classes.

◆ init() [1/3]

template<typename JointLimitsStateDataType >
virtual bool joint_limits::JointLimiterInterface< JointLimitsStateDataType >::init ( const std::vector< std::string > &  joint_names,
const rclcpp::Node::SharedPtr &  node,
const std::string &  robot_description_topic = "/robot_description" 
)
inlinevirtual

Initialize joints using a Node pointer.

For details see other init method.

◆ init() [2/3]

template<typename JointLimitsStateDataType >
virtual bool joint_limits::JointLimiterInterface< JointLimitsStateDataType >::init ( const std::vector< std::string > &  joint_names,
const rclcpp::node_interfaces::NodeParametersInterface::SharedPtr &  param_itf,
const rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr &  logging_itf,
const std::string &  robot_description_topic = "/robot_description" 
)
inlinevirtual

Initialize every JointLimiter.

Initialization of JointLimiter for defined joints with their names. Robot description topic provides a topic name where URDF of the robot can be found. This is needed to use joint limits from URDF (not implemented yet!). Override this method only if initialization and reading joint limits should be adapted. Otherwise, initialize your custom limiter in on_init method.

Parameters
[in]joint_namesnames of joints where limits should be applied.
[in]param_itfnode parameters interface object to access parameters.
[in]logging_itfnode logging interface to log if error happens.
[in]robot_description_topicstring of a topic where robot description is accessible.

◆ init() [3/3]

template<typename JointLimitsStateDataType >
virtual bool joint_limits::JointLimiterInterface< JointLimitsStateDataType >::init ( const std::vector< std::string > &  joint_names,
const rclcpp_lifecycle::LifecycleNode::SharedPtr &  lifecycle_node,
const std::string &  robot_description_topic = "/robot_description" 
)
inlinevirtual

Initialize joints using a LifecycleNode pointer.

For details see other init method.

◆ on_configure()

template<typename JointLimitsStateDataType >
virtual bool joint_limits::JointLimiterInterface< JointLimitsStateDataType >::on_configure ( const JointLimitsStateDataType &  current_joint_states)
protectedpure virtual

Configure the limiter's internal states and libraries.

Implementation-specific configuration of limiter's internal states and libraries.

Returns
true if initialization was successful, otherwise false.

Implemented in joint_limits::JointSaturationLimiter< JointLimitsStateDataType >.

◆ on_enforce()

template<typename JointLimitsStateDataType >
virtual bool joint_limits::JointLimiterInterface< JointLimitsStateDataType >::on_enforce ( const JointLimitsStateDataType &  current_joint_states,
JointLimitsStateDataType &  desired_joint_states,
const rclcpp::Duration &  dt 
)
protectedpure virtual

Enforce joint limits for multiple dependent physical quantities.

Filter-specific implementation of the joint limits enforce algorithm for multiple dependent physical quantities.

Parameters
[in]current_joint_statescurrent joint states a robot is in.
[in,out]desired_joint_statesjoint state that should be adjusted to obey the limits.
[in]dttime delta to calculate missing integrals and derivation in joint limits.
Returns
true if limits are enforced, otherwise false.

Implemented in joint_limits::JointSaturationLimiter< JointLimitsStateDataType >.

◆ on_init()

template<typename JointLimitsStateDataType >
virtual bool joint_limits::JointLimiterInterface< JointLimitsStateDataType >::on_init ( )
protectedpure virtual

◆ reset_internals()

template<typename JointLimitsStateDataType >
virtual void joint_limits::JointLimiterInterface< JointLimitsStateDataType >::reset_internals ( )
pure virtual

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