当前位置:网站首页>Agvmir205 -- software development (API call)
Agvmir205 -- software development (API call)
2022-07-21 23:23:00 【North and north of the red fox】
AGVmir205– software development (API call )
1. This guide describes how to use Python 3 Script use REST API Call to extract data from the robot , And print the data to .txt In file . You can use these data to analyze your MiR The operation of the product . Suppose you know Python 3 The main principle of the code , Know how to MiR Used in products REST API.
2. Use this guide and the accompanying script , Own risk . The script attached to this guide is easy to understand and adapt . It is intended as an initial tool to understand how to use REST API from MiR Extract information from products . This script has no additional support , But you can refer to other REST API and Python 3 Documentation for help .
3. One of the things you need is equipped with Python 3 And a computer with a text editor installed Python The script is called REST_get_mission_scheduler_to_txt.py. You can download the script here .
4. Use python Script from the MiR Product export data
(1) step 1: Determine which endpoint you want to extract data from . To view your MiR Complete terminal list of products , Log into its user interface , Go to Help >API documentation, And log in with your credentials .
API The document opens in another tab . Lists all endpoints you can access . You can select an endpoint to see what data it contains .
(2) step 2: Open with text editor python Script REST_get_mission_scheduler_to_txt.py.
(3) step 3: Scroll down to variable ip( The first 34 That's ok ), And will ip Replace the address with your MiR Of the product ip Address . Explain the use of MiR Fleet Server's IP Address .
(4) step 4: For variables url_mission_scheduler( The first 37 That's ok ), Enter the endpoint from which you want to export data . In script , Endpoint used mission_scheduler.
(5) step 5: Delete the label in front of the code line to export data , Or insert the line
myFile.write(str(req_mis['DATA_NAME']) + ",")
among DATA_NAME Replace with the name of the data variable to be exported . In script , Only the possible endpoints are listed mission_scheduler Exported data .
Comma at the end of each line “,” Used to separate .txt The data in the file . You can replace it with another partition .
(6) step 6: Save the changes made to the code , And run the script . The script will generate .txt file output.txt. This file contains information from MiR Data exported by the product .
1. Example
If you edit a script , Put the data id、robot_id、start_time and state from MiR Fleet export ,.txt The file will display a list of data in the following format
17384,14,2020-05-07T17:12:05,Done,
17383,14,2020-05-07T17:11:48,Done,
You can also see the sample script REST_get_distance_to_txt.py. This script can be downloaded here . This script is connected to the robot IP Address , And from statistics / Export date and distance data from the endpoint .
边栏推荐
- C#从入门到精通(二)
- Single arm routing configuration
- HCIP day1
- HCIA static comprehensive experiment
- JDBC uses SQL statement to use limit paging error
- Subnet partition operation
- 下标运算符究竟是单目运算符还是双目运算符
- [untitled] rhcsa first operation
- HCIA RIP实验
- Fiddler actual combat - small white level - installation and basic packet capturing and packet changing operations
猜你喜欢
随机推荐
Subnet partition operation
VLSM 子网划分
TCP three handshakes and four disconnects
HCIP MGRE综合实验
MGRE experiment
AGV调式之软件开发—API调用
Hcip day 7
C language address book system
OSPF routing control
OSPF optimization
静态路由扩展
Reading and writing properties file
OSPF and mGRE comprehensive experiment
How to record game interface in unity editor
HCIA
第三天 网络类型
Static routing experiment
Hcip rip the next day
HCIP第八天
The difference between "FileInputStream" and "bufferedinputstream"