RobWorkProject  23.9.11-
Public Types | Public Member Functions | List of all members
NullSpaceProjection Class Reference

Performs a projection in the null space of the device Jacobian to move joints away from singularities. More...

#include <NullSpaceProjection.hpp>

Public Types

enum  ProjectionFrame { BaseFrame = 0 , ControlFrame }
 Enumeration used to specify frame associated with the projection. More...
 

Public Member Functions

 NullSpaceProjection (rw::models::Device *device, rw::core::Ptr< rw::kinematics::Frame > controlFrame, const rw::kinematics::State &state, double dt)
 Construct NullSpaceProjection. More...
 
virtual ~NullSpaceProjection ()
 Destructor.
 
rw::math::Q solve (const rw::math::Q &q, const rw::math::Q &dqcurrent, const rw::math::Q &dq1)
 Solves to give a joint motion moving away from joint limits while satisfying the main task. More...
 
void setProjection (const Eigen::MatrixXd &P, ProjectionFrame space)
 Specifies an initial projection of the Jacobian before calculating the null-space. More...
 
void setThreshold (double threshold)
 Sets the threshold for the joint limits. More...
 
void setJointLimitsWeight (double w)
 Sets the weight of the joint limits. More...
 

Detailed Description

Performs a projection in the null space of the device Jacobian to move joints away from singularities.

Given a device with redundant degrees of freedom, the null space of the Jacobian can be used to move joints away from their limits. The problem of finding an optimal correction is formulated as a quadratic optimization problem in which joint position, velocity and acceleration limits are formulated as in the QP/XQP method.

The basic NullSpaceProjection assumes all 6 degrees of freedom of the tool needs to be constrainted.

Member Enumeration Documentation

◆ ProjectionFrame

Enumeration used to specify frame associated with the projection.

Enumerator
ControlFrame 

Robot Base Frame The Frame specified as the controlFrame

Constructor & Destructor Documentation

◆ NullSpaceProjection()

NullSpaceProjection ( rw::models::Device device,
rw::core::Ptr< rw::kinematics::Frame controlFrame,
const rw::kinematics::State state,
double  dt 
)

Construct NullSpaceProjection.

Parameters
device[in] Device to consider
controlFrame[in] Frame for which to calculate the Jacobian
state[in] State giving the assembly of the workcell
dt[in] Time step size

Member Function Documentation

◆ setJointLimitsWeight()

void setJointLimitsWeight ( double  w)

Sets the weight of the joint limits.

Parameters
w[in] Weight of the joint limit

◆ setProjection()

void setProjection ( const Eigen::MatrixXd &  P,
ProjectionFrame  space 
)

Specifies an initial projection of the Jacobian before calculating the null-space.

Given a projection matric \(P\) it is multiplied with the device Jacobian as $ \(P J\). This can be used to ignore degrees of freedom such as tool rool.

See also
XQPController::setProjection

Usage: Setup for system ignoring tool roll

XQPController* xqp = new XQPController(device, device->getEnd(), state, dt)
Eigen::Matrix<double,5,6 P;
for (int i = 0; i<5; i++)
P(i,i) = 1;
xqp->setProjection(P, XQPController::ControlFrame);
@ ControlFrame
Definition: XQPController.hpp:112
Parameters
P[in] The projection matrix
space[in] The space in which to apply the projection

◆ setThreshold()

void setThreshold ( double  threshold)

Sets the threshold for the joint limits.

Given an upper and a lower bound \(upper\) and \(lower\) the proximity of the joint limits is defined as \(upper-\tau (upper-lower)\) where \(\tau\) is the threshold specified here.

Parameters
threshold[in] Relative threshold for the joint limits

◆ solve()

rw::math::Q solve ( const rw::math::Q q,
const rw::math::Q dqcurrent,
const rw::math::Q dq1 
)

Solves to give a joint motion moving away from joint limits while satisfying the main task.

Usage:

NullSpaceProjection nps(device, device->getEnd(), state);
...
...
\\input Current configuration q, current velocity dq and desired new velocity dq1
Q qns = nps.solve(q, dq, dq1);
dq = dq1+qns;
NullSpaceProjection(rw::models::Device *device, rw::core::Ptr< rw::kinematics::Frame > controlFrame, const rw::kinematics::State &state, double dt)
Construct NullSpaceProjection.
Parameters
q[in] Configuration of the device
dqcurrent[in] The current velocity
dq1[in] The new velocity calculated e.g. by the XQPController

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