17#ifndef JOINT_LIMITS__JOINT_LIMITS_HELPERS_HPP_
18#define JOINT_LIMITS__JOINT_LIMITS_HELPERS_HPP_
23#include "joint_limits/data_structures.hpp"
24#include "joint_limits/joint_limits.hpp"
30constexpr double POSITION_BOUNDS_TOLERANCE = 0.002;
32constexpr double OUT_OF_BOUNDS_EXCEPTION_TOLERANCE = 0.0087;
41 const JointControlInterfacesData & desired, JointControlInterfacesData & prev_command);
50bool is_limited(
double value,
double min,
double max);
64 const std::optional<double> & act_vel,
const std::optional<double> & act_pos,
65 const std::optional<double> & prev_command_pos,
double dt);
78 const double & desired_vel,
const std::optional<double> & act_pos,
79 const std::optional<double> & prev_command_vel,
double dt);
91 const std::optional<double> & act_vel,
double );
102 const JointLimits & limits,
double desired_acceleration, std::optional<double> actual_velocity);
Definition data_structures.hpp:39
PositionLimits compute_position_limits(const std::string &joint_name, const joint_limits::JointLimits &limits, const std::optional< double > &act_vel, const std::optional< double > &act_pos, const std::optional< double > &prev_command_pos, double dt)
Computes the position limits based on the velocity and acceleration limits.
Definition joint_limits_helpers.cpp:103
VelocityLimits compute_velocity_limits(const std::string &joint_name, const joint_limits::JointLimits &limits, const double &desired_vel, const std::optional< double > &act_pos, const std::optional< double > &prev_command_vel, double dt)
Computes the velocity limits based on the position and acceleration limits.
Definition joint_limits_helpers.cpp:133
EffortLimits compute_effort_limits(const joint_limits::JointLimits &limits, const std::optional< double > &act_pos, const std::optional< double > &act_vel, double)
Computes the effort limits based on the position and velocity limits.
Definition joint_limits_helpers.cpp:192
bool is_limited(double value, double min, double max)
Checks if a value is limited by the given limits.
Definition joint_limits_helpers.cpp:101
AccelerationLimits compute_acceleration_limits(const JointLimits &limits, double desired_acceleration, std::optional< double > actual_velocity)
Computes the acceleration limits based on the change in velocity and acceleration and deceleration li...
Definition joint_limits_helpers.cpp:225
void update_prev_command(const JointControlInterfacesData &desired, JointControlInterfacesData &prev_command)
Updates the previous command with the desired command.
Definition joint_limits_helpers.cpp:75
Definition joint_limits.hpp:35