Skip to main content

Qianxing OpenAPI SDK for Python - A client library for accessing Qianxing's simulation platform

Project description

Qianxing OpenAPI SDK for Python

A Python SDK for interacting with Qianxing's simulation platform. This package provides a simple and intuitive way to control and monitor simulations for autonomous driving scenarios.

Installation

You can install the package directly from PyPI:

pip install qianxing-openapi

Quick Start

Here's a simple example of how to use the SDK:

from qianxing_openapi.client import Client
from qianxing_openapi.http_client import HttpConfig
from qianxing_openapi.simulator import SimulatorConfig
from qianxing_openapi.request_model import Point

# Initialize the client
client = Client(
    HttpConfig(
        token="your_token_here",
        endpoint="your_endpoint_here"
    )
)

# Get available scenes from training task
res = client.train_task.get_scene_id_list(task_id)
print(f"Available scenes: {res}")

# Create a simulator instance
simulator = client.init_simulator_from_config(
    SimulatorConfig(
        scenario_id=res.scene_id_list[0],
        scenario_version=res.scene_version_list[0]
    )
)

# Run simulation steps
for i in range(10):
    step_res = simulator.step()
    print(f"Step {i} result: {step_res}")

# Get vehicle information
vehicle_ids = simulator.get_vehicle_id_list()
print(f"Vehicle IDs: {vehicle_ids}")

# Control vehicle movement
simulator.set_vehicle_control_info(
    vehicle_id="test_vehicle_1", 
    ste_wheel=1.2,
    lon_acc=1.1
)

# Set vehicle position
simulator.set_vehicle_position(
    vehicle_id="test_vehicle_1",
    point=Point(x=-8.75, y=-537.0316, z=0)
)

# Stop the simulation
simulator.stop()

Features

  • Easy-to-use client interface
  • Comprehensive simulation control
  • Vehicle state monitoring and control
  • Support for pedestrians and non-motorized vehicles
  • Training task management
  • Map resource handling

Main Components

  • Client: Main entry point for the SDK
  • HttpConfig: Configuration for API endpoints and authentication
  • SimulatorConfig: Configuration for simulation scenarios
  • Simulator: Core simulation control interface
  • TrainTask: Training task management
  • Resources: Map and resource handling

Available Methods

Simulation Control

  • step(): Advance simulation by one step
  • stop(): Stop the simulation

Vehicle Control

  • get_vehicle_id_list(): Get all vehicle IDs
  • get_vehicle_position(): Get vehicle positions
  • set_vehicle_position(): Set vehicle position
  • set_vehicle_control_info(): Set vehicle control parameters
  • set_vehicle_moving_info(): Set vehicle movement parameters
  • get_vehicle_base_info(): Get vehicle basic information

Pedestrian Control

  • get_ped_id_list(): Get all pedestrian IDs
  • get_ped_base_info(): Get pedestrian information
  • set_ped_position(): Set pedestrian position

Non-motorized Vehicle Control

  • get_nmv_id_list(): Get all non-motorized vehicle IDs
  • get_nmv_base_info(): Get non-motorized vehicle information
  • set_nmv_position(): Set non-motorized vehicle position

Requirements

  • Python >= 3.0
  • requests >= 2.25.0

License

This project is licensed under the terms of the MIT license.

Support

For bug reports and feature requests, please use the GitHub Issues page.

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

qianxing-openapi-0.1.4.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

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

qianxing_openapi-0.1.4-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file qianxing-openapi-0.1.4.tar.gz.

File metadata

  • Download URL: qianxing-openapi-0.1.4.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for qianxing-openapi-0.1.4.tar.gz
Algorithm Hash digest
SHA256 56876a289de53b8862beaa8adb68afe2114507ad8a2032ec5a4006df1d1b58ad
MD5 1f86ff46309133743fb95f96526fff7f
BLAKE2b-256 e5f4baa0bcc72b745fbe3ae10daaa3dacd6826f6110e3747b5b29070e0c44e80

See more details on using hashes here.

File details

Details for the file qianxing_openapi-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for qianxing_openapi-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4ad05da86b013267a9e897f9d2d30e5cb3bd4cda316894640aeb6043eb4c9b12
MD5 8e6f50da7a40833ae9757ce2a34d7030
BLAKE2b-256 702d54c645fae083f7a861dbb1e69c11b49eca9ea975e0e61533335a201cee30

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