Robotcode
1.0
|
Class for control of the 2-link dual arm robot under a s626 io board in QS17, B05. More...
#include <ManipulandumDR.h>
Public Member Functions | |
ManipulandumDR (void) | |
Constructor. | |
~ManipulandumDR () | |
Destructor. | |
void | init (string paramfile) |
initialize the manipulandum with parameter file | |
void | update () |
Updates the sensory state of the robot. | |
void | update (double dt) |
Updates the sensory state of the robot for time dt. | |
void | recenter () |
Put (0,0) of world at current position. | |
void | getCounter (long &sh, long &el) |
Get the raw counter values. | |
void | getPosition (Vector2D &thePos) |
Get Positions. | |
Vector2D | getPosition () |
Get Position. | |
void | getVelocity (Vector2D &theVel) |
Get Velocities. | |
Vector2D | getVelocity () |
Get Velocity. | |
void | getAngles (Vector2D &theAngles) |
Get angles of the Shoulder and Elbow. | |
Vector2D | getAngles () |
void | setForce (Vector2D theForce) |
Get the Shoulder and Elbow angle in radians. | |
void | setVolts (double v0, double v1) |
sets voltages to shoulder and elbow directly | |
Vector2D | ati2World (Vector2D atiforce) |
computes the force in world coordinate based on ATI force readings | |
void | printState (int col=0) |
prints the state of a robot on the text display | |
void | setFromLocal (const Matrix2D &, const Vector2D &) |
Sets the Transformation between local (Robot) coordinates and the World. | |
Public Attributes | |
Vector2D | position |
robot values that can be read | |
Vector2D | velocity |
Current velocity, unfiltered in m/s. | |
Vector2D | positionFilt |
Position after Kalmanfiltering. | |
Vector2D | velocityFilt |
Velocity estimate after Kalman filtering. | |
Vector2D | force |
Current Force Goal in global cooridinates. | |
Vector2D | forceProd |
Current estimate of force produced in global coordinates. | |
double | dt |
default update rate | |
string | paramfilename |
robot parameters determined from calibration file | |
int | board_cnt [2] |
Board for encoder channels. | |
int | channel [2] |
Channels for counters. | |
int | board_da |
Board number used for force output. | |
int | da_offset |
Channel number of da offset. | |
double | ang_ati2arm |
Angle from ATI force tranducer to arm coordinates. | |
Matrix2D | AFromLocal |
rotation Robot->World x_world = A * x_robot + v | |
Vector2D | vFromLocal |
offset Robot->World x_world = A * x_robot + v | |
Matrix2D | AToLocal |
inverse (AFromLocal) | |
Vector2D | vToLocal |
vFromLocal | |
Vector2D | jointLength |
Length of robot joints. | |
Vector2D | offset |
Offset for 0 degrees on Shoulder/ Elbow encoder. | |
Vector2D | dir_cnt |
Counting direction of Encoders. | |
Vector2D | torque2volts |
Torque to volts transversion at motors. | |
bool | isFirstUpdate |
robot values that are updated by update step | |
KalmanFilter< 2 > | filter |
Kalman filter for optimal velocity and position estimation. | |
long | sh_cnt |
Shoulder encoder count. | |
long | el_cnt |
Elbow encoder count. | |
Vector2D | theta |
Angles of shoulder joint [0] and elbow joint [1]. | |
Vector2D | torque |
Current Torques of shoulder [0] and elbow [1]. | |
Vector2D | positionLocal |
position in robot space | |
Vector2D | lastPosition |
Last position. | |
Matrix2D | Jdx_dtheta |
Jacobian dx/theta. | |
Vector2D | volts |
bool | errorState |
Class for control of the 2-link dual arm robot under a s626 io board in QS17, B05.
Function init is called with a parameter file that contains the data from the Calibration. Then you only have to call update() in regular intervals in the updateHaptics() loop, and you have access to estimates of position and velocity. Manipulandum uses a KalmanFilter for smoothing.
ManipulandumDR::ManipulandumDR | ( | void | ) |
Constructor.
The Constructor really doesn't anything
ManipulandumDR::~ManipulandumDR | ( | ) |
Destructor.
Destructor does nothing Should probably free the channels allocated on the s626 board
void ManipulandumDR::init | ( | string | paramfile | ) |
initialize the manipulandum with parameter file
Reads a configuration file for the robot and initializes io channels
paramfile | Parameter files The file contains |
void ManipulandumDR::update | ( | double | dt | ) |
Updates the sensory state of the robot for time dt.
Main routine that does all the heavy work with update frequency
dt | time in ms since last update |
void ManipulandumDR::recenter | ( | ) |
Put (0,0) of world at current position.
Set the current position of the robot to be (0,0)
void ManipulandumDR::getCounter | ( | long & | sh, |
long & | el | ||
) |
Get the raw counter values.
Gets the raw counter values by reference
sh | this is where the shoulder counter will be dumped |
el | this is where the elbow counter will be dumped |
void ManipulandumDR::setForce | ( | Vector2D | force | ) |
Get the Shoulder and Elbow angle in radians.
sets forces in Euclidean cooridinates
Sets the force output for the robot in Eucledian coordinates using the current state of the robot. This needs to be called again as position of the robot changes.
force | Vector of forces in N |
void ManipulandumDR::setVolts | ( | double | v0, |
double | v1 | ||
) |
sets voltages to shoulder and elbow directly
Sets the voltage output to the Motors directly
v0 | volts to the shoulder motor |
v1 | volts to the elbow motor |
computes the force in world coordinate based on ATI force readings
translates the ATI readings into world coordinates
forcereading | in ATI coordinate frame |
Sets the Transformation between local (Robot) coordinates and the World.
Set the transformation from local (robot) to World coordinates also set the inverse transform
A | 2x2 rotation matrix |
v | 2x1 shift vector |
robot values that can be read
Current position, unfiltered in m
robot parameters determined from calibration file
name of current parameter file
robot values that are updated by update step
is first update?