13 const double soft_lower_joint_position_limit,
14 const double PD_zone_width,
15 const double D_zone_width,
16 const double PD_zone_stiffness,
17 const double PD_zone_damping,
18 const double D_zone_damping)
19 : soft_upper_joint_position_limit_(soft_upper_joint_position_limit),
20 soft_lower_joint_position_limit_(soft_lower_joint_position_limit),
21 PD_zone_width_(PD_zone_width),
22 D_zone_width_(D_zone_width),
23 PD_zone_stiffness_(PD_zone_stiffness),
24 PD_zone_damping_(PD_zone_damping),
25 D_zone_damping_(D_zone_damping) {
37 double D_zone_boundary_max =
39 double PD_zone_boundary_max =
41 double D_zone_boundary_min =
43 double PD_zone_boundary_min =
47 if (
inRange(D_zone_boundary_max, PD_zone_boundary_max, q) ||
48 inRange(PD_zone_boundary_min, D_zone_boundary_min, q)) {
51 }
else if (q > PD_zone_boundary_max) {
54 }
else if (q < PD_zone_boundary_min) {
67 return (low <= x && x <= high);
78 << soft_upper_joint_position_limit_ <<
"]";
79 throw std::runtime_error(ss.str().c_str());
129 1,
"JointWall expects positive parameters, but got negative. Using its absolute value.");
136 double D_zone_boundary_max =
138 double D_zone_boundary_min =
140 if (q < D_zone_boundary_min) {
146 if (q > D_zone_boundary_max) {
MotionInWall getMotionInWall(double q, double dq) const
Checks the motion type in joint wall.
double PD_zone_stiffness_
void reset()
Resets the initialized flag to false.
static bool inRange(double low, double high, double x)
Checks if x is in range [low, high].
#define ROS_WARN_THROTTLE(period,...)
void adjustMovingWall(double q, double dq)
Moves the wall with given state if the state is initialized inside the wall.
Contains functions for calculating torques generated by virtual walls.
double computeTorque(double q, double dq)
Computes the torque with given q and dq.
double soft_upper_joint_position_limit_
MotionInWall
Indicates the status of moving wall, which occurs after initializing the state inside a wall...
static double positiveCheck(double value)
Check if the input is positive number, if not print error and return its abs.
double soft_lower_joint_position_limit_
void init(double q, double dq)
Initializes the joint wall computation with initial states.
JointWall()=delete
Creates a JointWall instance with default params.