Classes | Defines | Enumerations | Functions | Variables
kni_wrapper.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  TCurrentMot
 structure for the currently active axis More...
struct  TMovement
 structure for the More...
struct  TPos
 extern C because we want to access these interfaces from anywhere: More...

Defines

#define DLLEXPORT

Enumerations

enum  { ERR_NONE = 0, ERR_SUCCESS = 1 }
enum  ETransition { PTP = 1, LINEAR = 2 }
 the transition types for a movement More...

Functions

DLLEXPORT int allMotorsOff ()
DLLEXPORT int allMotorsOn ()
DLLEXPORT int calibrate (int axis)
DLLEXPORT int clearMoveBuffers ()
 clears the movebuffers
DLLEXPORT int closeGripper ()
DLLEXPORT int deleteMovementFromStack (char *name, int index)
DLLEXPORT int deleteMovementStack (char *name)
 deletes a movemnt stack
DLLEXPORT int executeConnectedMovement (struct TMovement *movement, struct TPos *startPos, bool first, bool last)
DLLEXPORT int executeMovement (struct TMovement *movement)
DLLEXPORT int flushMoveBuffers ()
 flush all the movebuffers
DLLEXPORT int getAxisFirmwareVersion (int axis, char value[])
 gets the axis firmware version and returns it in the value argument
DLLEXPORT int getCurrentControllerType (int axis)
DLLEXPORT int getDrive (int axis, int &value)
DLLEXPORT int getEncoder (int axis, int &value)
DLLEXPORT int getForce (int axis)
 set the current force
DLLEXPORT int getNumberOfMotors ()
 returns the number of motors configured
DLLEXPORT int getPosition (struct TPos *pos)
 gets a position
DLLEXPORT int getVelocity (int axis, int &value)
DLLEXPORT int getVersion (char value[])
 gets the controlboard firmware version and returns it in the value argument
DLLEXPORT int initKatana (char *configFile, char *ipaddress)
 This initializes the Katana (communication etc)
DLLEXPORT int IO_readInput (int inputNr, int &value)
DLLEXPORT int IO_setOutput (char output, int value)
DLLEXPORT int ModBusTCP_readWord (int address, int &value)
 reads a value from the register 'address' (if not connected, connect to the IP in katana.conf)
DLLEXPORT int ModBusTCP_writeWord (int address, int value)
DLLEXPORT int motorOff (int axis)
DLLEXPORT int motorOn (int axis)
DLLEXPORT int moveMot (int axis, int enc, int speed, int accel)
DLLEXPORT int moveMotAndWait (int axis, int targetpos, int tolerance)
DLLEXPORT int moveToPos (struct TPos *pos, int velocity, int acceleration)
 moves in IK
DLLEXPORT int moveToPosEnc (int enc1, int enc2, int enc3, int enc4, int enc5, int enc6, int velocity, int acceleration, int tolerance, bool _wait)
DLLEXPORT int moveToPosLin (struct TPos *targetPos, int velocity, int acceleration)
 moves in LM
DLLEXPORT int openGripper ()
DLLEXPORT int ping (int axis)
DLLEXPORT int pushMovementToStack (struct TMovement *movement, char *name)
DLLEXPORT int runThroughMovementStack (char *name, int loops)
DLLEXPORT int sendSplineToMotor (int axis, int targetpos, int duration, int p0, int p1, int p2, int p3)
DLLEXPORT int setCollisionDetection (int axis, bool state)
DLLEXPORT int setCollisionParameters (int axis, int position, int velocity)
DLLEXPORT int setControllerParameters (int axis, int ki, int kspeed, int kpos)
DLLEXPORT int setForceLimit (int axis, int limit)
DLLEXPORT int setGripper (bool hasGripper)
DLLEXPORT int setMaxAccel (int axis, int acceleration)
DLLEXPORT int setMaxVelocity (int axis, int vel)
DLLEXPORT int setPositionCollisionLimit (int axis, int limit)
DLLEXPORT int setVelocityCollisionLimit (int axis, int limit)
DLLEXPORT int startSplineMovement (int contd, int exactflag)
DLLEXPORT int unblock ()
 unblocks the robot after collision/instantstop
DLLEXPORT int waitForMot (int axis, int targetpos, int tolerance)

Variables

const double PI = 3.14159265358979323846

Define Documentation

#define DLLEXPORT

Definition at line 30 of file kni_wrapper.h.


Enumeration Type Documentation

anonymous enum
Enumerator:
ERR_NONE 
ERR_SUCCESS 

Definition at line 36 of file kni_wrapper.h.

the transition types for a movement

Enumerator:
PTP 

Point-to-point movement.

LINEAR 

linear movement

Definition at line 56 of file kni_wrapper.h.


Function Documentation

Switches all axes off

Returns:
returns -1 on failure, 1 if successful

Definition at line 149 of file kni_wrapper.cpp.

Put all axes into hold state

Returns:
returns -1 on failure, 1 if successful

Definition at line 163 of file kni_wrapper.cpp.

DLLEXPORT int calibrate ( int  axis)

closes the Katana session

Returns:
returns -1 on failure, 1 if successful

Definition at line 63 of file kni_wrapper.cpp.

clears the movebuffers

Definition at line 655 of file kni_wrapper.cpp.

closes the gripper if available

Returns:
returns ERR_FAILURE on failure, ERR_INVALID_ARGUMENT if an argument is out of range, ERR_STATE_MISMATCH if the command was given to a wrong state, 1 if successful

Definition at line 195 of file kni_wrapper.cpp.

DLLEXPORT int deleteMovementFromStack ( char *  name,
int  index 
)

deletes a movement from the stack

Parameters:
namethe name of the stack
indexthe index of the movement to delete

Definition at line 359 of file kni_wrapper.cpp.

DLLEXPORT int deleteMovementStack ( char *  name)

deletes a movemnt stack

Definition at line 396 of file kni_wrapper.cpp.

DLLEXPORT int executeConnectedMovement ( struct TMovement movement,
struct TPos startPos,
bool  first,
bool  last 
)

execute a connected movement

Parameters:
movementa TMovement struct to execute
startPosa TPos struct with the start position, can be omitted if first=true
firstif this is the first of the connected movements (start at current pos)
lastif this is the last of the connected movements (wait for end of move)

Definition at line 496 of file kni_wrapper.cpp.

DLLEXPORT int executeMovement ( struct TMovement movement)

execute a movement

Parameters:
movementa TMovement struct to execute, starting from the current position

Definition at line 482 of file kni_wrapper.cpp.

flush all the movebuffers

Definition at line 281 of file kni_wrapper.cpp.

DLLEXPORT int getAxisFirmwareVersion ( int  axis,
char  value[] 
)

gets the axis firmware version and returns it in the value argument

Definition at line 719 of file kni_wrapper.cpp.

set the current controller limit

Returns:
0 for position controller, 1 for current controller

Definition at line 855 of file kni_wrapper.cpp.

DLLEXPORT int getDrive ( int  axis,
int &  value 
)

gets the pwm and returns it in the value argument

Parameters:
axisThe axis to send the command to
Returns:
returns ERR_FAILURE on failure, ERR_INVALID_ARGUMENT if an argument is out of range, ERR_STATE_MISMATCH if the command was given to a wrong state, 1 if successful

Definition at line 688 of file kni_wrapper.cpp.

DLLEXPORT int getEncoder ( int  axis,
int &  value 
)

gets the position and returns it in the value argument

Parameters:
axisThe axis to send the command to
Returns:
returns ERR_FAILURE on failure, ERR_INVALID_ARGUMENT if an argument is out of range, ERR_STATE_MISMATCH if the command was given to a wrong state, 1 if successful

Definition at line 704 of file kni_wrapper.cpp.

DLLEXPORT int getForce ( int  axis)

set the current force

Definition at line 842 of file kni_wrapper.cpp.

returns the number of motors configured

Definition at line 940 of file kni_wrapper.cpp.

DLLEXPORT int getPosition ( struct TPos pos)

gets a position

Definition at line 295 of file kni_wrapper.cpp.

DLLEXPORT int getVelocity ( int  axis,
int &  value 
)

gets the velocity and returns it in the value argument

Parameters:
axisThe axis to send the command to
Returns:
returns -1 on failure, 1 if successful

Definition at line 672 of file kni_wrapper.cpp.

DLLEXPORT int getVersion ( char  value[])

gets the controlboard firmware version and returns it in the value argument

Definition at line 744 of file kni_wrapper.cpp.

DLLEXPORT int initKatana ( char *  configFile,
char *  ipaddress 
)

This initializes the Katana (communication etc)

Definition at line 39 of file kni_wrapper.cpp.

DLLEXPORT int IO_readInput ( int  inputNr,
int &  value 
)

reads an input from the digital I/O and returns it in the value argument

Returns:
returns ERR_FAILURE on failure, ERR_INVALID_ARGUMENT if an argument is out of range, ERR_STATE_MISMATCH if the command was given to a wrong state, 1 if successful

Definition at line 621 of file kni_wrapper.cpp.

DLLEXPORT int IO_setOutput ( char  output,
int  value 
)

sets an output of the digital I/Os

Parameters:
ouputNr1, or 2 for OutA or OutB
Returns:
returns -1 on failure, 1 if successful

Definition at line 596 of file kni_wrapper.cpp.

DLLEXPORT int ModBusTCP_readWord ( int  address,
int &  value 
)

reads a value from the register 'address' (if not connected, connect to the IP in katana.conf)

Returns:
returns -1 on failure, the read value if successful

Definition at line 570 of file kni_wrapper.cpp.

DLLEXPORT int ModBusTCP_writeWord ( int  address,
int  value 
)

writes a value to the register 'address' (if not connected, connect to the IP in katana.conf)

Returns:
returns -1 on failure, 1 if successful

Definition at line 546 of file kni_wrapper.cpp.

DLLEXPORT int motorOff ( int  axis)

Switches an axis off

Parameters:
axisThe axis to send the command to
Returns:
returns ERR_FAILURE on failure, ERR_INVALID_ARGUMENT if an argument is out of range, ERR_STATE_MISMATCH if the command was given to a wrong state, 1 if successful

Definition at line 135 of file kni_wrapper.cpp.

DLLEXPORT int motorOn ( int  axis)

Switches an axis on

Parameters:
axisThe axis to send the command to
Returns:
returns ERR_FAILURE on failure, ERR_INVALID_ARGUMENT if an argument is out of range, ERR_STATE_MISMATCH if the command was given to a wrong state, 1 if successful

Definition at line 121 of file kni_wrapper.cpp.

DLLEXPORT int moveMot ( int  axis,
int  enc,
int  speed,
int  accel 
)

PTP movement

Parameters:
axisThe axis to send the command to
encthe target position
Returns:
returns ERR_FAILURE on failure, ERR_INVALID_ARGUMENT if an argument is out of range, ERR_STATE_MISMATCH if the command was given to a wrong state, 1 if successful

Definition at line 77 of file kni_wrapper.cpp.

DLLEXPORT int moveMotAndWait ( int  axis,
int  targetpos,
int  tolerance 
)

calls MoveMot() and WaitForMot()

Parameters:
axisThe axis to send the command to
tolerancein encoder values (0 means wait until reached)
Returns:
returns ERR_FAILURE on failure, ERR_INVALID_ARGUMENT if an argument is out of range, ERR_STATE_MISMATCH if the command was given to a wrong state, ERR_RANGE_MISMATCH if the target position is out of range 1 if successful

Definition at line 106 of file kni_wrapper.cpp.

DLLEXPORT int moveToPos ( struct TPos pos,
int  velocity,
int  acceleration 
)

moves in IK

Definition at line 309 of file kni_wrapper.cpp.

DLLEXPORT int moveToPosEnc ( int  enc1,
int  enc2,
int  enc3,
int  enc4,
int  enc5,
int  enc6,
int  velocity,
int  acceleration,
int  tolerance,
bool  _wait 
)

Moves all axes to a target encoder value

Parameters:
enc(encX) the target positions
tolerancein encoders. sent unscaled to axis and handled there. WaitForMot (and MoveMOtAndWait) checks the tolerance though.
waitwait for the movement to finish
Returns:
returns ERR_FAILURE on failure, ERR_INVALID_ARGUMENT if an argument is out of range, ERR_STATE_MISMATCH if the command was given to a wrong state, 1 if successful

Definition at line 223 of file kni_wrapper.cpp.

DLLEXPORT int moveToPosLin ( struct TPos targetPos,
int  velocity,
int  acceleration 
)

moves in LM

Definition at line 325 of file kni_wrapper.cpp.

opens the gripper if available

Returns:
returns ERR_FAILURE on failure, ERR_INVALID_ARGUMENT if an argument is out of range, ERR_STATE_MISMATCH if the command was given to a wrong state, 1 if successful

Definition at line 209 of file kni_wrapper.cpp.

DLLEXPORT int ping ( int  axis)

checks the alive state of an axis

Parameters:
axis0 = get all axes
Returns:
If axis 0: 1 if all axes are present, negative value is the inverted number of the first axis found failing, 0 if no data is available. If axis != 0: 1 if heartbeat found, -1 if failed, 0 if no data is available.

Definition at line 954 of file kni_wrapper.cpp.

DLLEXPORT int pushMovementToStack ( struct TMovement movement,
char *  name 
)

pushes a movement onto a stack

Parameters:
movementa movement structure filled with position and movement parameters
namethe name of the stack to push it onto

Definition at line 341 of file kni_wrapper.cpp.

DLLEXPORT int runThroughMovementStack ( char *  name,
int  loops 
)

Runs through the movement stack, executes the movements

Parameters:
namethe name of the stack to run through
loopsthe number of loops to run

Definition at line 426 of file kni_wrapper.cpp.

DLLEXPORT int sendSplineToMotor ( int  axis,
int  targetpos,
int  duration,
int  p0,
int  p1,
int  p2,
int  p3 
)

sends a single polynomial to an axis (G)

Parameters:
axisThe axis to send the command to
Returns:
returns ERR_FAILURE on failure, ERR_INVALID_ARGUMENT if an argument is out of range, ERR_STATE_MISMATCH if the command was given to a wrong state, ERR_RANGE_MISMATCH if the target position is out of range 1 if successful

Definition at line 252 of file kni_wrapper.cpp.

DLLEXPORT int setCollisionDetection ( int  axis,
bool  state 
)

sets the collision detection on the axes.

Parameters:
statetrue = on
axis0 = set all axes
Returns:
returns ERR_FAILURE on failure, ERR_INVALID_ARGUMENT if an argument is out of range, ERR_STATE_MISMATCH if the command was given to a wrong state, 1 if successful

Definition at line 768 of file kni_wrapper.cpp.

DLLEXPORT int setCollisionParameters ( int  axis,
int  position,
int  velocity 
)

sets the collision parameters this function internally calls setPositionCollisionLimit and setVelocityCollisionLimit

Parameters:
axis0 = set all axes
positionrange 1-10
velocityrange 1-10

Definition at line 813 of file kni_wrapper.cpp.

DLLEXPORT int setControllerParameters ( int  axis,
int  ki,
int  kspeed,
int  kpos 
)

sets the controller parameters

Parameters:
axis0 = set all axes
Returns:
returns ERR_FAILURE on failure, ERR_INVALID_ARGUMENT if an argument is out of range, ERR_STATE_MISMATCH if the command was given to a wrong state, 1 if successful

Definition at line 882 of file kni_wrapper.cpp.

DLLEXPORT int setForceLimit ( int  axis,
int  limit 
)

set the force limit

Parameters:
axis0 = all axes
limitlimit in percent

Definition at line 828 of file kni_wrapper.cpp.

DLLEXPORT int setGripper ( bool  hasGripper)

sets or unsets whether the Katana has a Gripper

Parameters:
hasGripperset to true if a gripper is present. Default at startup: false
Returns:
returns ERR_FAILURE on failure, ERR_INVALID_ARGUMENT if an argument is out of range, ERR_STATE_MISMATCH if the command was given to a wrong state, 1 if successful

Definition at line 177 of file kni_wrapper.cpp.

DLLEXPORT int setMaxAccel ( int  axis,
int  acceleration 
)

sets the maximum acceleration (allowed values are only 1 and 2)

Parameters:
axis0 = set all axes
Returns:
returns ERR_FAILURE on failure, ERR_INVALID_ARGUMENT if an argument is out of range, ERR_STATE_MISMATCH if the command was given to a wrong state, 1 if successful

Definition at line 918 of file kni_wrapper.cpp.

DLLEXPORT int setMaxVelocity ( int  axis,
int  vel 
)

sets the maximum velocity

Parameters:
axis0 = set all axes
vel1-180 are valid
Returns:
returns ERR_FAILURE on failure, ERR_INVALID_ARGUMENT if an argument is out of range, ERR_STATE_MISMATCH if the command was given to a wrong state, 1 if successful

Definition at line 896 of file kni_wrapper.cpp.

DLLEXPORT int setPositionCollisionLimit ( int  axis,
int  limit 
)

set the position collision limit

Parameters:
axis0 = all axes

Definition at line 785 of file kni_wrapper.cpp.

DLLEXPORT int setVelocityCollisionLimit ( int  axis,
int  limit 
)

set the velocity collision limit

Parameters:
axis0 = all axes

Definition at line 799 of file kni_wrapper.cpp.

DLLEXPORT int startSplineMovement ( int  contd,
int  exactflag 
)

starts the linear movement (G+128)

Returns:
returns -1 on failure, 1 if successful

Definition at line 266 of file kni_wrapper.cpp.

DLLEXPORT int unblock ( )

unblocks the robot after collision/instantstop

Definition at line 868 of file kni_wrapper.cpp.

DLLEXPORT int waitForMot ( int  axis,
int  targetpos,
int  tolerance 
)

waits for a motor

Parameters:
axisThe axis to wait for
targetpos(only relevant if mode is 0)
tolerance(only relevant if mode is 0) in encoder values
Returns:
returns ERR_FAILURE on failure, ERR_INVALID_ARGUMENT if an argument is out of range, ERR_STATE_MISMATCH if the command was given to a wrong state, ERR_RANGE_MISMATCH if the target position is out of range 1 if successful

Definition at line 92 of file kni_wrapper.cpp.


Variable Documentation

const double PI = 3.14159265358979323846

Definition at line 34 of file kni_wrapper.h.



kni
Author(s): Neuronics AG (see AUTHORS.txt); ROS wrapper by Martin Günther
autogenerated on Mon Oct 6 2014 10:45:33