TechTip: Programming with lists and CSV data
Do you want to connect your robot program to external data sources, for example, to move the robot to different positions specified from an external program? The TechTip shows how.
TECHTIP “TAKE AWAYS”
- Handling lists in ArtiMinds RPS
- Programming loop executions in the context of lists
The ‘LIST’ template in ArtiMinds RPS allows the storage of different positions. In this example, the robot should move to nine points on the component shown in Fig. 1. To create a list, select the nine points with the point tool while holding the SHIFT key(Fig. 2). The order in which the points are selected determines the posterior position of the individual points in the list.
The list template now stores the individual points in the input parameter ‘Poses’. The input ‘Index’ can be used to select which of the individual stored positions is provided via the outputs ‘ListState’ (provides a joint angle configuration with which the point is reached) or ‘ListPose’ (provides a Cartesian target coordinate). Clicking on the ‘Index’ input opens a popup window where the index can be changed (see Fig. 4).
To move the TCP to one of the positions in the list, a movement template must be placed behind the list template (e.g. Move to State). This template is not parameterized via the wizard. Instead, it gets its target configuration by connecting the ‘ListState’ output with its ‘goal_state’ input (see Fig. 5).
Note: Some templates are parameterized via joint angle configurations (e.g. Move to State). Others (like Move Linear or Move to Point) expect a Cartesian target coordinate. In this case the ‘ListPose’ output must be connected to the ‘PointTo’ input (see Fig. 6).
Move to all stored positions: ‘List Loop’ template
A change of the current index of the list template now also updates the target position to which the robot moves (see exemplary Fig. 7, Fig. 8).
Probably you want to move automatically to all stored positions one after the other instead of picking single positions by the index. For doing so, you should rather create a ‘List Loop’ template instead of the ‘List’ template (see Fig. 9). This automatically adds a loop template to the list. To parameterize the movement, open the loop template (right click -> Open, see Fig. 10) and insert the movement template behind the automatically created ‘List Access’ template (see Fig. 11, here solved with a Move Linear).
Native script code is generated
The program will now loop over the individual list elements, and move to each element one after the other (see Fig. 12). By adding the starting point of the move (p0) as the target point of a ‘Move to Point’ template, shuttle moves can be executed as well (see Fig. 13 – Fig. 14).
Of course, ArtiMinds RPS generates the native script code for the robot controller as usual – in this case Fanuc TP code (see Fig. 15).