ros2_control - galactic
Loading...
Searching...
No Matches
joint_limits_interface::PositionJointSoftLimitsHandle Class Reference

A handle used to enforce position and velocity limits of a position-controlled joint. More...

#include <joint_limits_interface.hpp>

Inheritance diagram for joint_limits_interface::PositionJointSoftLimitsHandle:
Collaboration diagram for joint_limits_interface::PositionJointSoftLimitsHandle:

Public Member Functions

 PositionJointSoftLimitsHandle (const hardware_interface::JointHandle &jposh, const hardware_interface::JointHandle &jcmdh, const joint_limits_interface::JointLimits &limits, const joint_limits_interface::SoftJointLimits &soft_limits)
void enforce_limits (const rclcpp::Duration &period) override
 Enforce position and velocity limits for a joint subject to soft limits.
Public Member Functions inherited from joint_limits_interface::JointSoftLimitsHandle
 JointSoftLimitsHandle (const hardware_interface::JointHandle &jposh, const hardware_interface::JointHandle &jcmdh, const JointLimits &limits, const SoftJointLimits &soft_limits)
 JointSoftLimitsHandle (const hardware_interface::JointHandle &jposh, const hardware_interface::JointHandle &jvelh, const hardware_interface::JointHandle &jcmdh, const JointLimits &limits, const SoftJointLimits &soft_limits)
Public Member Functions inherited from joint_limits_interface::JointLimitHandle
 JointLimitHandle (const hardware_interface::JointHandle &jposh, const hardware_interface::JointHandle &jcmdh, const JointLimits &limits)
 JointLimitHandle (const hardware_interface::JointHandle &jposh, const hardware_interface::JointHandle &jvelh, const hardware_interface::JointHandle &jcmdh, const JointLimits &limits)
std::string get_name () const
virtual void reset ()
 Clear stored state, causing it to reset next iteration.

Additional Inherited Members

Protected Member Functions inherited from joint_limits_interface::JointLimitHandle
double get_velocity (const rclcpp::Duration &period) const
 Return velocity for limit calculations.
Protected Attributes inherited from joint_limits_interface::JointSoftLimitsHandle
joint_limits_interface::SoftJointLimits soft_limits_
Protected Attributes inherited from joint_limits_interface::JointLimitHandle
hardware_interface::JointHandle jposh_
hardware_interface::JointHandle jvelh_
hardware_interface::JointHandle jcmdh_
joint_limits_interface::JointLimits limits_
double prev_pos_
double prev_vel_

Detailed Description

A handle used to enforce position and velocity limits of a position-controlled joint.

This class implements a very simple position and velocity limits enforcing policy, and tries to impose the least amount of requisites on the underlying hardware platform. This lowers considerably the entry barrier to use it, but also implies some limitations.

Requisites

  • Position (for non-continuous joints) and velocity limits specification.
  • Soft limits specification. The k_velocity parameter is not used.

Open loop nature

Joint position and velocity limits are enforced in an open-loop fashion, that is, the command is checked for validity without relying on the actual position/velocity values.

  • Actual position values are not used because in some platforms there might be a substantial lag between sending a command and executing it (propagate command to hardware, reach control objective, read from hardware).
  • Actual velocity values are not used because of the above reason, and because some platforms might not expose trustworthy velocity measurements, or none at all.

The downside of the open loop behavior is that velocity limits will not be enforced when recovering from large position tracking errors. Only the command is guaranteed to comply with the limits specification.

Note
: This handle type is stateful, ie. it stores the previous position command to estimate the command velocity.

Member Function Documentation

◆ enforce_limits()

void joint_limits_interface::PositionJointSoftLimitsHandle::enforce_limits ( const rclcpp::Duration & period)
inlineoverridevirtual

Enforce position and velocity limits for a joint subject to soft limits.

If the joint has no position limits (eg. a continuous joint), only velocity limits will be enforced.

Parameters
[in]periodControl period.

Implements joint_limits_interface::JointLimitHandle.


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