Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
franka_example_controllers::JointWall Class Reference

A class that offers an implementation of a virtual wall for a single joint. More...

#include <joint_wall.h>

Public Member Functions

double computeTorque (double q, double dq)
 Computes the torque with given q and dq. More...
 
 JointWall ()=delete
 Creates a JointWall instance with default params. More...
 
 JointWall (double soft_upper_joint_position_limit, double soft_lower_joint_position_limit, double PD_zone_width, double D_zone_width, double PD_zone_stiffness, double PD_zone_damping, double D_zone_damping)
 Creates a JointWall instance with configurable parameters. More...
 
void reset ()
 Resets the initialized flag to false. More...
 

Private Types

enum  MotionInWall {
  MotionInWall::EnteringNormal, MotionInWall::PenetratingLowerLimit, MotionInWall::LeavingLowerLimit, MotionInWall::PenetratingUpperLimit,
  MotionInWall::LeavingUpperLimit
}
 Indicates the status of moving wall, which occurs after initializing the state inside a wall. More...
 

Private Member Functions

void adjustMovingWall (double q, double dq)
 Moves the wall with given state if the state is initialized inside the wall. More...
 
MotionInWall getMotionInWall (double q, double dq) const
 Checks the motion type in joint wall. More...
 
void init (double q, double dq)
 Initializes the joint wall computation with initial states. More...
 

Static Private Member Functions

static bool inRange (double low, double high, double x)
 Checks if x is in range [low, high]. More...
 
static double positiveCheck (double value)
 Check if the input is positive number, if not print error and return its abs. More...
 

Private Attributes

double D_zone_damping_ {0}
 
double D_zone_width_ {0}
 
bool initialized_ {false}
 
bool moving_wall_ {false}
 
double PD_zone_damping_ {0}
 
double PD_zone_stiffness_ {0}
 
double PD_zone_width_ {0}
 
double soft_lower_joint_position_limit_ {0}
 
double soft_upper_joint_position_limit_ {0}
 
double zone_width_scale_ {1}
 

Detailed Description

A class that offers an implementation of a virtual wall for a single joint.

Definition at line 22 of file joint_wall.h.

Member Enumeration Documentation

◆ MotionInWall

Indicates the status of moving wall, which occurs after initializing the state inside a wall.

Enumerator
EnteringNormal 
PenetratingLowerLimit 
LeavingLowerLimit 
PenetratingUpperLimit 
LeavingUpperLimit 

Definition at line 68 of file joint_wall.h.

Constructor & Destructor Documentation

◆ JointWall() [1/2]

franka_example_controllers::JointWall::JointWall ( )
delete

Creates a JointWall instance with default params.

◆ JointWall() [2/2]

franka_example_controllers::JointWall::JointWall ( double  soft_upper_joint_position_limit,
double  soft_lower_joint_position_limit,
double  PD_zone_width,
double  D_zone_width,
double  PD_zone_stiffness,
double  PD_zone_damping,
double  D_zone_damping 
)

Creates a JointWall instance with configurable parameters.

Parameters
[in]soft_upper_joint_position_limit(rad)
[in]soft_lower_joint_position_limit(rad)
[in]PD_zone_width(meter)
[in]D_zone_width(meter)
[in]PD_zone_stiffness(N*meter/rad)
[in]PD_zone_damping(N*meter*s/rad)
[in]D_zone_damping(N*meter*s/rad)

Definition at line 12 of file joint_wall.cpp.

Member Function Documentation

◆ adjustMovingWall()

void franka_example_controllers::JointWall::adjustMovingWall ( double  q,
double  dq 
)
private

Moves the wall with given state if the state is initialized inside the wall.

Parameters
[in]qthe current joint position.
[in]dqthe current joint velocity.

Definition at line 102 of file joint_wall.cpp.

◆ computeTorque()

double franka_example_controllers::JointWall::computeTorque ( double  q,
double  dq 
)

Computes the torque with given q and dq.

Be aware that the torque is also affected by previous states.

Parameters
[in]qcurrent joint position.
[in]dqthe current joint velocity.
Returns
the resulting torque

Definition at line 33 of file joint_wall.cpp.

◆ getMotionInWall()

JointWall::MotionInWall franka_example_controllers::JointWall::getMotionInWall ( double  q,
double  dq 
) const
private

Checks the motion type in joint wall.

Parameters
[in]qthe current joint position.
[in]dqthe current joint velocity.

Definition at line 135 of file joint_wall.cpp.

◆ init()

void franka_example_controllers::JointWall::init ( double  q,
double  dq 
)
private

Initializes the joint wall computation with initial states.

Parameters
[in]qthe current joint position.
[in]dqthe current joint velocity.

Definition at line 70 of file joint_wall.cpp.

◆ inRange()

bool franka_example_controllers::JointWall::inRange ( double  low,
double  high,
double  x 
)
staticprivate

Checks if x is in range [low, high].

Parameters
[in]lowlower limit of the range.
[in]highupper limit of the range.
[in]xvalue to check.
Returns
true if in range, false otherwise.

Definition at line 66 of file joint_wall.cpp.

◆ positiveCheck()

double franka_example_controllers::JointWall::positiveCheck ( double  value)
staticprivate

Check if the input is positive number, if not print error and return its abs.

Parameters
[in]valueThe value to check.
Returns
the absolute value of the value.

Definition at line 126 of file joint_wall.cpp.

◆ reset()

void franka_example_controllers::JointWall::reset ( )

Resets the initialized flag to false.

After calling reset, the next call to computeTorque resets the internal states for joint position and velocity (q, dq). Call this method before restarting your controller, e.g. when the position might have changed during control pauses due to guiding.

Definition at line 62 of file joint_wall.cpp.

Member Data Documentation

◆ D_zone_damping_

double franka_example_controllers::JointWall::D_zone_damping_ {0}
private

Definition at line 83 of file joint_wall.h.

◆ D_zone_width_

double franka_example_controllers::JointWall::D_zone_width_ {0}
private

Definition at line 80 of file joint_wall.h.

◆ initialized_

bool franka_example_controllers::JointWall::initialized_ {false}
private

Definition at line 85 of file joint_wall.h.

◆ moving_wall_

bool franka_example_controllers::JointWall::moving_wall_ {false}
private

Definition at line 90 of file joint_wall.h.

◆ PD_zone_damping_

double franka_example_controllers::JointWall::PD_zone_damping_ {0}
private

Definition at line 82 of file joint_wall.h.

◆ PD_zone_stiffness_

double franka_example_controllers::JointWall::PD_zone_stiffness_ {0}
private

Definition at line 81 of file joint_wall.h.

◆ PD_zone_width_

double franka_example_controllers::JointWall::PD_zone_width_ {0}
private

Definition at line 79 of file joint_wall.h.

◆ soft_lower_joint_position_limit_

double franka_example_controllers::JointWall::soft_lower_joint_position_limit_ {0}
private

Definition at line 78 of file joint_wall.h.

◆ soft_upper_joint_position_limit_

double franka_example_controllers::JointWall::soft_upper_joint_position_limit_ {0}
private

Definition at line 77 of file joint_wall.h.

◆ zone_width_scale_

double franka_example_controllers::JointWall::zone_width_scale_ {1}
private

Definition at line 92 of file joint_wall.h.


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


franka_example_controllers
Author(s): Franka Emika GmbH
autogenerated on Mon Sep 19 2022 03:06:01