![]() |
RobWorkProject
23.9.11-
|
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... | |
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.
enum ProjectionFrame |
NullSpaceProjection | ( | rw::models::Device * | device, |
rw::core::Ptr< rw::kinematics::Frame > | controlFrame, | ||
const rw::kinematics::State & | state, | ||
double | dt | ||
) |
Construct NullSpaceProjection.
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 |
void setJointLimitsWeight | ( | double | w | ) |
Sets the weight of the joint limits.
w | [in] Weight of the joint limit |
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.
Usage: Setup for system ignoring tool roll
P | [in] The projection matrix |
space | [in] The space in which to apply the projection |
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.
threshold | [in] Relative threshold for the joint limits |
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:
q | [in] Configuration of the device |
dqcurrent | [in] The current velocity |
dq1 | [in] The new velocity calculated e.g. by the XQPController |