Skip to main content

Python API for AVIS Engine Simulator - A robust simulation platform for autonomous vehicle development

Project description

AVIS Engine Python API

A Python API for AVIS Engine (Autonomous Vehicles Intelligent Simulation Software) - a robust simulation platform for autonomous vehicle development and testing.

Python Version License Simulator Version

Overview

AVIS Engine provides a realistic simulation environment for developing and testing autonomous vehicle algorithms. This Python API allows you to easily interface with the simulator, control vehicles, and collect sensor data.

Features

  • Control vehicle throttle and steering
  • Access real-time sensor data (distance sensors, radar, cameras)
  • Retrieve vehicle telemetry (speed, position)
  • Configure camera settings (FOV, position, resolution)
  • Multiple simulation environments (race track, urban settings)
  • Support for semantic segmentation and depth cameras

Installation

Requirements

pip install -r requirements.txt

Python API

Option 1: Using pip (Recommended)

pip install avisengine

Option 2: Using git

git clone https://github.com/AvisEngine/AVIS-Engine-Python-API
cd AVIS-Engine-Python-API
pip install -e .

Simulator

Download the latest simulator from the AVIS Engine website.

Version Link
2.1.0 (Latest Beta) Download
2.0.1 (Stable) Download

Getting Started

1. Launch the Simulator

  1. Open the simulator
  2. Select a track
  3. Click "Open Info Panel"
  4. Configure server settings:
    • IP Address (Default: 127.0.0.1)
    • Port (Default: 25001)
  5. Click "Start Server"

Simulator Connection Panel

2. Connect and Control the Vehicle

Here's a basic example to connect to the simulator and control the vehicle:

import avisengine
import config
import time
import cv2

# Create car instance
car = avisengine.Car()

# Connect to simulator
car.connect(config.SIMULATOR_IP, config.SIMULATOR_PORT)

# Wait for connection to establish
time.sleep(3)

try:
    while True:
        # Set throttle (range: -100 to 100)
        car.setSpeed(20)
        
        # Set steering (range: -100 to 100)
        car.setSteering(-10)
        
        # Configure sensors
        car.setSensorAngle(40)
        
        # Get updated data
        car.getData()
        
        # Retrieve sensor data
        sensors = car.getSensors()  # [left, middle, right] distances in cm
        
        # Get camera image (OpenCV format)
        image = car.getImage()
        
        # Get vehicle speed (km/h)
        speed = car.getSpeed()
        
        # Display image
        cv2.imshow('Camera', image)
        if cv2.waitKey(10) == ord('q'):
            break
            
        time.sleep(0.001)
        
finally:
    # Ensure the car stops when the program exits
    car.stop()

API Reference

Car Class

Connection Methods

  • connect(ip, port) - Connect to the simulator
  • getData() - Retrieve the latest data from the simulator
  • stop() - Stop the car and close the connection

Control Methods

  • setSpeed(value) - Set throttle (-100 to 100)
  • setSteering(value) - Set steering angle (-100 to 100)
  • setSensorAngle(angle) - Set the angle between sensor rays

Data Retrieval Methods

  • getSensors() - Returns [left, middle, right] sensor distances in cm
  • getImage() - Returns camera image as OpenCV compatible array
  • getSpeed() - Returns current speed in km/h

Camera Calibration

The simulator includes a checkerboard pattern for camera calibration. Access this feature in simulator version 1.0.5 or higher.

Calibration Example 1 Calibration Example 2
Calibration Example 1 Calibration Example 2

Changelog

2.1.0 (Coming Soon)

  • ZMQ communication protocol
  • Configuration file support
  • Configurable camera settings (FOV, position, bird's-eye view)
  • Configurable post-processing (DOF, bloom, color corrections)
  • Semantic segmentation mode
  • Depth camera support
  • Radar sensor support
  • Pub-sub pattern messaging system

2.0.1

  • Major API update
  • Updated image encoding
  • Compressed TCP packets
  • Added Utils.py and Config.py
  • Added traffic system
  • Improved lighting
  • Higher resolution camera with better performance
  • Adjustable camera resolution
  • Message compression algorithm
  • Defined <EOF> tag in transferred data
  • Adjustable front sensor angle
  • Added KMP search for <EOF> detection

2.0.0

  • Added new city environment
  • Added fog effects
  • General improvements

1.2.0

  • Added localization (English, Persian, Russian, French, German, Chinese, Italian, Spanish, Japanese, Korean, Turkish)
  • Visual and performance improvements
  • Main menu redesign
  • Added "About this simulator" and "Terms of use"

1.0.7

  • Improved performance
  • Added top speed slider
  • Added "Right lane Only" toggle
  • Added "Visible Sensor detection lines" toggle
  • Added angle setting between sensors
  • UI/UX improvements
  • Improved lighting
  • Low-poly vehicle model for better performance
  • New checkpoint counting system
  • New skyboxes and terrain maps
  • Updated textures

1.0.6

  • Improved tag material contrast (Urban)
  • Added borders to signs and tags (Urban)

1.0.5

  • Fixed raycast hit detection
  • Added camera calibration checkerboard
  • Added urban track

License

MIT License - See LICENSE file for details

Support

For questions, issues, or feature requests:


Last updated: May 19, 2025

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

avisengine-0.1.1.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

avisengine-0.1.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file avisengine-0.1.1.tar.gz.

File metadata

  • Download URL: avisengine-0.1.1.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for avisengine-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ce5e29367499bbde2e66fc471d92e903888c0cd53bcf338b57b651bea9dc9e85
MD5 c8c3577a9723f9aad36c0de7811c47cc
BLAKE2b-256 23c387351f2365389170796537a46a34f4bc6b6f410b47821d7fdc9227a56cd4

See more details on using hashes here.

File details

Details for the file avisengine-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: avisengine-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for avisengine-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 92b960507e3895aa3da4cef9a097481d223c2732d52bd779da164db938d9b4d5
MD5 8ae869a5e81e85e3b42318727f9892e5
BLAKE2b-256 794705f4d0cfd24e97807b3d1355b1bc6668b5eb8a12dbf6c9a0eee214495565

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page