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 SDKHttpConfig: Configuration for API endpoints and authenticationSimulatorConfig: Configuration for simulation scenariosSimulator: Core simulation control interfaceTrainTask: Training task managementResources: Map and resource handling
Available Methods
Simulation Control
step(): Advance simulation by one stepstop(): Stop the simulation
Vehicle Control
get_vehicle_id_list(): Get all vehicle IDsget_vehicle_position(): Get vehicle positionsset_vehicle_position(): Set vehicle positionset_vehicle_control_info(): Set vehicle control parametersset_vehicle_moving_info(): Set vehicle movement parametersget_vehicle_base_info(): Get vehicle basic information
Pedestrian Control
get_ped_id_list(): Get all pedestrian IDsget_ped_base_info(): Get pedestrian informationset_ped_position(): Set pedestrian position
Non-motorized Vehicle Control
get_nmv_id_list(): Get all non-motorized vehicle IDsget_nmv_base_info(): Get non-motorized vehicle informationset_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56876a289de53b8862beaa8adb68afe2114507ad8a2032ec5a4006df1d1b58ad
|
|
| MD5 |
1f86ff46309133743fb95f96526fff7f
|
|
| BLAKE2b-256 |
e5f4baa0bcc72b745fbe3ae10daaa3dacd6826f6110e3747b5b29070e0c44e80
|
File details
Details for the file qianxing_openapi-0.1.4-py3-none-any.whl.
File metadata
- Download URL: qianxing_openapi-0.1.4-py3-none-any.whl
- Upload date:
- Size: 20.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ad05da86b013267a9e897f9d2d30e5cb3bd4cda316894640aeb6043eb4c9b12
|
|
| MD5 |
8e6f50da7a40833ae9757ce2a34d7030
|
|
| BLAKE2b-256 |
702d54c645fae083f7a861dbb1e69c11b49eca9ea975e0e61533335a201cee30
|