Observed since 21 Oct, 09:27 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Python API and calibrated autonomous flight control for AgroTechSim
AgroTechSim API — это Python-библиотека для работы с симулятором AgroTechSim, предназначенная для получения телеметрии с дронов, обработки сенсорных данных и реализации систем автономного управления. Библиотека предоставляет как низкоуровневый доступ к сырым данным сенсоров, так и высокоуровневые абстракции для упрощённого управления дроном.
Модуль позволяет разработчикам создавать сложные алгоритмы компьютерного зрения, навигации и управления без необходимости работы с реальным оборудованием, используя полнофункциональный симулятор дронов.
| Компонент | Версия | Статус |
|---|---|---|
| AgroTechSim API | 1.0.1-v1.0.2 | ✅ Compatible with AgroTechSim 1.0.3 |
| AgroTechSim API | 1.0.3 | ✅ Compatible with AgroTechSim 1.0.4-1.0.5 |
| Python | 3.10 | ✅ Recommended |
| InavMSPApi | 1.1.0 | ✅ Dependency |
pip install agrotechsimapi
Этот способ автоматически установит все зависимости, включая inavmspapi требуемой версии.
git clone https://github.com/AgroTechAvia/TechSimApi.git
cd TechSimApi
python setup_by_source.py
Скрипт автоматически установит все зависимости и настроит окружение.
# 1. Создайте виртуальное окружение
python -m venv .venv
# 2. Активируйте окружение
# Windows:
.venv\Scripts\activate
# Linux/Mac:
source .venv/bin/activate
# 3. Установите inavmspapi
git clone https://github.com/AgroTechAvia/InavMSPApi.git
cd InavMSPApi
git checkout v1.1.0
pip install .
# 4. Установите agrotechsimapi
cd ..
git clone https://github.com/AgroTechAvia/TechSimApi.git
cd TechSimApi
pip install .
SimClient)HighLevelSimClient)edu-ext, edu-constructor и edu можно выбрать при создании клиента; отдельные регуляторы по-прежнему можно переопределять вручную.В репозитории представлены готовые примеры:
examples_low_level/ - Низкоуровневые примерыexamples_high_level/ - Высокоуровневые примерыfrom agrotechsimapi import SimClient, CaptureType
import cv2
# Подключение к симулятору
client = SimClient(address="127.0.0.1", port=8080)
# Получение изображения с камеры
image = client.get_camera_capture(camera_id=0, type=CaptureType.color)
# Отображение изображения
cv2.imshow("Drone Camera", image)
cv2.waitKey(0)
cv2.destroyAllWindows()
По умолчанию HighLevelSimClient использует встроенный профиль edu-ext.
Профиль можно выбрать по имени:
from agrotechsimapi import HighLevelSimClient
client = HighLevelSimClient(calibration="edu")
Посмотреть доступные профили и создать конфигурацию новой калибровки:
python -m agrotechsimapi calibrations list
python -m agrotechsimapi calibrations init-config --output calibration.json
Сначала рекомендуется проверить план без подключения к симулятору, а затем
запустить полёт с --fly:
python -m agrotechsimapi calibrate --name my_drone --config calibration.json
python -m agrotechsimapi calibrate --name my_drone --config calibration.json --fly
Калибратор последовательно настраивает высоту, yaw, ускорение XY, скорость XY и положение XY. Посмотреть текущий запуск или готовый профиль можно в автономном HTML-отчёте:
python -m agrotechsimapi plot --current --last 8 --open
python -m agrotechsimapi plot --calibration my_drone --open
Профили можно переносить между окружениями:
python -m agrotechsimapi calibrations export my_drone --output my_drone.json
python -m agrotechsimapi calibrations import my_drone.json --name imported_drone
Подробности находятся в практической инструкции и техническом описании.
Для проверки корректной работы модуля с симулятором используйте интеграционные тесты. Файл test_sim_client_real.py содержит тесты, которые проверяют подключение к симулятору и работу всех основных функций.
# Перейдите в директорию проекта
cd TechSimApi
# Запустите тесты с симулятором
pytest test/test_sim_client_real.py --with-simulator -v
Тест test_sim_client_real.py последовательно проверяет:
============================================================
Running SimClient Integration Tests with Real Simulator
============================================================
test_connection: ✓ PASSED
test_get_camera_capture: ✓ PASSED
test_get_kinematics_data: ✓ PASSED
test_get_range_data: ✓ PASSED
test_get_laser_scan: ✓ PASSED
test_get_radar_point: ⚠ SKIPPED (Radar not available)
test_led_control: ✓ PASSED
test_image_processing_methods: ✓ PASSED
test_multiple_camera_ids: ✓ PASSED
test_call_event_action: ✓ PASSED
test_error_handling: ✓ PASSED
test_performance: ✓ PASSED
✅ Все основные функции работают корректно!
from agrotechsimapi import SimClient
client = SimClient()
print(f"Connected: {client.is_connected()}")
# Linux/Mac
nc -z localhost 8080
# Windows
Test-NetConnection -ComputerName localhost -Port 8080
Тестирование позволяет убедиться, что все компоненты модуля работают корректно с текущей версией симулятора.
AgroTechSim API is a Python library for working with the AgroTechSim simulator, designed for obtaining drone telemetry, processing sensor data, and implementing autonomous control systems. The library provides both low-level access to raw sensor data and high-level abstractions for simplified drone control.
The module enables developers to create complex computer vision, navigation, and control algorithms without the need for real hardware, using a full-featured drone simulator.
| Component | Version | Status |
|---|---|---|
| AgroTechSim API | 1.0.1-v1.0.2 | ✅ Works with AgroTechSim 1.0.3 |
| AgroTechSim API | 1.0.3 | ✅ Works with AgroTechSim 1.0.4-1.0.5 |
| Python | 3.10 | ✅ Recommended |
| InavMSPApi | 1.1.0 | ✅ Dependency |
pip install agrotechsimapi
This method will automatically install all dependencies, including the required version of inavmspapi.
git https://github.com/AgroTechAvia/TechSimApi.git
cd TechSimApi
python setup_by_source.py
The script will automatically install all dependencies and set up the environment.
# 1. Create a virtual environment
python -m venv .venv
# 2. Activate the environment
# Windows:
.venv\Scripts\activate
# Linux/Mac:
source .venv/bin/activate
# 3. Install inavmspapi
git clone https://github.com/AgroTechAvia/InavMSPApi.git
cd InavMSPApi
git checkout v1.1.0
pip install .
# 4. Install agrotechsimapi
cd ..
git clone https://github.com/AgroTechAvia/TechSimApi.git
cd TechSimApi
pip install .
SimClient)HighLevelSimClient)edu-ext, edu-constructor, or edu when creating the client; individual controllers can still be overridden manually.The repository includes ready-to-use examples:
examples_low_level/ - Low-level examplesexamples_high_level/ - High-level examplesfrom agrotechsimapi import SimClient, CaptureType
import cv2
# Connect to simulator
client = SimClient(address="127.0.0.1", port=8080)
# Get camera image
image = client.get_camera_capture(camera_id=0, type=CaptureType.color)
# Display image
cv2.imshow("Drone Camera", image)
cv2.waitKey(0)
cv2.destroyAllWindows()
HighLevelSimClient uses the bundled edu-ext profile by default. Select a
different profile by name:
from agrotechsimapi import HighLevelSimClient
client = HighLevelSimClient(calibration="edu")
List available profiles and create an editable calibration configuration:
python -m agrotechsimapi calibrations list
python -m agrotechsimapi calibrations init-config --output calibration.json
Preview the plan first, then add --fly to connect to the simulator:
python -m agrotechsimapi calibrate --name my_drone --config calibration.json
python -m agrotechsimapi calibrate --name my_drone --config calibration.json --fly
The workflow tunes altitude, yaw, XY acceleration, XY velocity and XY position in sequence. Generate a one-time HTML snapshot of the active run or a completed profile with:
python -m agrotechsimapi plot --current --last 8 --open
python -m agrotechsimapi plot --calibration my_drone --lang en --open
Export and import profiles between environments or computers:
python -m agrotechsimapi calibrations export my_drone --output my_drone.json
python -m agrotechsimapi calibrations import my_drone.json --name imported_drone
See the practical calibration guide and the technical reference for details.
To verify that the module works correctly with the simulator, use the integration tests. The test_sim_client_real.py file contains tests that check the connection to the simulator and the operation of all main functions.
localhost:8080# Go to the project directory
cd TechSimApi
# Run tests with simulator
pytest tests/test_sim_client_real.py --with-simulator -v
The test_sim_client_real.py test sequentially verifies:
============================================================
Running SimClient Integration Tests with Real Simulator
============================================================
test_connection: ✓ PASSED
test_get_camera_capture: ✓ PASSED
test_get_kinematics_data: ✓ PASSED
test_get_range_data: ✓ PASSED
test_get_laser_scan: ✓ PASSED
test_get_radar_point: ⚠ SKIPPED (Radar not available)
test_led_control: ✓ PASSED
test_image_processing_methods: ✓ PASSED
test_multiple_camera_ids: ✓ PASSED
test_call_event_action: ✓ PASSED
test_error_handling: ✓ PASSED
test_performance: ✓ PASSED
✅ All main functions work correctly!
from agrotechsimapi import SimClient
client = SimClient()
print(f"Connected: {client.is_connected()}")
# Linux/Mac
nc -z localhost 8080
# Windows
Test-NetConnection -ComputerName localhost -Port 8080
Testing allows you to ensure that all module components work correctly with the current simulator version.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.1.0 | 5 Oct 2026 | 28 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 09:27 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:f2707ef3c305a6cea8dba858a542a6020729d6f87254db392c0f4c632f5f0aaa