Skip to content

API Reference

Lavi22 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 location of the vehicle to the default spawn point set by setLocation(x, y, z) in a map.

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 the vehicle by specify distance. Return True when success.

Parameters
dx, dy, dz: distances to move along corresponding 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 the specified location. Return True when success.

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

Returns
boolean

simGetImages( ImageRequest img_request_list )

Camera control.

Returns
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.

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

Returns
boolean

getMapNames()

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

Returns
list of string

Clone this wiki locally