Difference between revisions of "COBOTTA Rest API"
m |
|||
Line 10: | Line 10: | ||
* Reset COBOTTA error | * Reset COBOTTA error | ||
* Get COBOTTA status information | * Get COBOTTA status information | ||
− | * Get/Set COBOTTA | + | * Get/Set COBOTTA speed |
* Get a list of robot programs <br> | * Get a list of robot programs <br> | ||
The API is acessable on localhost port 8280. | The API is acessable on localhost port 8280. | ||
Line 16: | Line 16: | ||
|} | |} | ||
− | == | + | ==PUT== |
− | ===/cobotta/ | + | ===/cobotta/Reference/=== |
− | + | This method sould be called once after switching on the COBOTTA or if the COBOTTA had a hard collision. | |
+ | The COBOTTA prepares it's system for operation and drives to the CALSET position. | ||
+ | Make sure that there are no obstacles around the COBOTTA before running the motion preperation. | ||
+ | Refer to manual ID : 7291 for detaild information about COBOTTA startup. | ||
+ | After axis calibration the "HOME" program is started. HOME program has to be defined in CobottaWorld app. | ||
'''Parameter:'''<br> | '''Parameter:'''<br> | ||
− | '' | + | ''execute:'' (bool as int 0/1) execute the operation <br> |
− | |||
− | |||
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/ | + | http://127.0.0.1:8280/cobotta/Reference/ |
Parameter: | Parameter: | ||
− | {" | + | {"execute" : 1} |
</pre> | </pre> | ||
'''Return''' | '''Return''' | ||
Line 36: | Line 38: | ||
</pre> | </pre> | ||
− | + | ===/cobotta/Program/Start=== | |
− | + | Start a CobottaWorld program. | |
− | ===/cobotta/Program/Start | ||
− | |||
The program name is handled internally as upper case. | The program name is handled internally as upper case. | ||
'''Parameter:'''<br> | '''Parameter:'''<br> | ||
+ | ''execute:'' (bool as int 0/1) execute the operation <br> | ||
''progname:'' (str) name of CobottaWorld robot program<br> | ''progname:'' (str) name of CobottaWorld robot program<br> | ||
− | ''mode:'' (int) execution mode -- default: 1 <br> | + | ''mode:'' (optional)(int) execution mode -- default: 1 <br> |
1:One cycle execution <br> | 1:One cycle execution <br> | ||
2:Continuous execution <br> | 2:Continuous execution <br> | ||
Line 53: | Line 54: | ||
http://127.0.0.1:8280/cobotta/Program/Start/ | http://127.0.0.1:8280/cobotta/Program/Start/ | ||
Parameter: | Parameter: | ||
− | {"progname" : "HOME"} | + | {"execute" : 1, |
+ | "progname" : "HOME"} | ||
</pre> | </pre> | ||
'''Return''' | '''Return''' | ||
Line 60: | Line 62: | ||
</pre> | </pre> | ||
− | ===/cobotta/ | + | ===/cobotta/Program/Stop/=== |
− | + | Stops all running robot programs. <br> | |
+ | Programs will be stopped immediately and connot be continued. | ||
+ | |||
+ | '''Parameter:'''<br> | ||
+ | ''execute:'' (bool as int 0/1) execute the operation <br> | ||
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/ | + | http://127.0.0.1:8280/cobotta/Program/Stop/ |
Parameter: | Parameter: | ||
− | {" | + | {"execute" : 1} |
</pre> | </pre> | ||
'''Return''' | '''Return''' | ||
Line 74: | Line 80: | ||
</pre> | </pre> | ||
− | ===/cobotta/ | + | ===/cobotta/Program/Hold/=== |
− | + | End all running robot programs.<br> | |
− | + | Program will be stopped. The program can be continued by issuing Resume command. | |
− | '''Parameter:''' <br> | + | '''Parameter:'''<br> |
− | '' | + | ''execute:'' (bool as int 0/1) execute the operation <br> |
− | |||
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/ | + | http://127.0.0.1:8280/cobotta/Program/Hold/ |
Parameter: | Parameter: | ||
− | {" | + | {"execute" : 1} |
</pre> | </pre> | ||
'''Return''' | '''Return''' | ||
Line 93: | Line 98: | ||
</pre> | </pre> | ||
− | ===/cobotta/ | + | ===/cobotta/Program/Resume/=== |
− | + | Continues a CobottaWorld robot program. E.g. after error reset.<br> | |
+ | The program has to be started with "StartProgram" method, first. | ||
− | '''Parameter:''' <br> | + | '''Parameter:'''<br> |
− | '' | + | ''execute:'' (bool as int 0/1) execute the operation <br> |
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/ | + | http://127.0.0.1:8280/cobotta/Program/Resume/ |
Parameter: | Parameter: | ||
− | {" | + | {"execute" : 1} |
</pre> | </pre> | ||
'''Return''' | '''Return''' | ||
<pre> | <pre> | ||
− | {" | + | {"result" : "OK"} |
− | |||
</pre> | </pre> | ||
− | + | ===/cobotta/Speed/=== | |
− | ===/cobotta/ | + | Set COBOTTA speed to specified value. |
+ | |||
+ | '''Parameter:'''<br> | ||
+ | ''value:'' (int) Speed set value [%] | ||
+ | |||
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/ | + | http://127.0.0.1:8280/cobotta/Speed/ |
+ | Parameter: | ||
+ | {"speed" : 50} | ||
</pre> | </pre> | ||
'''Return''' | '''Return''' | ||
Line 122: | Line 133: | ||
</pre> | </pre> | ||
− | ===/cobotta/ | + | ===/cobotta/Io/<number>/=== |
− | + | Write IO variable to COBOTTA. <br> | |
− | + | Some IO signals are predefined and restricted to use. Please refer to COBOTTA manual ID : 7261 or check the signal's comments in Remote TP App. | |
− | + | ||
− | + | '''Parameter:''' <br> | |
− | + | ''number:'' (int) number of IO <br> | |
+ | ''value:'' (bool as int 0/1) value of IO variable | ||
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/ | + | http://127.0.0.1:8280/cobotta/Io/128 |
+ | Parameter: | ||
+ | {"value" : 1} | ||
</pre> | </pre> | ||
'''Return''' | '''Return''' | ||
Line 138: | Line 152: | ||
</pre> | </pre> | ||
+ | |||
+ | ==GET== | ||
===/cobotta/Program/GetList/=== | ===/cobotta/Program/GetList/=== | ||
− | Get the program names of CobottaWorld programs and returns them as string array. | + | Get the program names of CobottaWorld programs and returns them as string array.<br> |
− | The update is also done during the instantiation. | + | The update is also done during the instantiation.<br> |
If your program isn't listed you may need to update the "Job_PCS.h" file. | If your program isn't listed you may need to update the "Job_PCS.h" file. | ||
Line 153: | Line 169: | ||
</pre> | </pre> | ||
− | ===/cobotta/ | + | ===/cobotta/Error/Reset=== |
− | + | Resets all errors of COBOTTA. | |
− | |||
− | ''' | + | '''Parameter:'''<br> |
− | + | ''execute:'' (bool as int 0/1) execute the operation <br> | |
− | |||
− | < | ||
− | ''' | ||
− | < | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/ | + | http://127.0.0.1:8280/cobotta/Error/Reset/ |
+ | Parameter: | ||
+ | {"execute" : 1} | ||
</pre> | </pre> | ||
'''Return''' | '''Return''' | ||
Line 179: | Line 186: | ||
</pre> | </pre> | ||
− | ===/cobotta/ | + | ===/cobotta/Error/=== |
− | + | Returns the number of currently issued errors. <br> | |
− | + | If it returns an error count of 0 then there is no error.<br> | |
− | + | Also returns an array of error deails. Containing an error code and a description text. | |
− | |||
− | < | ||
− | |||
− | < | ||
− | |||
− | |||
− | |||
− | |||
− | + | '''Returns:''' <br> | |
− | + | ''errorCount:'' (int) number of currently issued errors<br> | |
+ | ''details:'' (obj[]) array of error details containing errorCode and errorMessage<br> | ||
+ | ''errorCode:'' (int) COBOTTA error number<br> | ||
+ | ''errorMessage:'' (str) error description text.<br> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/ | + | http://127.0.0.1:8280/cobotta/Error/ |
</pre> | </pre> | ||
'''Return''' | '''Return''' | ||
<pre> | <pre> | ||
{"result" : "OK", | {"result" : "OK", | ||
− | "errorCount" : count } | + | "errorCount" : count, |
+ | "details" : [{ "errorCode": code, | ||
+ | "errorMessage": description | ||
+ | }] } | ||
</pre> | </pre> | ||
− | ===/cobotta/ | + | ===/cobotta/Speed/=== |
− | Read current COBOTTA | + | Read current COBOTTA speed. |
+ | |||
+ | '''Returns:''' <br> | ||
+ | ''speed:'' (int) current COBOTTA speed value [%] | ||
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/ | + | http://127.0.0.1:8280/cobotta/Speed/ |
</pre> | </pre> | ||
'''Return''' | '''Return''' | ||
<pre> | <pre> | ||
{"result" : "OK", | {"result" : "OK", | ||
− | " | + | "speed" : 50 } |
</pre> | </pre> | ||
===/cobotta/Status/=== | ===/cobotta/Status/=== | ||
− | Read status variables from COBOTTA. | + | Read status variables from COBOTTA. |
+ | |||
+ | '''Returns:''' <br> | ||
+ | COBOTTA staus variables. <br> | ||
+ | ''connectedStatus:'' (bool as int 0/1) Connection between Robotino and COBOTTA is established<br> | ||
+ | ''busyStatus:'' (bool as int 0/1) COBOTTA is executing a program<br> | ||
+ | ''emergencyStop:'' (bool as int 0/1) COBOTTA emergency stop is pressed<br> | ||
+ | ''errorStatus:'' (bool as int 0/1) COBOTTA in error state<br> | ||
'''Example''' | '''Example''' | ||
Line 241: | Line 245: | ||
<pre> | <pre> | ||
{"result" : "OK", | {"result" : "OK", | ||
− | " | + | "connectedStatus" : value, |
− | "busyStatus" : | + | "busyStatus" : value, |
− | " | + | "emergencyStop" : value, |
− | " | + | "errorStatus" : value } |
− | |||
− | |||
</pre> | </pre> | ||
− | ===/cobotta/Status/ | + | |
− | + | ===/cobotta/Status/Referenced=== | |
+ | Checks if the COBOTTA has already performed reference motion (CALSET). <br> | ||
+ | Reference motion has to be done once after startup/connecting to COBOTTA. | ||
+ | |||
+ | '''Returns:''' <br> | ||
+ | ''referencedStatus:'' (bool as int 0/1) COBOTTA referenced staus. | ||
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/Status/ | + | http://127.0.0.1:8280/cobotta/Status/Referenced |
</pre> | </pre> | ||
'''Return''' | '''Return''' | ||
<pre> | <pre> | ||
{"result" : "OK", | {"result" : "OK", | ||
− | " | + | "referencedStatus" : value} |
− | |||
− | |||
</pre> | </pre> | ||
− | ===/cobotta/Io/< | + | |
− | Read IO variable from COBOTTA. | + | ===/cobotta/Io/<number>=== |
− | Some IO signals are predefined. Please refer to COBOTTA manual ID : 7261 or check the signal's comments in Remote TP App. | + | Read IO variable from COBOTTA. <br> |
+ | Some IO signals are predefined. Please refer to COBOTTA manual ID : 7261 or check the signal's comments in Remote TP App. <br> | ||
+ | Default user IOs start at IO 128 | ||
'''Parameter:''' <br> | '''Parameter:''' <br> | ||
− | '' | + | ''number:'' (int) number of IO <br> |
− | Returns: <br> | + | '''Returns:''' <br> |
− | (bool) IO variable value | + | ''value:'' (bool as int 0/1) IO variable value. |
'''Example''' | '''Example''' | ||
Line 280: | Line 287: | ||
<pre> | <pre> | ||
{"result" : "OK", | {"result" : "OK", | ||
− | " | + | "value" : value} |
− | |||
− | |||
</pre> | </pre> | ||
Revision as of 14:59, 4 May 2021
Contents
Introduction
This RESTful API which uses cobottabcap python class to communicate with denso robotics COBOTTA. It provides several PUT/GET methods to control the COBOTTA such as
The API is acessable on localhost port 8280. All parameters and return values will be json object style. |
PUT
/cobotta/Reference/
This method sould be called once after switching on the COBOTTA or if the COBOTTA had a hard collision. The COBOTTA prepares it's system for operation and drives to the CALSET position. Make sure that there are no obstacles around the COBOTTA before running the motion preperation. Refer to manual ID : 7291 for detaild information about COBOTTA startup. After axis calibration the "HOME" program is started. HOME program has to be defined in CobottaWorld app.
Parameter:
execute: (bool as int 0/1) execute the operation
Example
http://127.0.0.1:8280/cobotta/Reference/ Parameter: {"execute" : 1}
Return
{"result" : "OK"}
/cobotta/Program/Start
Start a CobottaWorld program. The program name is handled internally as upper case.
Parameter:
execute: (bool as int 0/1) execute the operation
progname: (str) name of CobottaWorld robot program
mode: (optional)(int) execution mode -- default: 1
1:One cycle execution
2:Continuous execution
3:Step forward
Example
http://127.0.0.1:8280/cobotta/Program/Start/ Parameter: {"execute" : 1, "progname" : "HOME"}
Return
{"result" : "OK"}
/cobotta/Program/Stop/
Stops all running robot programs.
Programs will be stopped immediately and connot be continued.
Parameter:
execute: (bool as int 0/1) execute the operation
Example
http://127.0.0.1:8280/cobotta/Program/Stop/ Parameter: {"execute" : 1}
Return
{"result" : "OK"}
/cobotta/Program/Hold/
End all running robot programs.
Program will be stopped. The program can be continued by issuing Resume command.
Parameter:
execute: (bool as int 0/1) execute the operation
Example
http://127.0.0.1:8280/cobotta/Program/Hold/ Parameter: {"execute" : 1}
Return
{"result" : "OK"}
/cobotta/Program/Resume/
Continues a CobottaWorld robot program. E.g. after error reset.
The program has to be started with "StartProgram" method, first.
Parameter:
execute: (bool as int 0/1) execute the operation
Example
http://127.0.0.1:8280/cobotta/Program/Resume/ Parameter: {"execute" : 1}
Return
{"result" : "OK"}
/cobotta/Speed/
Set COBOTTA speed to specified value.
Parameter:
value: (int) Speed set value [%]
Example
http://127.0.0.1:8280/cobotta/Speed/ Parameter: {"speed" : 50}
Return
{"result" : "OK"}
/cobotta/Io/<number>/
Write IO variable to COBOTTA.
Some IO signals are predefined and restricted to use. Please refer to COBOTTA manual ID : 7261 or check the signal's comments in Remote TP App.
Parameter:
number: (int) number of IO
value: (bool as int 0/1) value of IO variable
Example
http://127.0.0.1:8280/cobotta/Io/128 Parameter: {"value" : 1}
Return
{"result" : "OK"}
GET
/cobotta/Program/GetList/
Get the program names of CobottaWorld programs and returns them as string array.
The update is also done during the instantiation.
If your program isn't listed you may need to update the "Job_PCS.h" file.
Example
http://127.0.0.1:8280/cobotta/Program/GetList/
Return
{"result" : "OK", "programs" : ["HOME", "PickPart", "PropPart"]}
/cobotta/Error/Reset
Resets all errors of COBOTTA.
Parameter:
execute: (bool as int 0/1) execute the operation
Example
http://127.0.0.1:8280/cobotta/Error/Reset/ Parameter: {"execute" : 1}
Return
{"result" : "OK"}
/cobotta/Error/
Returns the number of currently issued errors.
If it returns an error count of 0 then there is no error.
Also returns an array of error deails. Containing an error code and a description text.
Returns:
errorCount: (int) number of currently issued errors
details: (obj[]) array of error details containing errorCode and errorMessage
errorCode: (int) COBOTTA error number
errorMessage: (str) error description text.
Example
http://127.0.0.1:8280/cobotta/Error/
Return
{"result" : "OK", "errorCount" : count, "details" : [{ "errorCode": code, "errorMessage": description }] }
/cobotta/Speed/
Read current COBOTTA speed.
Returns:
speed: (int) current COBOTTA speed value [%]
Example
http://127.0.0.1:8280/cobotta/Speed/
Return
{"result" : "OK", "speed" : 50 }
/cobotta/Status/
Read status variables from COBOTTA.
Returns:
COBOTTA staus variables.
connectedStatus: (bool as int 0/1) Connection between Robotino and COBOTTA is established
busyStatus: (bool as int 0/1) COBOTTA is executing a program
emergencyStop: (bool as int 0/1) COBOTTA emergency stop is pressed
errorStatus: (bool as int 0/1) COBOTTA in error state
Example
http://127.0.0.1:8280/cobotta/Status/
Return
{"result" : "OK", "connectedStatus" : value, "busyStatus" : value, "emergencyStop" : value, "errorStatus" : value }
/cobotta/Status/Referenced
Checks if the COBOTTA has already performed reference motion (CALSET).
Reference motion has to be done once after startup/connecting to COBOTTA.
Returns:
referencedStatus: (bool as int 0/1) COBOTTA referenced staus.
Example
http://127.0.0.1:8280/cobotta/Status/Referenced
Return
{"result" : "OK", "referencedStatus" : value}
/cobotta/Io/<number>
Read IO variable from COBOTTA.
Some IO signals are predefined. Please refer to COBOTTA manual ID : 7261 or check the signal's comments in Remote TP App.
Default user IOs start at IO 128
Parameter:
number: (int) number of IO
Returns:
value: (bool as int 0/1) IO variable value.
Example
http://127.0.0.1:8280/cobotta/Io/128
Return
{"result" : "OK", "value" : value}
Change Log
This are the changes in cobottabcap class.
You can check your version with cobotta/version/.
Date | Version | Changes |
---|---|---|
22.01.2021 | 1.0.0 | first Release |
COBOTTA® is a registered trademark of Denso Corporation in certain countries.