Difference between revisions of "Moving Robots via CRI"
(Created page with "Category:CPRogCategory: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 t...") |
|||
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) | * Camera interface (2D coordinate, orientation and object type) | ||
* Jog via CRI (velocity values) | * Jog via CRI (velocity values) | ||
Line 13: | Line 13: | ||
= Jog via CRI = | = Jog via CRI = | ||
− | The [[CRI Ethernet Interface]] includes the ALIVEJOG command, which can be used to move the robot by specifying velocity values per joint or cartesian axis | + | 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 = | = Positioning commands via CRI = | ||
Line 19: | Line 19: | ||
= Program variables via CRI = | = 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 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: | ||
+ | # 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. | ||
+ | # Run this program on the robot or in CPRog/iRC | ||
+ | # 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. | ||
+ | |||
+ | [[File:ExampleTargetPosition.JPG]] |
Revision as of 09:40, 19 November 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:
- Camera interface (2D coordinate, orientation and object type)
- Jog via CRI (velocity values)
- Program variables via CRI (position or scalar number), we generally recommend this approach!
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
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:
- 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.
- Run this program on the robot or in CPRog/iRC
- 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.