Difference between revisions of "COBOTTA Rest API"
m (Changed redirect target from Cobottino to Robotino and Cobotta bCaps Integration) (Tag: Redirect target changed) |
(Removed redirect to Robotino and Cobotta bCaps Integration) (Tag: Removed redirect) |
||
Line 1: | Line 1: | ||
− | + | ==Introduction== | |
+ | {|class="wikitable" cellpadding="20" vertical-align="top" | ||
+ | |- | ||
+ | |This RESTful API which uses cobottabcap python class to communicate with denso robotics COBOTTA.<br> | ||
+ | It provides several PUT/GET methods to control the COBOTTA such as | ||
+ | * Connect/Dissconnect to COBOTTA | ||
+ | * Start/Stop CobottaWorld program | ||
+ | * Read/Write IOs | ||
+ | * Get COBOTTA error status, description | ||
+ | * Reset COBOTTA error | ||
+ | * Get COBOTTA status information | ||
+ | * Get/Set COBOTTA override | ||
+ | * Get a list of robot programs <br> | ||
+ | The API is acessable on localhost port 8280 | ||
+ | |} | ||
+ | |||
+ | ==PUT== | ||
+ | |||
+ | ==GET== | ||
+ | |||
+ | ==="/cobotta/Connect/<host>/", defaults={'port': 5007, 'timeout':2000}) <br> | ||
+ | "/cobotta/Connect/<host>/<port>/<timeout>")=== | ||
+ | A connection to the COBOTTA is established. Also a background task is started wich is used for cyclically monitoring. | ||
+ | |||
+ | Arguments:<br> | ||
+ | host: (str) IP address of COBOTTA<br> | ||
+ | port: (int) TCP communication port -- default: 5007<br> | ||
+ | timeout: (int) time to connection timeout [10ms] -- default 2000<br> | ||
+ | |||
+ | '''Example''' | ||
+ | <pre> | ||
+ | http://127.0.0.1:8280/cobotta/Connect/172.21.0.30/ | ||
+ | </pre> | ||
+ | |||
+ | ===/cobotta/Disconnect/=== | ||
+ | |||
+ | |||
+ | ===/cobotta/StartMotionPreparation/=== | ||
+ | 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. | ||
+ | |||
+ | '''Example''' | ||
+ | <pre> | ||
+ | http://127.0.0.1:8280 | ||
+ | </pre> | ||
+ | |||
+ | ===/cobotta/GetProgramList/=== | ||
+ | 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. | ||
+ | |||
+ | Returns:<br> | ||
+ | (str[]) job names | ||
+ | |||
+ | '''Example''' | ||
+ | <pre> | ||
+ | http://127.0.0.1:8280 | ||
+ | </pre> | ||
+ | |||
+ | ===/cobotta/StartHome/=== | ||
+ | Starts the HOME program. HOME program has to be defined in CobottaWorld app. | ||
+ | This method is also used internally to drive to HOME position in MotionPreparation method. | ||
+ | |||
+ | '''Example''' | ||
+ | <pre> | ||
+ | http://127.0.0.1:8280 | ||
+ | </pre> | ||
+ | |||
+ | ===/cobotta/StartProgram/<progname>/", defaults={'mode': 1}) | ||
+ | /cobotta/StartProgram/<progname>/<mode>/=== | ||
+ | Starts a CobottaWorld robot program. | ||
+ | The program name is handled internally as upper case. | ||
+ | |||
+ | Arguments:<br> | ||
+ | progname: (str) name of CobottaWorld robot program<br> | ||
+ | mode: (int) execution mode <br> | ||
+ | 1:One cycle execution <br> | ||
+ | 2:Continuous execution <br> | ||
+ | 3:Step forward <br> | ||
+ | |||
+ | '''Example''' | ||
+ | <pre> | ||
+ | http://127.0.0.1:8280 | ||
+ | </pre> | ||
+ | |||
+ | ===/cobotta/ResumeProgram/=== | ||
+ | Continues a CobottaWorld robot program. E.g. after error reset. | ||
+ | The program has to be started with "StartProgram" method, first. | ||
+ | |||
+ | '''Example''' | ||
+ | <pre> | ||
+ | http://127.0.0.1:8280 | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | ===/cobotta/StopPrograms/=== | ||
+ | Stops all running robot programs. | ||
+ | Programs will be stopped immediately. | ||
+ | |||
+ | '''Example''' | ||
+ | <pre> | ||
+ | http://127.0.0.1:8280 | ||
+ | </pre> | ||
+ | |||
+ | ===/cobotta/CycleEnd/=== | ||
+ | End all running robot programs. | ||
+ | Programs will be stopped at the end of the program. | ||
+ | |||
+ | '''Example''' | ||
+ | <pre> | ||
+ | http://127.0.0.1:8280 | ||
+ | </pre> | ||
+ | |||
+ | ===/cobotta/ResetError/=== | ||
+ | Resets all errors of COBOTTA. | ||
+ | |||
+ | '''Example''' | ||
+ | <pre> | ||
+ | http://127.0.0.1:8280 | ||
+ | </pre> | ||
+ | |||
+ | ===/cobotta/Errors/=== | ||
+ | ===/cobotta/Errors/<errorIndex>=== | ||
+ | Check if COBOTTA is in error state. | ||
+ | |||
+ | Returns: <br> | ||
+ | (bool) error state; true = COBOTTA in error state | ||
+ | |||
+ | '''Example''' | ||
+ | <pre> | ||
+ | http://127.0.0.1:8280 | ||
+ | </pre> | ||
+ | |||
+ | ===GetErrorCode()=== | ||
+ | Read the COBOTTA hex value error code. | ||
+ | |||
+ | Returns: <br> | ||
+ | (str) error code | ||
+ | |||
+ | '''Example''' | ||
+ | <pre> | ||
+ | http://127.0.0.1:8280 | ||
+ | </pre> | ||
+ | |||
+ | ===GetErrorText()=== | ||
+ | Read the short description of COBOTTA error. | ||
+ | |||
+ | Returns: <br> | ||
+ | (str) error description | ||
+ | |||
+ | '''Example''' | ||
+ | <pre> | ||
+ | http://127.0.0.1:8280 | ||
+ | </pre> | ||
+ | |||
+ | ===GetErrorInfo()=== | ||
+ | Read the COBOTTA error info. A more detailed description of COBOTTA errors. | ||
+ | |||
+ | Returns: <br> | ||
+ | (str) error info | ||
+ | |||
+ | '''Example''' | ||
+ | <pre> | ||
+ | http://127.0.0.1:8280 | ||
+ | </pre> | ||
+ | |||
+ | ===/cobotta/Override/=== | ||
+ | Sets the COBOTTA override. Reads current override. | ||
+ | |||
+ | Arguments: <br> | ||
+ | ovrd: (int) override to be set; 1..100 (%) <br> | ||
+ | Returns: <br> | ||
+ | (float) current override | ||
+ | |||
+ | '''Example''' | ||
+ | <pre> | ||
+ | http://127.0.0.1:8280 | ||
+ | </pre> | ||
+ | |||
+ | /cobotta/Override/<ovrd> | ||
+ | |||
+ | ===/cobotta/Status/=== | ||
+ | Read status variables from COBOTTA. | ||
+ | It is handled as array for easier output from a RobotinoView python script block. | ||
+ | |||
+ | Returns: <br> | ||
+ | (bool[]) current states; <br> | ||
+ | [0]: emergency stop staus; true = emergency stop active <br> | ||
+ | [1]: busy status; true = task is running <br> | ||
+ | [2]: normal status; true = no error <br> | ||
+ | [3]: servo status; true = motors ON | ||
+ | |||
+ | '''Example''' | ||
+ | <pre> | ||
+ | http://127.0.0.1:8280 | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | ===/cobotta/BusyStatus/=== | ||
+ | |||
+ | ===/cobotta/Io/<number>=== | ||
+ | Read IO variable from COBOTTA. | ||
+ | |||
+ | Arguments: <br> | ||
+ | number: (int) number of IO <br> | ||
+ | Returns: <br> | ||
+ | (bool) IO variable value | ||
+ | |||
+ | '''Example''' | ||
+ | <pre> | ||
+ | http://127.0.0.1:8280 | ||
+ | </pre> | ||
+ | |||
+ | ===/cobotta/Io/<number>/<value>=== | ||
+ | Write IO variable to COBOTTA. | ||
+ | |||
+ | Arguments: <br> | ||
+ | number: (int) number of IO <br> | ||
+ | value: (bool) value of IO variable | ||
+ | |||
+ | '''Example''' | ||
+ | <pre> | ||
+ | http://127.0.0.1:8280 | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | ==Change Log== | ||
+ | This are the changes in cobottabcap class. <br> | ||
+ | You can check your version with cobotta/version/. | ||
+ | {| border="1" | ||
+ | !Date | ||
+ | !Version | ||
+ | !Changes | ||
+ | |- | ||
+ | |22.01.2021 | ||
+ | |1.0.0 | ||
+ | |first Release | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | <small> COBOTTA® is a registered trademark of Denso Corporation in certain countries. </small> |
Revision as of 12:01, 26 March 2021
Contents
- 1 Introduction
- 2 PUT
- 3 GET
- 3.1 /cobotta/Disconnect/
- 3.2 /cobotta/StartMotionPreparation/
- 3.3 /cobotta/GetProgramList/
- 3.4 /cobotta/StartHome/
- 3.5 /cobotta/ResumeProgram/
- 3.6 /cobotta/StopPrograms/
- 3.7 /cobotta/CycleEnd/
- 3.8 /cobotta/ResetError/
- 3.9 /cobotta/Errors/
- 3.10 /cobotta/Errors/<errorIndex>
- 3.11 GetErrorCode()
- 3.12 GetErrorText()
- 3.13 GetErrorInfo()
- 3.14 /cobotta/Override/
- 3.15 /cobotta/Status/
- 3.16 /cobotta/BusyStatus/
- 3.17 /cobotta/Io/<number>
- 3.18 /cobotta/Io/<number>/<value>
- 4 Change Log
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 |
PUT
GET
==="/cobotta/Connect/<host>/", defaults={'port': 5007, 'timeout':2000})
"/cobotta/Connect/<host>/<port>/<timeout>")===
A connection to the COBOTTA is established. Also a background task is started wich is used for cyclically monitoring.
Arguments:
host: (str) IP address of COBOTTA
port: (int) TCP communication port -- default: 5007
timeout: (int) time to connection timeout [10ms] -- default 2000
Example
http://127.0.0.1:8280/cobotta/Connect/172.21.0.30/
/cobotta/Disconnect/
/cobotta/StartMotionPreparation/
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.
Example
http://127.0.0.1:8280
/cobotta/GetProgramList/
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.
Returns:
(str[]) job names
Example
http://127.0.0.1:8280
/cobotta/StartHome/
Starts the HOME program. HOME program has to be defined in CobottaWorld app. This method is also used internally to drive to HOME position in MotionPreparation method.
Example
http://127.0.0.1:8280
===/cobotta/StartProgram/<progname>/", defaults={'mode': 1}) /cobotta/StartProgram/<progname>/<mode>/=== Starts a CobottaWorld robot program. The program name is handled internally as upper case.
Arguments:
progname: (str) name of CobottaWorld robot program
mode: (int) execution mode
1:One cycle execution
2:Continuous execution
3:Step forward
Example
http://127.0.0.1:8280
/cobotta/ResumeProgram/
Continues a CobottaWorld robot program. E.g. after error reset. The program has to be started with "StartProgram" method, first.
Example
http://127.0.0.1:8280
/cobotta/StopPrograms/
Stops all running robot programs. Programs will be stopped immediately.
Example
http://127.0.0.1:8280
/cobotta/CycleEnd/
End all running robot programs. Programs will be stopped at the end of the program.
Example
http://127.0.0.1:8280
/cobotta/ResetError/
Resets all errors of COBOTTA.
Example
http://127.0.0.1:8280
/cobotta/Errors/
/cobotta/Errors/<errorIndex>
Check if COBOTTA is in error state.
Returns:
(bool) error state; true = COBOTTA in error state
Example
http://127.0.0.1:8280
GetErrorCode()
Read the COBOTTA hex value error code.
Returns:
(str) error code
Example
http://127.0.0.1:8280
GetErrorText()
Read the short description of COBOTTA error.
Returns:
(str) error description
Example
http://127.0.0.1:8280
GetErrorInfo()
Read the COBOTTA error info. A more detailed description of COBOTTA errors.
Returns:
(str) error info
Example
http://127.0.0.1:8280
/cobotta/Override/
Sets the COBOTTA override. Reads current override.
Arguments:
ovrd: (int) override to be set; 1..100 (%)
Returns:
(float) current override
Example
http://127.0.0.1:8280
/cobotta/Override/<ovrd>
/cobotta/Status/
Read status variables from COBOTTA. It is handled as array for easier output from a RobotinoView python script block.
Returns:
(bool[]) current states;
[0]: emergency stop staus; true = emergency stop active
[1]: busy status; true = task is running
[2]: normal status; true = no error
[3]: servo status; true = motors ON
Example
http://127.0.0.1:8280
/cobotta/BusyStatus/
/cobotta/Io/<number>
Read IO variable from COBOTTA.
Arguments:
number: (int) number of IO
Returns:
(bool) IO variable value
Example
http://127.0.0.1:8280
/cobotta/Io/<number>/<value>
Write IO variable to COBOTTA.
Arguments:
number: (int) number of IO
value: (bool) value of IO variable
Example
http://127.0.0.1:8280
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.