Skip to content

Advanced

Grids

The grid management in drag&bot is based on several function blocks working together, which can be divided into two phases: Setup and Execution. During the setup phase the grid is defined and configured with the initial content. During the execution phase the program iterates over the grid while processing each cell. Function blocks return the position of each cell as well as trajectories to reach and leave there. Function blocks can also change the content of each processed cell.

Grid Function Blocks

The following figure shows how a simple pickup application is usually structured.

graph LR start(("Start")) init["Initialize Grid(s)"] reset["Reset Grid(s)"] next_cell["Get Next Cell (Raw Parts)<br>Changes to 'Empty Cell'"] found{"Found Cell<br>with Content?"} finished(("End")) approach["Approach<br>Trajectory"] pickup["Part Pickup"] retreat["Retreat<br>Trajectory"] start --> init init --> reset reset --> next_cell next_cell --> found found -->|No| finished found -->|Yes| approach approach --> pickup pickup --> retreat retreat --> next_cell style reset stroke-dasharray: 5 5 style pickup stroke-dasharray: 5 5

Grid - Initialize

Creates a grid with the given settings. If not already existing, the function block creates a parameter grid_id/content on the datastore, where later the contents of the grid will be saved persistently. Be aware that only the content of the grid is saved persistently across restarts of the robot system, not the definition of the grid.

Name Datatype Description
Inputs Start position Position The column, row and layer numbers where to start when searching the grid for a specified content.
Grid Type Select Select between regular and hexagonal pallet types. A hexagonal pallet has each second row or column shifted by the half length of a cell.
Overhang Select The direction of the shift for hexagonal pallet types where a element should overhang after shifting it. Select between left and right.
Shift Select In which axis should the shift occur. Select between row and column.
Grid Frame Pose The Grid Frame defines the root of the palletizing position producer. The Grid Frame is a transformation and it is calculated out of 3 positions defined by the TCP of the robot. (See more in the subsection above "What is the Grid Frame?")
Grid Dimension Composed Define the delta length between two cells in column and row direction of the grid. Additionally when having multiple layers, the layer count and height can be set. Layer height can also be negative.
Grid trajectory assignment Matrix Define the dimension of the matrix by defining the number of cells. Moreover the Approach and Retreat group can be set by using the string of the trajectory defined in Trajectory Groups. (See more in the subsection above "How are the trajectories used?")
Trajectory Groups Trajectory[] A list of trajectories. Used for approaching and retreating the pick position or place position of the grid.
Pattern Settings > Pattern Type Select Choose the strategy for moving through the pallet. Select between col-first, row-first, col-first-snake, row-first-snake and individual. When choosing individual the Individual Pattern is considered as the order of the grid strategy.
Pattern Settings > Pattern Type Cell[] Choose the order of the cells, defined by row and column, to iterate through the grid.
Grid ID String ID which identifies the grid among all registered grids. Using the same grid id on multiple grids will overwrite the first grid.
Outputs -
Exceptions INVALID_DATASTORE_VALUE_FOR_GRID_ID - The exception is raised if the grid settings do not match to the datastore entry already existing for this Grid ID.
INVALID_TRAJECTORY_GROUP - The exception is raised if settings of the trajectory group are invalid.
INVALID_APPROACH_GROUP_MATRIX - The exception is raised if a stated approach group is no registered trajectory group.
INVALID_RETREAT_GROUP_MATRIX - The exception is raised if a stated retreat group is no registered trajectory group.
INVALID_INDIVIDUAL_PATTERN - The exception is raised if a stated individual pattern cell is not valid.
INVALID_START_CELL - The exception is raised if the configured start cell is invalid.
INVALID_GRID_DEFINITION - The exception is raised if defining the grid failed for an unknown reason.
MODULE_NOT_AVAILABLE - The exception is raised if the grid manager module is not available. Probably you use the new function blocks with an older version of drag&bot.

What is the Grid Frame?

Three point wizard plane

The Grid Frame is a transformation and it is calculated out of 3 positions defined by the TCP of the robot. It is used to define a start position of the first part in the pallet. The Grid Frame can be reteached by using the Three Point Wizard.

The Column Length and the Row Length is calculated and filled when using the Palletizing Wizard of drag&bot. By reteaching the Grid Frame with the Three Point Wizard the Column Length and Row Length is not updated. The point 2 in the above picture is the default start corner of the palletizing application.

How are the trajectories used?

PPP Trajectories

When processing the grid in the application, an approach and a retreat trajectory are created on every call of the Grid - Get Next Cell function block e.g. by iterating it in a loop. Usually starting at the Start position (Column 1, Row 1, Layer 1). Every cell of the matrix saves the related trajectory as a string in the matrix field. The string which is saved in a cell of the matrix must be available in the Trajectory Groups list. The default the trajectory names are A and B.

PPP Trajectory Groups

Every trajectory usually consists of two waypoints. It consists of an approach and a final pick position waypoint. The order of the retreat trajectory B is the reversed order of trajectory A by default. It is possible to add more waypoints to the trajectory for a more complex path to pickup or retreat.

The poses of each trajectory inside the palletizing position producer are saved relatively to the Grid Frame. The Grid Frame is used as a reference coordinate system for the poses of all waypoints. This has the advantage when changing the pose of the Grid Frame, e.g. because the pallet is moving, it will change the whole application pose. For the palletizing block it is necessary to set the Teached Grid Cell coordinate inside the trajectory, so the block is able to calculate all other grids of the pallet and its approach or retreat trajectory.

What are pattern settings?

PPP Trajectory Groups

A strategy can be chosen on how to iterate through the grid. Select between col-first, row-first, col-first-snake, row-first-snake and individual. When choosing individual the Individual Pattern is considered as the order of the grid strategy.


Grid - Initialize 2

Creates a grid with the given settings. The function block is an alternative to the Grid - Initialize function block described above. It allows better dynamic parametrization by saving the teached corner poses as input parameters, but has less options and is not supported by the Palletizing Wizard.

The Grid - Initialize 2 function block has the following advantages compared to the regular Grid - Initialize function block:

  • The teached cell positions are individually saved and can be linked into the function block. They can be modified individually later.

The Grid - Initialize 2 function block has the following disadvantages compared to the regular Grid - Initialize function block:

  • The approach and retreat trajectory can be used, but the predefined settings for movement type, speed, acceleration and blending can not be changed. The function block is explicitly designed such that the Final Pose output parameter of the Grid - Get Next Cell function block is linked to the pose or pose reference of a Move Cartesian function block.
  • The used approach and retreat trajectories can not be chosen individually for each grid cell.
  • Only regular grids are possible with unmodified start cell.
  • Multiple layers are not possible.
  • The Palletizing Wizard can not be used with the function block.
Name Datatype Description
Inputs Grid Corner X Axis Pose The corner teach pose defining the grid in X direction.
Grid Origin Corner Pose The corner teach pose defining the origin of the grid. The grid will be defined with the other corner positions, defining the directions according to the right hand rule (thumb: X direction, forefinger: Y direction, middle finger: Z direction). The processing of the grid pattern will start in this corner cell.
Grid Corner Y Axis Pose The corner teach pose defining the grid in Y direction.
Cells X Axis Integer Number of cells in the grid in X direction.
Cells Y Axis Integer Number of cells in the grid in Y direction.
Pattern Settings > Pattern Type Select Choose the strategy for moving through the pallet. Select between x-first, y-first, x-first-snake, y-first-snake and individual. When choosing individual the Individual Pattern is considered as the order of the grid strategy.
Pattern Settings > Pattern Type Cell[] Choose the order of the cells, defined by x and y cell numbers, to iterate through the grid.
Grid ID String ID which identifies the grid among all registered grids. Using the same grid id on multiple grids will overwrite the first grid.
Outputs Grid Frame Pose The grid frame defining the origin of the grid.
Exceptions INVALID_DATASTORE_VALUE_FOR_GRID_ID - The exception is raised if the grid settings do not match to the datastore entry already existing for this Grid ID.
INVALID_INDIVIDUAL_PATTERN - The exception is raised if a stated individual pattern cell is not valid.
INVALID_GRID_DEFINITION - The exception is raised if defining the grid failed for an unknown reason.
MODULE_NOT_AVAILABLE - The exception is raised if the grid manager module is not available. Probably you use the new function blocks with an older version of drag&bot.

Grid - Reset

Resets the contents of all cells of a specified grid to a given content.

Name Datatype Description
Inputs Grid ID String ID of the grid, which has to be resetted.
Change Content To Select Content of the cell, where each cell of the grid is changed to. Available are: Raw Part, Processed Part, OK Part, NOK Part, Empty Cell and Deactivated Cell.
Layer Integer A value of 0 sets the entire grid. Other values do just set the respective layer.
Outputs -
Exceptions INVALID_GRID_ID - The exception is raised if the stated grid id can not be found among the registered grids.
INVALID_LAYER - The exception is raised if the stated layer id can not be found in the configured grid.
MODULE_NOT_AVAILABLE - The exception is raised if the grid manager module is not available. Probably you use the new function blocks with an older version of drag&bot.

Grid - Get Next Cell

Searches a given list of grids for a specified content. Afterwards it can change the content of this cell, if requested. If a cell was found, the function block returns the approach and retreat trajectory for this cell, the last pose of the approach trajectory, the grid_id and the position of the cell in the grid.

Name Datatype Description
Inputs Cell Content Select Content of the cell, which is searched for. Available are: Raw Part, Processed Part, OK Part, NOK Part, Empty Cell or any filled cell
Grid IDs String[] IDs of grids, which shall be searched for the specified content.
Change Content To Select Content of the cell, where the found cell is changed to. Available are: Raw Part, Processed Part, OK Part, NOK Part, Empty Cell and let the content of the cell unchanged.
Outputs Found Cell Boolean True if a cell was found for the specified content. False otherwise.
Grid ID String ID of the grid, where the content was found.
Cell Position Position Position of the found cell in the grid. This can be used to do further operations on the cell, like changing the content manually.
Approach Trajectory Trajectory Trajectory to move to the found cell.
Retreat Trajectory Trajectory Trajectory to retreat from the found cell.
Final Pose Pose Target pose of the cell (last pose of the approach trajectory), as an alternative to the trajectories.
Exceptions INVALID_DATASTORE_VALUE_FOR_GRID_ID - The exception is raised if contents of the found grid is not consistent with the respective data on the datastore. This can usually happen if the definition of the grid changes while the content is not adjusted respectively.
MODULE_NOT_AVAILABLE - The exception is raised if the grid manager module is not available. Probably you use the new function blocks with an older version of drag&bot.

Grid - Set Cell Content

Sets the content of a specified cell in a grid to a given content.

Name Datatype Description
Inputs Grid ID String ID of the grid, where the cell has to be set.
Cell Position Position Position of the cell in the grid, which has to be set.
Change Content To Select Content of the cell, where each cell of the grid is changed to. Available are: Raw Part, Processed Part, OK Part, NOK Part, Empty Cell and Deactivated Cell.
Outputs -
Exceptions INVALID_GRID_ID - The exception is raised if the stated grid id can not be found among the registered grids.
INVALID_CELL - The exception INVALID_CELL is raised if the stated cell can not be found in the given grid.
INVALID_DATASTORE_VALUE_FOR_GRID_ID - The exception is raised if contents of the found grid is not consistent with the respective data on the datastore. This can usually happen if the definition of the grid changes while the content is not adjusted respectively.
MODULE_NOT_AVAILABLE - The exception is raised if the grid manager module is not available. Probably you use the new function blocks with an older version of drag&bot.

Grid - Get Cell Trajectories

Returns the trajectories and the final pose of a specified cell in a grid.

Name Datatype Description
Inputs Grid ID String ID of the grid, where the cell has to be searched.
Cell Position Position Position of the cell in the grid.
Outputs Approach Trajectory Trajectory Trajectory to move to the specified cell.
Retreat Trajectory Trajectory Trajectory to retreat from the specified cell.
Final Pose Pose Target pose of the cell (last pose of the approach trajectory), as an alternative to the trajectories.
Exceptions INVALID_GRID_ID - The exception is raised if the stated grid id can not be found among the registered grids.
INVALID_CELL - The exception INVALID_CELL is raised if the stated cell can not be found in the given grid.
MODULE_NOT_AVAILABLE - The exception is raised if the grid manager module is not available. Probably you use the new function blocks with an older version of drag&bot.

CSV Function Blocks

CSV - Read Cell

Reads a cell specified by column and row of a saved csv table on the robot system and returns the respective content.

Name Datatype Description
Inputs Filename String Filename in directory ~/.dnb/data/custom_data/, which should be read.
Row Integer The row in the csv table to read the cell from.
Column Integer The column in the csv table to read the cell from.
Outputs Cell Content String The cell content read from the csv tables cell.
Exceptions FILE_NOT_FOUND - The exception is raised if the stated file can not be found on the robot system at the specified place.
END_OF_TABLE - The exception END_OF_TABLE is raised if the stated cell, defined by column and row, can not be found in the given table.

CSV - Search Column

Searches a specified column in a saved csv table on the robot system for a specified content and returns the respective row.

Name Datatype Description
Inputs Filename String Filename in directory ~/.dnb/data/custom_data/, which should be read.
Text String The content to search the column for.
Column Integer The column in the csv table to search for the content.
Outputs Row Integer The row of the cell, which contains the searched content of the specified column.
Exceptions FILE_NOT_FOUND - The exception is raised if the stated file can not be found on the robot system at the specified place.
END_OF_TABLE - The exception END_OF_TABLE is raised if no row, defined by column and text, can not be found in the given table.

Configure Stop Program On Robot Error

Configures whether a running program is stopped when the robot changes into error state. Stopping the program when the robot changes into error state is the default behavior in the robot system.

Name Datatype Description
Inputs Stop Program On Robot Error Boolean If set to true, a program will be stopped, if the robot goes into error state. If set to false the program will continue in this case. Note that the program will always stop, if the robot is attempting move to while it is in error state. Continuing the program does only apply to no-movement function blocks.
Exceptions SERVICE_NOT_AVAILABLE - The exception SERVICE_NOT_AVAILABLE is raised if the ROS service to change the mode is not available.