#include <FalconKinematicStamper.h>
|
| FalconKinematicStamper (bool init_now=true) |
|
| ~FalconKinematicStamper () |
|
void | initialize () |
|
virtual bool | getForces (const std::array< double, 3 >(&position), const std::array< double, 3 >(&cart_force), std::array< int, 3 >(&enc_force)) |
|
virtual bool | getAngles (std::array< double, 3 >(&position), std::array< double, 3 >(&angles)) |
|
virtual bool | getPosition (std::array< int, 3 >(&angles), std::array< double, 3 >(&position)) |
|
virtual void | getWorkspaceOrigin (std::array< double, 3 >(&origin)) |
|
void | FK (const gmtl::Vec3d &theta0, gmtl::Vec3d &pos) |
|
gmtl::Matrix33d | jacobian (const StamperKinematicImpl::Angle &angles) |
|
void | IK (StamperKinematicImpl::Angle &angles, const gmtl::Vec3d &worldPosition) |
|
| FalconKinematic () |
|
virtual | ~FalconKinematic () |
|
double | getTheta (int encoder_value) |
|
| FalconCore () |
|
virtual | ~FalconCore () |
|
int | getErrorCode () |
|
This class is an implementation of the kinematics for a haptic device similar to the Novint Falcon, created by RL Stamper in his PhD Thesis. The thesis is available at
http://docs.nonpolynomial.com/libnifalcon/pdf/StamperThesis.pdf
This implementation was written by Alastair Barrow. The original code is available in the barrow_mechanics example.
libnifalcon::FalconKinematicStamper::FalconKinematicStamper |
( |
bool |
init_now = true | ) |
|
Constructor.
- Parameters
-
init_now | If true, runs initialize() function on construction (can block). Defaults to true. |
- Returns
libnifalcon::FalconKinematicStamper::~FalconKinematicStamper |
( |
| ) |
|
|
inline |
void libnifalcon::FalconKinematicStamper::FK |
( |
const gmtl::Vec3d & |
theta0, |
|
|
gmtl::Vec3d & |
pos |
|
) |
| |
Implementation of Forward Kinematics equation for kinematics model, by Alastair Barrow
- Parameters
-
theta0 | Vector of joint angles to calculate end effector position from |
pos | Vector to store calculated cartesian end effector position to |
Forward kinematics. Standard Newton-Raphson for linear systems using Jacobian to estimate slope. A small amount of adjustment in the step size is all that is requried to guarentee convergence
bool libnifalcon::FalconKinematicStamper::getAngles |
( |
std::array< double, 3 > & |
position, |
|
|
std::array< double, 3 > & |
angles |
|
) |
| |
|
virtual |
Given a caretesian position (in meters), return the angle of the legs requires to achieve the positions
- Parameters
-
position | Position to get the angles for (in cartesian coordinates, meters) |
angles | Array to write result into |
- Returns
- true if angles are found, false otherwise (i.e. position out of workspace range)
Implements libnifalcon::FalconKinematic.
bool libnifalcon::FalconKinematicStamper::getForces |
( |
const std::array< double, 3 > & |
position, |
|
|
const std::array< double, 3 > & |
cart_force, |
|
|
std::array< int, 3 > & |
enc_force |
|
) |
| |
|
virtual |
Given a caretesian position (in meters), and force vector (in newtons), return the force values that need to be sent to the firmware. Values are capped at 4096.
- Parameters
-
position | Current position of the end effector |
cart_force | Force vector to apply to the end effector |
enc_force | Force to be sent to the firmware |
- Returns
- true if forces are generated, false otherwise.
Implements libnifalcon::FalconKinematic.
bool libnifalcon::FalconKinematicStamper::getPosition |
( |
std::array< int, 3 > & |
angles, |
|
|
std::array< double, 3 > & |
position |
|
) |
| |
|
virtual |
Given a set of encoder values, return the cartesian position (in meters) of the end effector in relation to the origin. Note: Origin subject to change based on kinematics system. Use the workspaceOrigin() function to get what the system thinks its origin is.
- Parameters
-
angles | Encoder values for the 3 legs |
position | Array to write result into |
- Returns
- true if angles are found, false otherwise (i.e. position out of workspace range)
Implements libnifalcon::FalconKinematic.
virtual void libnifalcon::FalconKinematicStamper::getWorkspaceOrigin |
( |
std::array< double, 3 > & |
origin | ) |
|
|
inlinevirtual |
Returns the center point of the workspace. May not always be [0,0,0].
- Parameters
-
origin | Array to store values in |
Implements libnifalcon::FalconKinematic.
Implementation of Inverse Kinematics equation for kinematics model, by Alastair Barrow
- Parameters
-
angles | Angle structure to store calculated joint angles to |
worldPosition | Current cartesian position of end effector |
void libnifalcon::FalconKinematicStamper::initialize |
( |
| ) |
|
Initializes lookup tables for kinematics (can block)
Implementation of jacobian for kinematics model, by Alastair Barrow
- Parameters
-
angles | Current joint angles |
- Returns
- Jacobian matrix for calculating forces
The velocity Jacobian where theta=J*Vel and Torque=J'*Force Derivation in a slightly different style to Stamper and may result in a couple of sign changes due to the configuration of the Falcon
gmtl::Vec3d libnifalcon::FalconKinematicStamper::pos_ |
The documentation for this class was generated from the following files: