Skip to content

API Reference

SakuraSakura edited this page Oct 18, 2018 · 7 revisions

We provide a python client that shows how to use VIVID API here.

Note: Each function call that will change the environment state should add a short delay after the function returns to prevent unpredictable behavior.

isHit()

Return True when the vehicle collides with something.

Returns
boolean

resetLocation()

Reset the vehicle to the default spawn point in a map. The spawn point can be set by setLocation(x, y, z).

Returns
void

getLocation()

Get vehicle's current location.

Returns
list of float: [x, y, z]

setLocation(float x, float y, float z)

Set vehicle's location.

Parameters
x, y, z: target location (in centimeter)

Returns
void

getRotation()

Get vehicle's current direction.

Returns
list of float: [roll, yaw, pitch]

moveByDistance( float dx, float dy, float dz )

Move vehicle by specific distance. Return True when success.

Parameters
dx, dy, dz: distance to move along each axes (in centimeter)

Returns
boolean

turnByDegree( float degree )

Turn vehicle by degree on yaw axis. Return True when success.

Parameters
degree: positive for clockwise rotation

Returns
boolean

createMapObject( int obj_type, float x, float y, float z )

Spawn an object at specific location. Return True when success.

Parameter
obj_type: -1: fire, 0: chair, 1: table, 2: bookshelf, 3: door, 4: stair
x, y, z: target location (in centimeter)

Return
boolean

simGetImages( ImageRequest img_request_list )

Camera control.

Return
list of compressed png byte array

loadMap(int map_id)

Return True when the map can be reloaded. Note: The client will be disconnected and need to reconnect back after the new map is reloaded.

Parameter
map_id: the index of the list obtained by getMapNames()

Return
boolean

getMapNames()

Return ['map_0', 'map_1', ...], the list of map names

Return
list of string

Clone this wiki locally