Difference between revisions of "Moving Robots via CRI"

From Wiki
m (Changed order of sections)
Line 1: Line 1:
 
[[Category:CPRog]][[Category:TinyCtrl]]
 
[[Category:CPRog]][[Category:TinyCtrl]]
 
While many use-cases can be solved solely by a robot program some require the robot to move to coordinates from external sources. For these cases CPRog/iRC and TinyCtrl offer the following interfaces:
 
While many use-cases can be solved solely by a robot program some require the robot to move to coordinates from external sources. For these cases CPRog/iRC and TinyCtrl offer the following interfaces:
* Camera interface (2D coordinate, orientation and object type)
 
 
* Jog via CRI (velocity values)
 
* Jog via CRI (velocity values)
 
* Program variables via CRI (position or scalar number), '''we generally recommend this approach!'''
 
* Program variables via CRI (position or scalar number), '''we generally recommend this approach!'''
 +
* Camera interface (2D coordinate, orientation and object type)
  
 
This article gives an overview on how to use these interfaces to command the robot to move to specific positions.
 
This article gives an overview on how to use these interfaces to command the robot to move to specific positions.
 
= Camera interface =
 
The camera interface uses a simple text-based TCP/IP protocol that is based on the IFM O2D camera. It transmits 2D coordinates (integer), an orientation value (float) and a object class value (integer). If you do not want to use the CRI protocol this can be used to transmit coordinates or arbitrary values, however some extra calculations might be necessary to shift the integer values to decimal accuracy, if needed. This article describes how to use the camera interface: [[Remote Variable Access#Camera interface]]
 
 
If you want to integrate an O2D camera follow this guide: [[2D Camera Integration]]
 
  
 
= Jog via CRI =
 
= Jog via CRI =
Line 29: Line 24:
  
 
[[File:ExampleTargetPosition.JPG]]
 
[[File:ExampleTargetPosition.JPG]]
 +
 +
= Camera interface =
 +
The camera interface uses a simple text-based TCP/IP protocol that is based on the IFM O2D camera. It transmits 2D coordinates (integer), an orientation value (float) and a object class value (integer). If you do not want to use the CRI protocol this can be used to transmit coordinates or arbitrary values, however some extra calculations might be necessary to shift the integer values to decimal accuracy, if needed. This article describes how to use the camera interface: [[Remote Variable Access#Camera interface]]
 +
 +
If you want to integrate an O2D camera follow this guide: [[2D Camera Integration]]

Revision as of 16:45, 1 December 2020

While many use-cases can be solved solely by a robot program some require the robot to move to coordinates from external sources. For these cases CPRog/iRC and TinyCtrl offer the following interfaces:

  • Jog via CRI (velocity values)
  • Program variables via CRI (position or scalar number), we generally recommend this approach!
  • Camera interface (2D coordinate, orientation and object type)

This article gives an overview on how to use these interfaces to command the robot to move to specific positions.

Jog via CRI

The CRI Ethernet Interface includes the ALIVEJOG command, which can be used to move the robot by specifying velocity values (percent) per joint or cartesian axis. This approach can be used for joystick-like motion.

Positioning commands via CRI

Currently no CRI commands for moving the robot to specific positions are available. Instead we suggest the program variable approach as described in the following section.

Program variables via CRI

The recommended approach is to use the CRI Ethernet Interface to transmit position or scalar variables that can be read and changed in robot programs. The CRI commands in question are described here: Remote Variable Access#CRI Ethernet Interface

The general approach is this:

  1. Create a robot program that initializes a position variable, then uses a motion-by-variable command in an infinite loop to move to this variable position (see the example below). The infinite loop is necessary since the store command re-initializes the variable and therefore overwrites any value received via CRI.
  2. Run this program on the robot or in CPRog/iRC
  3. Connect your CRI client and make it send new positions whenever necessary

You may use a more complex robot program for this, e.g. if you also want to control a gripper or digital outputs.

ExampleTargetPosition.JPG

Camera interface

The camera interface uses a simple text-based TCP/IP protocol that is based on the IFM O2D camera. It transmits 2D coordinates (integer), an orientation value (float) and a object class value (integer). If you do not want to use the CRI protocol this can be used to transmit coordinates or arbitrary values, however some extra calculations might be necessary to shift the integer values to decimal accuracy, if needed. This article describes how to use the camera interface: Remote Variable Access#Camera interface

If you want to integrate an O2D camera follow this guide: 2D Camera Integration