Voxel Perception¶
体素感知接口用于在指定区域周围采样稀疏体素占用信息,适用于学习与规划任务。
Key Functions¶
query_voxel:围绕某个 transform 采样体素 buffer,并支持分辨率与范围配置。
API References¶
tongsim.connection.grpc.unary_api.UnaryAPI.query_voxel
async
staticmethod
¶
query_voxel(
conn: GrpcConnection,
transform: Transform,
voxel_num_x: int,
voxel_num_y: int,
voxel_num_z: int,
box_extent: Vector3,
actors_to_ignore: list[str] | None = None,
timeout: float = 5.0,
) -> bytes
Query voxel occupancy around a transform and return the raw buffer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
transform
|
Transform
|
World transform at the center of the volume. |
required |
voxel_num_x
|
int
|
Number of samples along the X axis. |
required |
voxel_num_y
|
int
|
Number of samples along the Y axis. |
required |
voxel_num_z
|
int
|
Number of samples along the Z axis. |
required |
box_extent
|
Vector3
|
Half-extent of the query box in world units. |
required |
actors_to_ignore
|
list[str] | None
|
Optional actor IDs excluded from sampling. |
None
|
timeout
|
float
|
RPC timeout in seconds. |
5.0
|
Returns:
| Name | Type | Description |
|---|---|---|
bytes |
bytes
|
Serialized voxel data provided by the service. |
Source code in src/tongsim/connection/grpc/unary_api.py
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 | |