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()
Available APIs
Simulator APIs
Simulation Control
init_from_config(sim_config): Initialize simulator from configurationinit_from_sim(simulation_id, addr): Initialize simulator from existing simulationstep(): Advance simulation by one stepstop(): Stop the simulationreset(reset_traffic_flow): Reset the simulation to initial state, optionally reset traffic flow
Vehicle APIs
get_vehicle_id_list(): Get all vehicle IDsget_test_vehicle_id_list(): Get test vehicle IDsget_vehicle_base_info(id_list): Get vehicle basic informationget_vehicle_position(id_list): Get vehicle positionsget_vehicle_moving_info(id_list): Get vehicle movement informationget_vehicle_control_info(id_list): Get vehicle control parametersget_vehicle_perception_info(vehicle_id): Get vehicle perception informationget_vehicle_reference_lines(vehicle_id): Get available reference linesget_vehicle_planning_info(vehicle_id): Get vehicle planning informationget_vehicle_navigation_info(vehicle_id): Get vehicle navigation informationget_vehicle_collision_status(vehicle_id): Check vehicle collision statusget_vehicle_target_speed(vehicle_id): Get vehicle target speedset_vehicle_position(vehicle_id, point, phi): Set vehicle position and heading angleset_vehicle_control_info(vehicle_id, ste_wheel, lon_acc): Set vehicle control parametersset_vehicle_planning_info(vehicle_id, planning_path): Set vehicle planning pathset_vehicle_moving_info(vehicle_id, u, v, w, u_acc, v_acc, w_acc): Set vehicle movement parametersset_vehicle_base_info(vehicle_id, base_info): Set vehicle basic informationset_vehicle_link_nav(vehicle_id, link_nav): Set vehicle link navigation informationset_vehicle_destination(vehicle_id, destination): Set vehicle destination point
Traffic Light APIs
get_current_stage(junction_id): Get current traffic light stageget_movement_signal(movement_id): Get movement signal light colorget_signal_plan(junction_id): Get traffic light timing planget_movement_list(junction_id): Get movement list for junction
Pedestrian APIs
get_ped_id_list(): Get all pedestrian IDsget_ped_base_info(ped_id_list): Get pedestrian basic informationset_ped_position(ped_id, point, phi): Set pedestrian position and heading angle
Non-motorized Vehicle APIs
get_nmv_id_list(): Get all non-motorized vehicle IDsget_nmv_base_info(nmv_id_list): Get non-motorized vehicle basic informationset_nmv_position(nmv_id, point, phi): Set non-motorized vehicle position and heading angle
Training Task APIs
get_scene_id_list(task_id): Get list of available scenes for a training task
Resource APIs
get_map(asset_id, asset_version): Get map data for a specific asset
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.5.tar.gz.
File metadata
- Download URL: qianxing-openapi-0.1.5.tar.gz
- Upload date:
- Size: 16.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25b5cf5f56c611f349c6090e5c52d79e575fb4815742a2d7d9857d58affa3525
|
|
| MD5 |
9a228a44ab29282f605786de8bc992a4
|
|
| BLAKE2b-256 |
97496d658e5722b3ca8e368c9d000f3da7c78d1449cf472e2679ab17578cf6e5
|
File details
Details for the file qianxing_openapi-0.1.5-py3-none-any.whl.
File metadata
- Download URL: qianxing_openapi-0.1.5-py3-none-any.whl
- Upload date:
- Size: 21.0 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 |
0ef435f5aa1869fb8c3a0864688eb05b9d116e96f8b2758ea0b9bea6abc17630
|
|
| MD5 |
17eac8828faae9121681492505eea13b
|
|
| BLAKE2b-256 |
64a115a1d150959c3aadc603b214e39b9a234813fd66193d5e0aaa51908aaf61
|