libnifalcon  1.0.1
Public Member Functions | Public Attributes | List of all members
libnifalcon::FalconKinematicStamper Class Reference

#include <FalconKinematicStamper.h>

+ Inheritance diagram for libnifalcon::FalconKinematicStamper:
+ Collaboration diagram for libnifalcon::FalconKinematicStamper:

Public Member Functions

 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)
 
- Public Member Functions inherited from libnifalcon::FalconKinematic
 FalconKinematic ()
 
virtual ~FalconKinematic ()
 
double getTheta (int encoder_value)
 
- Public Member Functions inherited from libnifalcon::FalconCore
 FalconCore ()
 
virtual ~FalconCore ()
 
int getErrorCode ()
 

Public Attributes

gmtl::Vec3d pos_
 

Additional Inherited Members

- Public Types inherited from libnifalcon::FalconKinematic
enum  { FALCON_KINEMATIC_OUT_OF_RANGE = 5000 }
 
- Protected Attributes inherited from libnifalcon::FalconCore
int m_errorCode
 

Detailed Description

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.

Constructor & Destructor Documentation

libnifalcon::FalconKinematicStamper::FalconKinematicStamper ( bool  init_now = true)

Constructor.

Parameters
init_nowIf true, runs initialize() function on construction (can block). Defaults to true.
Returns
libnifalcon::FalconKinematicStamper::~FalconKinematicStamper ( )
inline

Destructor

Returns

Member Function Documentation

void libnifalcon::FalconKinematicStamper::FK ( const gmtl::Vec3d &  theta0,
gmtl::Vec3d &  pos 
)

Implementation of Forward Kinematics equation for kinematics model, by Alastair Barrow

Parameters
theta0Vector of joint angles to calculate end effector position from
posVector 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
positionPosition to get the angles for (in cartesian coordinates, meters)
anglesArray 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
positionCurrent position of the end effector
cart_forceForce vector to apply to the end effector
enc_forceForce 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
anglesEncoder values for the 3 legs
positionArray 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
originArray to store values in

Implements libnifalcon::FalconKinematic.

void libnifalcon::FalconKinematicStamper::IK ( StamperKinematicImpl::Angle angles,
const gmtl::Vec3d &  worldPosition 
)

Implementation of Inverse Kinematics equation for kinematics model, by Alastair Barrow

Parameters
anglesAngle structure to store calculated joint angles to
worldPositionCurrent cartesian position of end effector
void libnifalcon::FalconKinematicStamper::initialize ( )

Initializes lookup tables for kinematics (can block)

gmtl::Matrix33d libnifalcon::FalconKinematicStamper::jacobian ( const StamperKinematicImpl::Angle angles)

Implementation of jacobian for kinematics model, by Alastair Barrow

Parameters
anglesCurrent 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

Member Data Documentation

gmtl::Vec3d libnifalcon::FalconKinematicStamper::pos_

Internal position state


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