Indy Shared Memory
Shared Memory Manager
Indy Shared Memory is generated from the Shared Memory Manager
-
Namespace : NRMKFramework
-
Header : NRMKFramework/shmem/ShmemManager.hpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
Using this Indy Shared Memory, NRMKFramework 2.0 provides various API related to robot control such as data reading, communication, direct variables and so on. Information about Indy Shared Memory is shown in the table below. Users can access Indy Shared Memory through the Shared Memory Manager with the values below.
Shared Memory Name | Shared Memory Size |
---|---|
IndySHM | 16777216 (0x1000000; 16MB) |
Shared Data Structs
These structures contain robot information such as real-time data, robot control data, and robot status data.
-
Namespace : NRMKIndy::SharedData
-
Header : NRMKFramework/Indy/SharedMemory/SharedData.h
RobotRTSharedData
This structure contains the real-time data and EtherCAT information.
1 2 3 4 5 6 7 8 9 10 11 12 |
|
-
double time : The time the robot was run
-
uint64_t taskTime : Total time taken per tick for robot control
-
uint64_t taskTimeMax : Highest taskTime during robot run
-
uint64_t computeTime : Total calculation time associated with algorithms, such as robot path calculation per tick, collision detection, etc.
-
uint64_t computeTimeMax : Highest computeTime during robot run
-
uint64_t ecatTime : EtherCAT communication time for robot control per tick
-
uint64_t ecatTimeMax : Highest ectatTime during robot run
-
uint32_t ecatMasterState : EtherCAT Master status
-
uint32_t ecatSlaveNum : Number of connected EtherCAT Slave
-
uint16_t coeStatus : CoeStatus for a motor of each joint
Note
In case of Indy7, the value of MAX_JOINT_DOF is 6, and the Index of the array corresponds to the joint number (0 to 5).
RobotControlSharedData
This structure contains the control data, which includes joint angle, joint velocity, torque, task position, etc.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
-
double time : The time the robot was run
-
int32_t cmode : Control Mode of robot
CMode | Description | 0 | Sticking the current position | 1 | Joint control (velocity based) | 2 | Task control (velocity based) | 3 | Direct teaching mode | 4 | Impedance control | 5 | Stop | 6 | Safe stop | 7 | Joint jogging | 8 | Task jogging | 9 | Joint control (time-based) | 10 | Task control (time-based) | 11 | Joint recovery |
---|
- int32_t tCmode : Task Control coordinate system
Value | Description |
---|---|
0 | Reference Frame (Global) Base |
1 | TCP (Tool) Base |
-
double q[MAX_JOINT_DOF] : Joint angle of robot
-
double qdot[MAX_JOINT_DOF] : Joint velocity of robot
-
double qd[MAX_JOINT_DOF] : Desired joint angle of robot
-
double qdotd[MAX_JOINT_DOF] : Desired joint velocity of robot
-
double qdotref[MAX_JOINT_DOF] : Reference joint velocity of robot
-
double qddot[MAX_JOINT_DOF] : Joint acceleration of robot
-
double qddotd[MAX_JOINT_DOF] : Desired joint acceleration of robot
-
double qddotref[MAX_JOINT_DOF] : Reference joint acceleration of robot
-
double p[6] : Task position (based on Reference Frame)
-
double pd[6] : Desired Task position
-
double pdot[6] : Task velocity
-
double pdotd[6] : Desired task velocity
-
double pdotref[6]: Reference task velocity of robot
-
double pddot[6] : Task acceleration of robot
-
double pddotd[6] : Desired task acceleration of robot
-
double pddotref[6] : Reference task acceleration of robot
-
double tau[JOINT_DOF] : Joint torque input into motor, and the sum of the 4 values below: tauext, taugrav, tauidyn, tauref
-
double tauext[JOINT_DOF] : Estimated value of external torque applied to the motor
-
double taugrav[JOINT_DOF] : Gravity torque required for the robot to hold its current position
-
double tauidyn[JOINT_DOF] : Torque required for the robot to move to the desired point
-
double tauref[JOINT_DOF] : Torque required to remove the effects not defined in the model
-
double Fext[6] : Values read from F/T sensors used for impedance control
- Force value unit : N (X, Y, Z), Nm (U, V, W)
- Force value order : XYZUVW
-
int qState[JOINT_DOF] : joint motor status
Value | Description |
---|---|
0 | Motor Off |
1 | Motor On |
2 | Motor Ready On (Stanby status for becoming On) |
- int qBrake[JOINT_DOF] : Brake status of joint motor
Value | Description |
---|---|
0 | Brake Off (Release, Open) |
1 | Brake On (Hold, Close) |
Note
-
The sequence order of data related to the task, such as Task Position and Task Velocity, is UVWXYZ.
-
In the Shared Memory, we use units in below table.
Description | Unit |
---|---|
Distance | [m] |
Angular | [rad] |
Time | [s] |
Force | [N] |
Torque | [Nm] |
Velocity | [m/s], [rad/s] |
Acceleration | [m/s^2], [rad/s^2] |
RobotStateSharedData
This structure contains the status of the robot software program.
1 2 3 4 5 6 7 8 9 10 |
|
-
bool isTaskRunning : Robot's control SW program execution state
-
bool isCadkitConnected : CadkitViewer connection status
-
bool isContyConnected : Conty connection status
-
bool isSCMConnected : SCM connection status
-
bool isToolConnected : Tool connection status
-
bool isDebugMode : Debug Mode
-
char programMode : Program mode
Value | Description |
---|---|
0 | No program loaded |
1 | Command program (Cadkit, etc.) |
2 | Program made in Conty |
3 | Program made in Script |
- char programState : Program Status
Value | Description |
---|---|
0 | Program stopped |
1 | Program running |
2 | Program paused |
RobotControlStatusSharedData
This structure represents the control status.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
-
bool isReady : Robot ready status (all Servo On)
-
bool isEmergencyState : Emergency status (including emergency stop, collision, and error)
-
bool isCollided : Collision status
-
bool isErrorState : Robot error status
-
bool isBusy : Robot moving status
-
bool isMoveFinished : Robot move command completed successfully
-
bool isHome : Robot is at home position
-
bool isZero : Robot is at the zero position
-
bool isInResetting : Robot is in resetting
-
bool isInTeaching : Robot is in teaching (Direct teaching, Jogging, eModi, etc.)
-
bool isDirectTeaching : Robot is in direct teaching mode
RobotConfigSharedData
This structure contains the setting values of the robot.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
-
char name[256] : Robot name (Model name)
-
char buildVersion[128] : Robot build version
-
char buildDate[128] : Robot build date
-
char robotId[256] : Robot unique system ID
-
char stepId[128] : STEP controller system ID
-
int numBodies : The number of bodies
-
int numJoints : The number of joints
-
int jointDof : Robot's degree of freedom (normally equal to the number of joints)
-
double wTime : Time interval between waypoints in time-based JointMove (minimum 0.5)
-
double wTimeTask : Time interval between waypoints in time-based TaskMove (minimum 0.5)
-
int jointVelBoundaryLevel : Velocity level in velocity-based JointMove (1~9)
-
int jointAccBoundaryLevel : Acceleration level in velocity-based JointMove (1~9)
-
int taskVelBoundaryLevel : Velocity level in velocity-based TaskMove (1~9)
-
int taskAccBoundaryLevel : Acceleration level in velocity-based TaskMove (1~9)
-
int collisionLevel : Collision sensitivity level (1~5)
-
int refFrameType : Referece Frmae setting type
Value | Description |
---|---|
0 | default (number 0 Body; Base) |
1 | Direct (with XYZUVW value) |
2 | Planar (3 points plane) |
3 | Circular (3 points circle) |
-
double toolProperties[4] : Tool Property (Mass, X, Y, Z)
-
double defaultTcp[6] : Default TCP setting value
-
double compTcp[6] : TCP compensation value
-
double refFrameTRef[6] : Reference Frame value set (expressed as XYZUVW coordinates based on Base)
-
double refFramePoints[3][3] : XYZ coordinates of 3 points when ReferenceFrame is set using 3 points
-
double jointHome[JOINT_DOF] : Joint home position
-
double taskHome[6] : Task home position (impedance control datum point)
-
double defaultJointBlendRadius : Default radial distance when blending is applied in JointMove (Meter)
-
double defaultTaskBlendRadius : Default radial angle when blending is applied in Taskmove (Radian)
RobotEmergencySharedData
This structure contains the latest error data of the robot. Error data found in this structure is meaningful when the isEmergencyState of the RobotControlStatusSharedData structure is true.
1 2 3 4 5 6 |
|
* int errorCode : Emergency Event Code
Value | Description |
---|---|
0 | Emergency Stop Signal |
1 | Collision detection |
2 | Joint position limit exceeded |
3 | Speed limit exceeded |
4 | Motor status error |
5 | Torque limit exceeded |
6 | EtherCAT connection disconnected |
7 | Path position calculation error |
8 | Tool emergency stop |
9 | Singularity reached |
10 | Overcurrent |
12 | Near joint position limit |
13 | Near velocity limit |
14 | Near sigularity |
- int argsInt[3] : Additional information about each error situation
- double argsDouble[3] : Additional information about each error situation
UserConfigSharedData
This structure contains information about custom settings for robots. If custom setting is added whenever a new function is added, corresponding information will be added to this structure.
1 2 3 |
|
- int registeredDefaultProgramIdx : Index of the currently registered default program (0~9)
SmartDIOSharedData
This structure contains SmartDIO which maps either STEP's GPIO or CB's Digital I/O ports.
Note
For more information of mapping information or details of SmartDIO, see the CB document.
1 2 3 4 |
|
-
bool smartDO[32] : SmartDO output value for each index
-
bool smartDI[32] : SmartDI iutput value for each index
SmartAIOSharedData
This structure represents SmartAIO which maps CB's Analog I/O ports.
1 2 3 4 |
|
-
uint16_t smartAO[32] : SmartAO output value for each index
-
uint16_t smartAI[32] : SmartAI iutput value for each index
ExtraIOData
This structure is designed to express IO data supported by Indy Control Box (CB), except DIO and AIO. Currently, it only supports FTSensor data using CAN ports of robots or CB.
1 2 3 4 5 6 |
|
-
int16_t ftRobotCanRaw[6]: Robot CAN port's FTSensor Raw data
-
double ftRobotCanTr[6] : Robot CAN port's FTSensor transformed value
-
int16_t ftCBCanRaw[6]: Control Box CAN port's FTSensor Raw data
-
double ftCBCanTr[6] : Control Box CAN port's FTSensor transformed value
Shared Data Functions
These functions are a Wraping function, which makes it easy to obtain data from SharedMemory as a structure using the Shared Memory Manager.
RobotRTSharedData
- Getting as Reference
1 2 3 4 |
|
- Getting as Copy
1 2 3 |
|
- NRMKFramework::ShmemManager & indyShm : Shared Memory Manager connected with Indy Shared Memory
Note
Like this, all functions that receive SharedData structure have
the NRMKFramework::ShmemManager & IndyShm parameter
.
This indyShm parameter must be the Shared Memory Manager
associated with Indy Shared Memory.
RobotControlSharedData
- Getting as Reference
1 2 3 4 |
|
- Getting as Copy
1 2 3 |
|
RobotStateSharedData
- Getting as Reference
1 2 3 4 |
|
- Getting as Copy
1 2 3 |
|
RobotControlStatusSharedData
- Getting as Reference
1 2 3 4 |
|
- Getting as Copy
1 2 3 |
|
RobotConfigSharedData
- Getting as Reference
1 2 3 4 |
|
- Getting as Copy
1 2 3 |
|
RobotEmergencySharedData
- Getting as Reference
1 2 3 4 |
|
- Getting as Copy
1 2 3 |
|
- Reset the Data
1 2 3 4 |
|
UserConfigSharedData
- Getting as Reference
1 2 3 4 |
|
- Getting as Copy
1 2 3 |
|
SmartDIOSharedData
- Getting as Reference
1 2 3 4 |
|
- Getting as Copy
1 2 3 |
|
- Getting as Pointer
1 2 3 4 |
|
- Getting one by one through index
1 2 3 4 |
|
- Getting as array
1 2 3 4 |
|
- Getting one by one through index
1 2 3 4 |
|
- Setting one by one through index
1 2 3 4 5 |
|
- Setting with array
1 2 3 4 |
|
SmartAIOSharedData
- Getting as Reference
1 2 3 4 |
|
- Getting as Copy
1 2 3 |
|
- Getting as Pointer
1 2 3 4 |
|
- Getting SmartAI one by one through index
1 2 3 4 |
|
- Getting one by one through index
1 2 3 4 |
|
- Setting one by one through index
1 2 3 4 5 |
|
ExtraIOData
- Getting as Reference
1 2 3 4 |
|
- Getting as Copy
1 2 3 |
|
- Getting as Pointer
1 2 3 4 |
|
Shared Command
Shared Command contains the function that enables control such as send commands or changing settings using SharedMemory.
- Namespace : NRMKIndy::SharedData
- Header : NRMKFramework/Indy/SharedMemory/SharedCommand.h
- Commander
1 2 3 4 |
|
-
NRMKFramework::ShmemManager & indyShm : Shared Memory Manager connected with Indy Shared Memory
-
int jointDof : JOINT_DOF value of the robot to be controlled by Commander (must match the currently running robot)
Move
- stopMove
Stops the current motion of the robot.
1 |
|
- jointMoveHome
Moves the robot to the home position through joint control.
When in async mode, it sends a command and immediately returns true. If the robot is unable to execute the command, it immediately returns false. In Sync mode, true is returned after waiting for the robot to end the move, and false is returned if the move is in a state where it cannot be moved or if some problem are occured during the execution of the command (same as all Move functions).
1 |
|
- Return Value : bool : Whether the robot performed the command successfully
- jointMoveZero
Moves the robot to the zero position through joint control.
1 |
|
- jointMoveTo
Moves the robot to target joint angle position thorught joint control.
1 |
|
- const double * q : A double array representing the angular position of each joint
Note
In Commander class, the angular unit of each parameter in the Move or Configuration function, such as Joint angle or UVW angle of Task Position, is Radian.
- jointMoveBy
Moves the robot by the relative coordinate value from the current joint angle through the Joint Control.
1 |
|
- const double * q : A double array representing the relative coordinates of the target point from the current point coordinates.
- taskMoveTo
Moves the robot to the target task position via task space control.
Caution
Use this function only if user knows about the task space control. Using the robot without understanding of task space control can be dangerous by moving it to the wrong position.
1 |
|
- const double * p : Task positions based on the Reference Frame, in the order XYZUVW. It is a double arrangement of length 6.
- taskMoveBy
Moves the robot from the current task position by the relative coordinate value through task space control.
1 |
|
- const double * p : Task positions based on the reference frame, in the order XYZUVW. It is a double array of length 6. The XYZ coordinate is determined by Task Control Mode whether it is a Reference-based XYZ coordinate system or TCP-based XYZ coordinate system. UVW is always a TCP-based coordinate system.
Note
-
The unit of distance is [m] in the Move or Configuration function, such as Task Position's XYZ.
-
The order of data for task-related functions such as Task Position and Task Velocity is XYZUVW.
- jointMoveWaypoint
Moves the robot through joint control to joint positions of the target waypoint. The corresponding waypoint name should be registered after teaching through Conty.
1 |
|
- const char * waypointName : Target waypoint name
- taskMoveWaypoint
Move the robot to the task position of the target waypoint through Task Space control.
1 |
|
- const char * waypointName : Target waypoint name
- executeMoveCmd
Execute the move command. The Move Command contains at least one waypoint and must be registered in the program set through Conty.
1 |
|
- const char * cmdMoveName : Name of the move command to run (must be within the default program set through Conty)
Configuration
This section introduces the configuration setup functions of robot. The return value of all functions is of the type "bool", and the true value is returned when successfully configured.
In async mode, it cannot be known whether the configuration is properly reflected. In synchronous mode, success/failure is returned after the configuration is completed.
- setCollisionSensitivityLevel
Change collision sensitivity
1 |
|
- int level : Collision sensitivity level (1~5, 5 is most insensitive, same as Conty).
- setTaskControlBaseMode
Changes Task Control Mode in task space control,
1 |
|
- int taskCtrlMode : Task Control Base reference coordinate system (0: Reference Frame, 1: TCP), UVW is always TCP reference
- setJointHome
sets joint home position
1 |
|
- const double * q : Joint angle of the home position.
- setJointHomeCurrPos
Set joint home position with the current robot position
1 |
|
- setDefaultTcp
Sets the default TCP coordinates. If users change the default TCP coordinates, TCP calibration value is reset.
1 |
|
- const double * defaultTcp : Set default Tcp coordinates (XYZUVW order)
- applyTcpCompensation
Applys TCP calibration value. The final TCP value is the default TCP coordinate + TCP calibration value.
1 |
|
- const double * compTcp : TCP calibration value
- revokeTcpCompensation
Cancel TCP calibration application (return to default TCP value)
1 |
|
- setRefFrameDirect
Sets reference frame through XYZUVW coordinate value.
1 |
|
- const double * tref : Refence Frame setup value (XYZUVW order)
- setJointMoveWaypointTime
Changes the time interval between the default Waypoints of time-based JointMove
1 |
|
- double wTime : Waypoint Time (Unit: second)
- setJointMoveVelocityLevel
Set velocity level for velocity-based Joint Move
1 |
|
- int level : Velocity Level (1~9, 9 is the fastest)
- setJointMoveBlendingRadiusLevel
Set radius level of blending when applying blending to JointMove
1 |
|
- int level : Set radius level of blending (1~9, 9 is the largest radius and smooth)
- setTaskMoveWaypointTime
Changes the time interval between the default Waypoints of time-based TaskMove
1 |
|
- double wTimeTask : Waypoint Time (Unit: second)
- setTaskMoveVelocityLevel
Sets velocity level of velocity-based Taskmove
1 |
|
- int level : Velocity Level (1~9)
- setTaskMoveBlendingRadiusLevel
Set radius level of blending when applying blending to TaskMove
1 |
|
- int level : Blending radius level (1~9)
Direct Teaching Mode
- switchDirectTeachingMode
Sets robot to direct teaching mode (when robot is stopped)
1 |
|
- finishDirectTeachingMode
Set the robot to the default mode (holding position) from the direct teaching mode (when the robot is in the direct teaching mode)
1 |
|
Robot Program Control
These functions are used to control the robot by running/pausing/stopping the program loaded or set as the default program in Conty.
- startCurrProgram
Run the currently loaded program (can be loaded via Conty, or can be loaded by running the default program)
1 |
|
- stopCurrProgram
Stops currently running program
1 |
|
- pauseCurrProgram
Pauses currently running program
1 |
|
- resumeCurrProgram
Resumes paused program
1 |
|
- startRegisteredDefaultProgram
Start currently registered default program (Register through Conty or use function below)
1 |
|
- registerDefaultProgramIdx
Register the default program #1-10 saved in Conty as the current default program. After registration, It can be loaded and run the program with startRegisteredDefaultProgram.
1 |
|
- int idx : Default program registered in Conty (Conty Index: 1~10 / Parameter Index: 0~9)
etc
- setSyncMode
The function that sets the mode of the current Commander to Sync or Async. The default is Async Mode.
When a robot control command is sent in async mode, the command is sent and returned immediately. It is not possible to determine whether the command has been executed, etc. And only some information can be obtained through the Shared Data.
In Sync mode, the control command will not return until the end, and the return value will indicate success or failure.
1 2 3 |
|
- bool bSyncMode : Sync Mode or Async Mode
- reset
The function to reset the state (reset the emergency stop, error, collision, etc.). Basically, a normal reset (Soft reset) is performed, and a reboot reset (Hard reset) is performed if necessary. If the user wants a hard reset, it can be called through parameters.
1 2 3 |
|
- bool isHardReset : Robot Hard Reset
- stopEmergency
Immediately stops the current motion of the robot. All the motors are turned off, and the brakes are applied. After this function is called, the robot goes into an emergency stop error state, and the reset function must be called to return to normal state.
1 |
|