Difference between revisions of "COBOTTA Rest API"
(→/cobotta/Reference/) |
|||
Line 12: | Line 12: | ||
* Get/Set COBOTTA speed | * Get/Set COBOTTA speed | ||
* Get a list of robot programs <br> | * Get a list of robot programs <br> | ||
− | |||
− | |||
|} | |} | ||
+ | |||
+ | The API is acessable on robotino's IP address on port 8280. <br> | ||
+ | All parameters and return values will be json object style. <br> | ||
+ | Each call will return a http return code. You most likely get one of theese: <br> | ||
+ | 200 - request was successful <br> | ||
+ | 403 - COBOTTA is not ready to perform the requested action. E.g. in error state or already busy<br> | ||
+ | 412 - your (POST) request is missing parameters<br> | ||
+ | 500 - COBOTTA raised an error while executing the requested action<br> | ||
+ | |||
+ | In any case the returned object has a member called ''result'' which will have the value "OK" or "FAILED". | ||
+ | If the ''result'' is "FAILED" than there is also the member ''reason'' which describes the error. <br> | ||
==PUT== | ==PUT== | ||
− | ===/cobotta/Reference | + | ===/cobotta/Reference=== |
This method sould be called once after switching on the COBOTTA or if the COBOTTA had a hard collision. | 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. | 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. | Make sure that there are no obstacles around the COBOTTA before running the motion preperation. | ||
− | Refer to COBOTTA manual ID : 7291 for detaild information about COBOTTA startup | + | Refer to COBOTTA manual ID : 7291 for detaild information about COBOTTA startup. |
− | |||
'''Parameter:'''<br> | '''Parameter:'''<br> | ||
Line 29: | Line 37: | ||
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/Reference | + | http://127.0.0.1:8280/cobotta/Reference |
Parameter: | Parameter: | ||
{"execute" : 1} | {"execute" : 1} | ||
Line 52: | Line 60: | ||
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/Program/Start | + | http://127.0.0.1:8280/cobotta/Program/Start |
Parameter: | Parameter: | ||
{"execute" : 1, | {"execute" : 1, | ||
Line 62: | Line 70: | ||
</pre> | </pre> | ||
− | ===/cobotta/Program/Stop | + | ===/cobotta/Program/Stop=== |
Stops all running robot programs. <br> | Stops all running robot programs. <br> | ||
Programs will be stopped immediately and connot be continued. | Programs will be stopped immediately and connot be continued. | ||
Line 71: | Line 79: | ||
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/Program/Stop | + | http://127.0.0.1:8280/cobotta/Program/Stop |
Parameter: | Parameter: | ||
{"execute" : 1} | {"execute" : 1} | ||
Line 80: | Line 88: | ||
</pre> | </pre> | ||
− | ===/cobotta/Program/Hold | + | ===/cobotta/Program/Hold=== |
End all running robot programs.<br> | End all running robot programs.<br> | ||
Program will be stopped. The program can be continued by issuing Resume command. | Program will be stopped. The program can be continued by issuing Resume command. | ||
Line 89: | Line 97: | ||
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/Program/Hold | + | http://127.0.0.1:8280/cobotta/Program/Hold |
Parameter: | Parameter: | ||
{"execute" : 1} | {"execute" : 1} | ||
Line 98: | Line 106: | ||
</pre> | </pre> | ||
− | ===/cobotta/Program/Resume | + | ===/cobotta/Program/Resume=== |
Continues a CobottaWorld robot program. E.g. after error reset.<br> | Continues a CobottaWorld robot program. E.g. after error reset.<br> | ||
The program has to be started with "StartProgram" method, first. | The program has to be started with "StartProgram" method, first. | ||
Line 107: | Line 115: | ||
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/Program/Resume | + | http://127.0.0.1:8280/cobotta/Program/Resume |
Parameter: | Parameter: | ||
{"execute" : 1} | {"execute" : 1} | ||
Line 116: | Line 124: | ||
</pre> | </pre> | ||
− | ===/cobotta/Speed | + | ===/cobotta/Speed=== |
Set COBOTTA speed to specified value. | Set COBOTTA speed to specified value. | ||
Line 124: | Line 132: | ||
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/Speed | + | http://127.0.0.1:8280/cobotta/Speed |
Parameter: | Parameter: | ||
{"speed" : 50} | {"speed" : 50} | ||
Line 133: | Line 141: | ||
</pre> | </pre> | ||
− | ===/cobotta/Io/<number> | + | ===/cobotta/Io/<number>=== |
Write IO variable to COBOTTA. <br> | 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. | 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. | ||
Line 154: | Line 162: | ||
==GET== | ==GET== | ||
− | ===/cobotta/Program/GetList | + | ===/cobotta/Program/GetList=== |
Get the program names of CobottaWorld programs and returns them as string array.<br> | Get the program names of CobottaWorld programs and returns them as string array.<br> | ||
The update is also done during the instantiation.<br> | The update is also done during the instantiation.<br> | ||
Line 161: | Line 169: | ||
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/Program/GetList | + | http://127.0.0.1:8280/cobotta/Program/GetList |
</pre> | </pre> | ||
'''Return''' | '''Return''' | ||
Line 177: | Line 185: | ||
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/Error/Reset | + | http://127.0.0.1:8280/cobotta/Error/Reset |
Parameter: | Parameter: | ||
{"execute" : 1} | {"execute" : 1} | ||
Line 186: | Line 194: | ||
</pre> | </pre> | ||
− | ===/cobotta/Error | + | ===/cobotta/Error=== |
Returns the number of currently issued errors. <br> | Returns the number of currently issued errors. <br> | ||
If it returns an error count of 0 then there is no error.<br> | If it returns an error count of 0 then there is no error.<br> | ||
Line 194: | Line 202: | ||
''errorCount:'' (int) number of currently issued errors<br> | ''errorCount:'' (int) number of currently issued errors<br> | ||
''details:'' (obj[]) array of error details containing errorCode and errorMessage<br> | ''details:'' (obj[]) array of error details containing errorCode and errorMessage<br> | ||
− | |||
− | |||
− | |||
− | |||
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/Error | + | http://127.0.0.1:8280/cobotta/Error |
</pre> | </pre> | ||
'''Return''' | '''Return''' | ||
Line 212: | Line 216: | ||
</pre> | </pre> | ||
− | ===/cobotta/Speed | + | ===/cobotta/Speed=== |
Read current COBOTTA speed. | Read current COBOTTA speed. | ||
Line 220: | Line 224: | ||
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/Speed | + | http://127.0.0.1:8280/cobotta/Speed |
</pre> | </pre> | ||
'''Return''' | '''Return''' | ||
Line 228: | Line 232: | ||
</pre> | </pre> | ||
− | ===/cobotta/Status | + | ===/cobotta/Status=== |
Read status variables from COBOTTA. | Read status variables from COBOTTA. | ||
Line 234: | Line 238: | ||
COBOTTA staus variables. <br> | COBOTTA staus variables. <br> | ||
''connectedStatus:'' (bool as int 0/1) Connection between Robotino and COBOTTA is established<br> | ''connectedStatus:'' (bool as int 0/1) Connection between Robotino and COBOTTA is established<br> | ||
+ | ''referencedStatus:'' (bool as int 0/1) COBOTTA reference motion was performed<br> | ||
''busyStatus:'' (bool as int 0/1) COBOTTA is executing a program<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> | ''emergencyStop:'' (bool as int 0/1) COBOTTA emergency stop is pressed<br> | ||
''errorStatus:'' (bool as int 0/1) COBOTTA in error state<br> | ''errorStatus:'' (bool as int 0/1) COBOTTA in error state<br> | ||
+ | ''thread_status:'' (bool as int 0/1) status of the thread which cyclically updates the COBOTTA status<br> | ||
+ | ''speed:'' (int) speed of COBOTTA [%] | ||
'''Example''' | '''Example''' | ||
<pre> | <pre> | ||
− | http://127.0.0.1:8280/cobotta/Status | + | http://127.0.0.1:8280/cobotta/Status |
</pre> | </pre> | ||
'''Return''' | '''Return''' | ||
<pre> | <pre> | ||
{"result" : "OK", | {"result" : "OK", | ||
− | "connectedStatus" : | + | "connectedStatus": 0, |
− | "referencedStatus" : | + | "referencedStatus": 0, |
− | "busyStatus" : | + | "busyStatus": 0, |
− | "emergencyStop" : | + | "emergencyStop": 0, |
− | "errorStatus" : | + | "errorStatus": 0, |
+ | "thread_status": 0, | ||
+ | "speed": 0} | ||
</pre> | </pre> | ||
Line 256: | Line 265: | ||
Read IO variable from COBOTTA. <br> | 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> | 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 | + | Default user IOs start at IO 128. |
'''Parameter:''' <br> | '''Parameter:''' <br> | ||
Line 270: | Line 279: | ||
<pre> | <pre> | ||
{"result" : "OK", | {"result" : "OK", | ||
− | "value" : | + | "value" : 0} |
</pre> | </pre> | ||
Revision as of 10:55, 30 July 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 robotino's IP address on port 8280.
All parameters and return values will be json object style.
Each call will return a http return code. You most likely get one of theese:
200 - request was successful
403 - COBOTTA is not ready to perform the requested action. E.g. in error state or already busy
412 - your (POST) request is missing parameters
500 - COBOTTA raised an error while executing the requested action
In any case the returned object has a member called result which will have the value "OK" or "FAILED".
If the result is "FAILED" than there is also the member reason which describes the error.
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 COBOTTA manual ID : 7291 for detaild information about COBOTTA startup.
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
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
referencedStatus: (bool as int 0/1) COBOTTA reference motion was performed
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
thread_status: (bool as int 0/1) status of the thread which cyclically updates the COBOTTA status
speed: (int) speed of COBOTTA [%]
Example
http://127.0.0.1:8280/cobotta/Status
Return
{"result" : "OK", "connectedStatus": 0, "referencedStatus": 0, "busyStatus": 0, "emergencyStop": 0, "errorStatus": 0, "thread_status": 0, "speed": 0}
/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" : 0}
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.