Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4Java)  1.26.2
Robot.java
Go to the documentation of this file.
1 // -----------------------------------------------------------------------
2 // MLPI - <Robot.java>
3 // -----------------------------------------------------------------------
4 // Copyright (c) 2012 Bosch Rexroth. All rights reserved.
5 // Redistribution and use in source and binary forms of this MLPI software
6 // (SW) provided to you, with or without modification, are permitted
7 // without prior approval provided that the following conditions are met:
8 //
9 // 1. Redistributions of source code of SW must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 //
12 // 2. Redistributions in binary form of SW must reproduce the above copyright
13 // notice, this list of conditions and the following disclaimer in the
14 // documentation and/or other materials provided with the distribution.
15 //
16 // 3. User recognizes and acknowledges that it acquires no right,
17 // title or interest in or to any of the names or trademarks used in
18 // connection with the SW ("names") by virtue of this License and waives
19 // any right to or interest in the names. User recognizes and acknowledges
20 // that names of companies or names or products of companies displayed
21 // in the documentation of SW to indicate the interoperability of products
22 // with the SW are the names of their respective owners. The use of such
23 // names in the documentation of SW does not imply any sponsorship,
24 // approval, or endorsement by such companies of this product.
25 //
26 // 4. Modified code versions, i.e. any addition to or deletion from
27 // the substance or structure of the original code of the SW running
28 // the MLPI must be plainly marked as such and must not be misrepresented
29 // as being original SW.
30 //
31 // 5. The SW may only be used in connection with a Bosch Rexroth product.
32 //
33 // THIS INFORMATION IS PROVIDED BY BOSCH REXROTH CORPORATION "AS IS"
34 // AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING
35 // (BUT NOTLIMITED TO) ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
36 // FITNESS FOR ANY PARTICULAR PURPOSE, OR NON-INFRINGEMENT. WHILE THE
37 // INFORMATION PROVIDED IS BELIEVED TO BE ACCURATE, IT MAY INCLUDE
38 // ERRORS OR INACCURACIES.
39 // SUBJECT TO COMPULSORY STATUTORY PROVISIONS OF THE GERMAN LAW AS
40 // THE APPLICABLE LAW FOR THIS LICENSE BOSCH REXROTH CORPORATION WILL
41 // NOT BE LIABLE FOR ANY DAMAGES OF ANY KIND ARISING FROM THE USE OF
42 // THE SOFTWARE DISTRIBUTED HEREUNDER, INCLUDING BUT NOT LIMITED TO
43 // DIRECT, INDIRECT, INCIDENTAL, PUNITIVE, AND CONSEQUENTIAL DAMAGES.
44 // -----------------------------------------------------------------------
45 //
55 //
56 // -----------------------------------------------------------------------
57 package com.boschrexroth.mlpi;
58 
59 import java.util.Vector;
62 
84 public class Robot extends MlpiComponent {
85 
97  public enum RobotAxisTypes
98  {
99  ROBOT_AXISTYPE_NONE ( 0),
100  ROBOT_AXISTYPE_POSITIONING ( 8),
101  ROBOT_AXISTYPE_ORIENTATION (16),
102  ROBOT_AXISTYPE_BELT (32);
103 
104  private int _code;
105  int getCode() { return _code; }
106  RobotAxisTypes(int code) { this._code = code; }
107  static RobotAxisTypes valueOf(int code) {
108  for (RobotAxisTypes value : values()) {
109  if (code == value.getCode()) return value;
110  }
111  return null;
112  }
113  }
114 
124  public enum RobotTypes
125  {
126  ROBOT_TYPE_RHO (1),
127  ROBOT_TYPE_RCF (2);
128 
129  private int _code;
130  int getCode() { return _code; }
131  RobotTypes(int code) { this._code = code; }
132  static RobotTypes valueOf(int code) {
133  for (RobotTypes value : values()) {
134  if (code == value.getCode()) return value;
135  }
136  return null;
137  }
138  }
139 
149  public enum RobotSetMode
150  {
151  ROBOT_SETMODE_TO (0),
152  ROBOT_SETMODE_VIA (1);
153 
154  private int _code;
155  int getCode() { return _code; }
156  RobotSetMode(int code) { this._code = code; }
157  static RobotSetMode valueOf(int code) {
158  for (RobotSetMode value : values()) {
159  if (code == value.getCode()) return value;
160  }
161  return null;
162  }
163  }
164 
193  {
194 
195  ROBOT_CS_MCS (0x0000),
196  ROBOT_CS_ACS (0x0001),
197  ROBOT_CS_BCS (0x0002),
198  ROBOT_CS_PCS1 (0x0003),
199  ROBOT_CS_PCS2 (0x0103),
200  ROBOT_CS_PCS3 (0x0203),
201  ROBOT_CS_PCS4 (0x0303),
202  ROBOT_CS_PCS5 (0x0403),
203  ROBOT_CS_PCS6 (0x0503),
204  ROBOT_CS_PCS7 (0x0603),
205  ROBOT_CS_PCS8 (0x0703),
206  ROBOT_CS_PCS9 (0x0803),
207  ROBOT_CS_PCS10 (0x0903),
208  ROBOT_CS_PCS11 (0x0A03),
209  ROBOT_CS_PCS12 (0x0B03),
210  ROBOT_CS_PCS13 (0x0C03),
211  ROBOT_CS_PCS14 (0x0D03),
212  ROBOT_CS_PCS15 (0x0E03),
213  ROBOT_CS_PCS16 (0x0F03),
214  ROBOT_CS_FCS (0x0004);
215 
216  private int _code;
217  int getCode() { return _code; }
218  RobotCoordinateSystem(int code) { this._code = code; }
219  static RobotCoordinateSystem valueOf(int code) {
220  for (RobotCoordinateSystem value : values()) {
221  if (code == value.getCode()) return value;
222  }
223  return null;
224  }
225  }
226 
237  public enum RobotSlopeType
238  {
239  ROBOT_SLOPETYPE_BLOCK_SLOPE (0),
240  ROBOT_SLOPETYPE_PROGR_SLOPE (1),
241  ROBOT_SLOPETYPE_CONT_SLOPE (2);
242 
243 
244  private int _code;
245  int getCode() { return _code; }
246  RobotSlopeType(int code) { this._code = code; }
247  static RobotSlopeType valueOf(int code) {
248  for (RobotSlopeType value : values()) {
249  if (code == value.getCode()) return value;
250  }
251  return null;
252  }
253  }
254 
266  {
267  ROBOT_BELT_ERROR_NO_SPECIFIC_REACTION (0),
268  ROBOT_BELT_ERROR_DESYNC_OVER_TIME (1),
269  ROBOT_BELT_ERROR_DESYNC_WITH_LIMITS (2);
270 
271 
272  private int _code;
273  int getCode() { return _code; }
274  RobotSyncErrorReactionMode(int code) { this._code = code; }
275  static RobotSyncErrorReactionMode valueOf(int code) {
276  for (RobotSyncErrorReactionMode value : values()) {
277  if (code == value.getCode()) return value;
278  }
279  return null;
280  }
281  }
282 
298  public enum RobotMechCmd
299  {
300  ROBOT_MECH_CREATE_ROD (0),
301  ROBOT_MECH_CREATE_SPHERE (1),
302  ROBOT_MECH_POSITION (2),
303  ROBOT_MECH_DIRECTION (3),
304  ROBOT_MECH_SIZE (4),
305  ROBOT_MECH_CREATE_CUBOID (5),
306  ROBOT_MECH_SET_MCS (6),
307  ROBOT_MECH_ROTATE (7);
308 
309  private int _code;
310  int getCode() { return _code; }
311  RobotMechCmd(int code) { this._code = code; }
312  static RobotMechCmd valueOf(int code) {
313  for (RobotMechCmd value : values()) {
314  if (code == value.getCode()) return value;
315  }
316  return null;
317  }
318  }
319 
329  public enum RobotCSType{
330  ROBOT_CARTESIAN (0),
331  ROBOT_CYLINDRIC (1);
332 
333  private int _code;
334  int getCode() { return _code; }
335  RobotCSType(int code) { this._code = code; }
336  static RobotCSType valueOf(int code) {
337  for (RobotCSType value : values()) {
338  if (code == value.getCode()) return value;
339  }
340  return null;
341  }
342  }
343 
354  public enum RobotCyclicMode
355  {
356  ROBOT_CYCLIC_MODE_POS_ABS (0),
357  ROBOT_CYCLIC_MODE_POS_REL (1),
358  ROBOT_CYCLIC_MODE_VEL (2);
359 
360 
361  private int _code;
362  int getCode() { return _code; }
363  RobotCyclicMode(int code) { this._code = code; }
364  static RobotCyclicMode valueOf(int code) {
365  for (RobotCyclicMode value : values()) {
366  if (code == value.getCode()) return value;
367  }
368  return null;
369  }
370  }
371 
382  public enum RobotSafeZoneType{
383  ROBOT_SAFE_ZONE_TYPE_DEACTIVATED (0),
384  ROBOT_SAFE_ZONE_TYPE_INSIDE_OK (1),
385  ROBOT_SAFE_ZONE_TYPE_OUTSIDE_OK (2);
386 
387  private int _code;
388  int getCode() { return _code; }
389  RobotSafeZoneType(int code) { this._code = code; }
390  static RobotSafeZoneType valueOf(int code) {
391  for (RobotSafeZoneType value : values()) {
392  if (code == value.getCode()) return value;
393  }
394  return null;
395  }
396  }
397 
410  public enum RobotCmdInfoType
411  {
412  MLPI_ROBOT_CMD_INFO_TYPE_ALL (0),
413  MLPI_ROBOT_CMD_DATA_TYPE_PROGRESS (1),
414  MLPI_ROBOT_CMD_DATA_TYPE_TOTAL_DISTANCE (2),
415  MLPI_ROBOT_CMD_DATA_TYPE_UID (3),
416  MLPI_ROBOT_CMD_DATA_TYPE_STATE (4);
417 
418  private int _code;
419  int getCode() { return _code; }
420  RobotCmdInfoType(int code) { this._code = code; }
421  static RobotCmdInfoType valueOf(int code) {
422  for (RobotCmdInfoType value : values()) {
423  if (code == value.getCode()) return value;
424  }
425  return null;
426  }
427  }
428 
429  /*
430  * Structs
431  */
432 
449  public static class RobotTrafoParameter{
450  public RobotTrafoParameter(){}
451 
452  public RobotTrafoParameter(Robot.RobotCoordinateSystem coordSys, double posX, double posY, double posZ, double rotA, double rotB, double rotC, RobotCSType csType){
453  this.coordSys = coordSys;
454  this.posX = posX;
455  this.posY = posY;
456  this.posZ = posZ;
457  this.rotA = rotA;
458  this.rotB = rotB;
459  this.rotC = rotC;
460  this.csType = csType;
461  }
462 
463  public Robot.RobotCoordinateSystem coordSys; //tbd JUR: wie muss hier die Datentypdeklaration realisiert werden innerhalb von Java?
464  public double posX;
465  public double posY;
466  public double posZ;
467  public double rotA;
468  public double rotB;
469  public double rotC;
470  public RobotCSType csType;
471  }
472 
490  public static class RobotBeltConfigValues{
491  public RobotBeltConfigValues(){}
492 
493  public RobotBeltConfigValues(double posX, double posY, double posZ, double rotA, double rotB, double rotC, double begin, double total, RobotCSType csType){
494 
495  this.posX = posX;
496  this.posY = posY;
497  this.posZ = posZ;
498  this.rotA = rotA;
499  this.rotB = rotB;
500  this.rotC = rotC;
501  this.begin = begin;
502  this.total = total;
503  this.csType = csType;
504  }
505 
506  public double posX;
507  public double posY;
508  public double posZ;
509  public double rotA;
510  public double rotB;
511  public double rotC;
512  public double begin;
513  public double total;
514  public RobotCSType csType;
515  }
516 
529  public static class RobotBeltErrorReactionValues{
531 
532  public RobotBeltErrorReactionValues(RobotSyncErrorReactionMode errorType, double time, double deceleration, double jerk)
533  {
534  this.time = time;
535  this.deceleration = deceleration;
536  this.jerk = jerk;
537  this.errorType = errorType;
538  }
539 
540  public RobotSyncErrorReactionMode errorType;
541  public double time;
542  public double deceleration;
543  public double jerk;
544 
545  }
546 
557  public static class GroupRef
558  {
559  public GroupRef(int groupNo) {
560  this.groupNo = (short)groupNo;
561  this.controlNo = 0;
562  }
563  public GroupRef(short groupNo) {
564  this.groupNo = groupNo;
565  this.controlNo = 0;
566  }
567  public short controlNo;
568  public short groupNo;
569  }
570 
582  public static class RobotInformation
583  {
584  public RobotInformation(GroupRef group, RobotTypes robotType, String name){
585  this.group = group;
586  this.robotType = robotType;
587  this.name = name;
588  }
589  public RobotInformation(){}
590 
591  public GroupRef group = new GroupRef(0);
592  public RobotTypes robotType;
593  public String name;
594  }
595 
609  public static class RobotPerformanceResult
610  {
611  public RobotPerformanceResult(String name, long count, double min, double max, double avg){
612  this.name = name;
613  this.count = count;
614  this.min = min;
615  this.max = max;
616  this.avg = avg;
617  }
618  public RobotPerformanceResult(){}
619 
620  public String name;
621  public long count;
622  public double min;
623  public double max;
624  public double avg;
625  }
626 
640  public static class RobotMechanicData
641  {
642  public RobotMechanicData(RobotMechCmd cmd, String object, double x, double y, double z){
643  this.cmd = cmd;
644  this.object = object;
645  this.x = x;
646  this.y = y;
647  this.z = z;
648  }
649  public RobotMechanicData(){}
650 
651  public RobotMechCmd cmd;
652  public String object;
653  public double x;
654  public double y;
655  public double z;
656  }
657 
669  public static class RobotAxisConfiguration
670  {
671  public RobotAxisConfiguration(short axisConfiguration, short controlNumber, short axisNumber){
672  this.axisConfiguration = axisConfiguration;
673  this.controlNumber = controlNumber;
674  this.axisNumber = axisNumber;
675  }
676  public RobotAxisConfiguration(){}
677 
678  public short axisConfiguration;
679  public short controlNumber;
680  public short axisNumber;
681  };
682 
700  public static class RobotKinematicsValues
701  {
702  public RobotPoint actualPosition;
703  public double actualVelocity;
704  public double actualAcceleration;
705  public int state;
706  public int stateExtended;
707  public int diagnosisNumber;
708  }
709 
722  public static class RobotKinematicsUnits
723  {
724  public String position;
725  public String velocity;
726  public String acceleration;
727  }
728 
742  public static class RobotCoordinateSystemInfo
743  {
744  public int cs;
745  public int dimension;
746  public String name;
747  public String posunits;
748  }
749 
771  public static class RobotStatusSummary
772  {
773  public GroupRef group;
774  public int coordSys; // tbd: eigentlich muss hier Robot.RobotCoordinateSystem genutzt werden
775  public int state;
776  public int stateExtended;
777  public int diagnosisNumber;
778  public int dimension;
779  public RobotPoint actualPosition;
780  public String actualPosUnit;
781  public double actualVelocity;
782  public double actualAcceleration;
783  public double actualJerk;
784  public String pathUnit;
785  public String timeBase;
786  }
787 
788 
799  public static class RobotStatusSummaryIn
800  {
801  public RobotStatusSummaryIn(GroupRef group, int coordSys){
802  this.group = group;
803  this.coordSys = coordSys;
804  }
805  public RobotStatusSummaryIn(){}
806  public GroupRef group = new GroupRef(0);
807  public int coordSys;
808  }
809 
810 
825  public static class RobotSafeZoneData
826  {
827  public double zoneNumber;
828 
829  public double pointPosX;
830  public double pointPosY;
831  public double pointPosZ;
832 
833  public double pointNegX;
834  public double pointNegY;
835  public double pointNegZ;
836 
837  public Robot.RobotSafeZoneType zoneType;
838 
839 
840  }
841 
852  public static class RobotMotionHandle
853  {
854  public RobotMotionHandle(long cmdID){
855  this.cmdID = cmdID;
856  }
857  public RobotMotionHandle(){}
858  public long cmdID;
859  }
860 
872  public static class RobotCmdInfo
873  {
874  public RobotCmdInfo(long commandID, RobotCmdInfoType infoType, double value){
875  this.commandID = commandID;
876  this.infoType = infoType;
877  this.value = value;
878  }
879  public RobotCmdInfo(){}
880  public long commandID;
881  public RobotCmdInfoType infoType;
882  public double value;
883  }
884  /*
885  * Fields
886  */
887  Vector<Group> _groups = new Vector<Group>();
888 
889  /*
890  * Methods
891  */
892 
896  Robot(MlpiHandle connection) {
897  super(connection);
898  }
899 
904  public Group groups(short groupNo) {
905  return groups((int)groupNo);
906  }
907 
912  public synchronized Group groups(int groupNo) {
913  Group group = null;
914  if (groupNo <= _groups.size()) {
915  group = _groups.get(groupNo-1);
916  }
917  if (group == null) {
918  group = new Group(getConnectionHandleObject(), new GroupRef(groupNo));
919  if (groupNo > _groups.size()) {
920  for (int i=_groups.size(); i<groupNo; i++){
921  _groups.add(null);
922  }
923  }
924  _groups.set(groupNo-1, group);
925  }
926  return group;
927  }
928 
934  public RobotPoint CreatePoint( double point[], Robot.RobotCoordinateSystem type){
935  return new RobotPoint(point, type);
936  }
937 
944  public native RobotInformation[] GetConfiguredGroups();
945 
958 
967  public native RobotKinematicsUnits[] GetKinematicsUnits(GroupRef[] groups);
968 
995  public native RobotStatusSummary[] GetStatusSummary(RobotStatusSummaryIn[] statusSummaryIn);
996 }
synchronized Group groups(int groupNo)
Definition: Robot.java:912
This class defines the parameters of the GetCSInfo command. You may want to use this class to read al...
Definition: Robot.java:742
This class defines the axis through the definition of control and axis number.
Definition: Motion.java:417
This class defines the command ID of a motion command (motionhandle). You may want to use this class ...
Definition: Robot.java:852
Structure containing units of the kinematics as strings. You may want to use this structure to read a...
Definition: Robot.java:722
This enumeration must be used when defining the slope for blending.
Definition: Robot.java:237
This enumeration defines type of a coordinate system.
Definition: Robot.java:329
Class definition of the mlpiRobotLib.
Definition: Robot.java:84
This class defines the parameter values for a product coordinate transformation.
Definition: Robot.java:529
native RobotInformation[] GetConfiguredGroups()
This enumeration defines the type of an axis for the robot.
Definition: Robot.java:97
This enumeration defines the type of a safe zone.
Definition: Robot.java:382
Group groups(short groupNo)
Definition: Robot.java:904
This class defines the parameters of the StatusSummary command.
Definition: Robot.java:771
native RobotKinematicsValues[] GetKinematicsValues(GroupRef[] groups)
This class defines the parameters of the GetSafeZones command. You may want to use this class to read...
Definition: Robot.java:825
This class defines the reference in order to reference to the connected control and the robot that wi...
Definition: Robot.java:557
This class defines the inputparameters of the StatusSummary command.
Definition: Robot.java:799
This class defines the parameter values for a product coordinate transformation.
Definition: Robot.java:490
native RobotKinematicsUnits[] GetKinematicsUnits(GroupRef[] groups)
This enumeration defines the reaction of errors while sync moves.
Definition: Robot.java:265
Structure containing operation information about an kinematic. These values do change as soon as the ...
Definition: Robot.java:700
This enum defines the type of a cyclic position command.
Definition: Robot.java:354
This class defines the data for a command for a mechanic object.
Definition: Robot.java:640
This enumeration defines the possible coordinate systems.
Definition: Robot.java:192
RobotPoint CreatePoint(double point[], Robot.RobotCoordinateSystem type)
Definition: Robot.java:934
This class defines the data for a command for a mechanic object.
Definition: Robot.java:872
This class defines the parameter values for a coordinate transformation.
Definition: Robot.java:449
Class definition of the MotionLib.
Definition: Motion.java:66
This enumeration must be used to define which robotic kernel will be used.
Definition: Robot.java:124
This enumeration defines the command for a mechanical object.
Definition: Robot.java:298
This enumeration defines the type of information which should be read.
Definition: Robot.java:410
This enumeration must be used when defining the blending.
Definition: Robot.java:149
This class defines the result for the performance check.
Definition: Robot.java:609
This class defines all configured kinematics.
Definition: Robot.java:582
This class defines the configuration of the axis.
Definition: Robot.java:669
native RobotStatusSummary[] GetStatusSummary(RobotStatusSummaryIn[] statusSummaryIn)