M-File Help: VREP

M-File Help: VREP | View code for VREP

# VREP

V-REP simulator communications object

A VREP object holds all information related to the state of a connection to an instance of the V-REP simulator running on this or a networked computer. Allows the creation of references to other objects/models in V-REP which can be manipulated in MATLAB.

This class handles the interface to the simulator and low-level object handle operations.

Methods throw exception if an error occurs.

## Methods

gethandle | get handle to named object
getchildren | get children belonging to handle
getobjname | get names of objects
object | return a VREP_obj object for named object
arm | return a VREP_arm object for named robot
camera | return a VREP_camera object for named vosion sensor
hokuyo | return a VREP_hokuyo object for named Hokuyo scanner
getpos | return position of object given handle
setpos | set position of object given handle
getorient | return orientation of object given handle
setorient | set orientation of object given handle
getpose | return pose of object given handle
setpose | set pose of object given handle
setobjparam_bool | set object boolean parameter
setobjparam_int | set object integer parameter
setobjparam_float | set object float parameter
getobjparam_bool | get object boolean parameter
getobjparam_int | get object integer parameter
getobjparam_float | get object float parameter
signal_int | send named integer signal
signal_float | send named float signal
signal_str | send named string signal
setparam_bool | set simulator boolean parameter
setparam_int | set simulator integer parameter
setparam_str | set simulator string parameter
setparam_float | set simulator float parameter
getparam_bool | get simulator boolean parameter
getparam_int | get simulator integer parameter
getparam_str | get simulator string parameter
getparam_float | get simulator float parameter
delete | shutdown the connection and cleanup
simstart | start the simulator running
simstop | stop the simulator running
simpause | pause the simulator
getversion | get V-REP version number
checkcomms | return status of connection
pausecomms | pause the comms
loadscene | load a scene file
clearscene | clear the current scene
loadmodel | load a model into current scene
display | print the link parameters in human readable form
char | convert to string

## See also

VREP_obj, VREP_arm, VREP_camera, VREP_hokuyo

# VREP.VREP

VREP object constructor

v = VREP(options) create a connection to an instance of the V-REP simulator.

## Options

'timeout', T | Timeout T in ms (default 2000)
'cycle', C | Cycle time C in ms (default 5)
'port', P | Override communications port
'reconnect' | Reconnect on error (default noreconnect)
'path', P | The path to VREP install directory

## Notes

- The default path is taken from the environment variable VREP

# VREP.arm

Return VREP_arm object

V.arm(name) is a factory method that returns a VREP_arm object for the V-REP robot object named NAME.

## Example

    vrep.arm('IRB 140');

## See also

VREP_arm

# VREP.camera

Return VREP_camera object

V.camera(name) is a factory method that returns a VREP_camera object for the V-REP vision sensor object named NAME.

## See also

VREP_camera

# VREP.char

Convert to string

V.char() is a string representation the VREP parameters in human readable foramt.

## See also

VREP.display

# VREP.checkcomms

Check communications to V-REP simulator

V.checkcomms() is true if a valid connection to the V-REP simulator exists.

# VREP.clearscene

Clear current scene in the V-REP simulator

V.clearscene() clears the current scene and switches to another open scene, if none, a new (default) scene is created.

## See also

VREP.loadscene

# VREP.delete

VREP object destructor

delete(v) closes the connection to the V-REP simulator

# VREP.display

Display parameters

V.display() displays the VREP parameters in compact format.

## Notes

- This method is invoked implicitly at the command line when the result of an expression is a VREP object and the command has no trailing semicolon.

## See also

VREP.char

# VREP.getchildren

Find children of object

C = V.getchildren(H) is a vector of integer handles for the children of the V-REP object denoted by the integer handle H.

# VREP.gethandle

Return handle to VREP object

H = V.gethandle(name) is an integer handle for named V-REP object.

H = V.gethandle(fmt, arglist) as above but the name is formed from sprintf(fmt, arglist).

## See also

sprintf

# VREP.getjoint

Get value of V-REP joint object

V.getjoint(H, q) is the position of joint object with integer handle H.

# VREP.getobjname

Find names of objects

V.getobjname() will display the names and object handle (integers) for all objects in the current scene.

name = V.getobjname(H) will return the name of the object with handle H.

# VREP.getobjparam_bool

Get boolean parameter of a V-REP object

V.getobjparam_bool(H, param) gets the boolean parameter with identifier param of object with integer handle H.

# VREP.getobjparam_float

Get float parameter of a V-REP object

V.getobjparam_float(H, param) gets the float parameter with identifier param of object with integer handle H.

# VREP.getobjparam_int

Get integer parameter of a V-REP object

V.getobjparam_int(H, param) gets the integer parameter with identifier param of object with integer handle H.

# VREP.getorient

Get orientation of V-REP object

R = V.getorient(H) is the orientation of the V-REP object with integer handle H as a rotation matrix (3x3).

EUL = V.getorient(H, 'euler', OPTIONS) as above but returns ZYZ Euler angles.

V.getorient(H, hrr) as above but orientation is relative to the position of object with integer handle HR.

V.getorient(H, hrr, 'euler', OPTIONS) as above but returns ZYZ Euler angles.

## Options

See tr2eul.

## See also

VREP.setorient, VREP.getpos, VREP.getpose

# VREP.getparam_bool

Get boolean parameter of the V-REP simulator

V.getparam_bool(name) is the boolean parameter with name name from the V-REP simulation engine.

## Example

    v = VREP();
    v.getparam_bool('sim_boolparam_mirrors_enabled')

## See also

VREP.setparam_bool

# VREP.getparam_float

Get float parameter of the V-REP simulator

V.getparam_float(name) gets the float parameter with name name from the V-REP simulation engine.

## Example

    v = VREP();
    v.getparam_float('sim_floatparam_simulation_time_step')

## See also

VREP.setparam_float

# VREP.getparam_int

Get integer parameter of the V-REP simulator

V.getparam_int(name) is the integer parameter with name name from the V-REP simulation engine.

## Example

    v = VREP();
    v.getparam_int('sim_intparam_settings')

## See also

VREP.setparam_int

# VREP.getparam_str

Get string parameter of the V-REP simulator

V.getparam_str(name) is the string parameter with name name from the V-REP simulation engine.

## Example

    v = VREP();
    v.getparam_str('sim_stringparam_application_path')

## See also

VREP.setparam_str

# VREP.getpos

Get position of V-REP object

V.getpos(H) is the position (1x3) of the V-REP object with integer handle H.

V.getpos(H, hr) as above but position is relative to the position of object with integer handle hr.

## See also

VREP.setpose, VREP.getpose, VREP.getorient

# VREP.getpose

Get pose of V-REP object

T = V.getpose(H) is the pose of the V-REP object with integer handle H as a homogeneous transformation matrix (4x4).

T = V.getpose(H, hr) as above but pose is relative to the pose of object with integer handle R.

## See also

VREP.setpose, VREP.getpos, VREP.getorient

# VREP.getversion

Get version of the V-REP simulator

V.getversion() is the version of the V-REP simulator server as an integer MNNNN where M is the major version number and NNNN is the minor version number.

# VREP.hokuyo

Return VREP_hokuyo object

V.hokuyo(name) is a factory method that returns a VREP_hokuyo object for the V-REP Hokuyo laser scanner object named NAME.

## See also

VREP_hokuyo

# VREP.loadmodel

Load a model into the V-REP simulator

m = V.loadmodel(file, options) loads the model file file with extension .ttm into the simulator and returns a VREP_obj object that mirrors it in MATLAB.

## Options

'local' | The file is loaded relative to the MATLAB client's current folder, otherwise from the V-REP root folder.

## Example

    vrep.loadmodel('people/Walking Bill');

## Notes

- If a relative filename is given in non-local (server) mode it is relative to the V-REP models folder.

## See also

VREP.arm, VREP.camera, VREP.object

# VREP.loadscene

Load a scene into the V-REP simulator

V.loadscene(file, options) loads the scene file file with extension .ttt into the simulator.

## Options

'local' | The file is loaded relative to the MATLAB client's current folder, otherwise from the V-REP root folder.

## Example

    vrep.loadscene('2IndustrialRobots');

## Notes

- If a relative filename is given in non-local (server) mode it is relative to the V-REP scenes folder.

## See also

VREP.clearscene

# VREP.mobile

Return VREP_mobile object

V.mobile(name) is a factory method that returns a VREP_mobile object for the V-REP mobile base object named NAME.

## See also

VREP_mobile

# VREP.object

Return VREP_obj object

V.objet(name) is a factory method that returns a VREP_obj object for the V-REP object or model named NAME.

## Example

    vrep.obj('Walking Bill');

## See also

VREP_obj

# VREP.pausecomms

Pause communcations to the V-REP simulator

V.pausecomms(p) pauses communications to the V-REP simulation engine if p is true else resumes it. Useful to ensure an atomic update of simulator state.

# VREP.setjoint

Set value of V-REP joint object

V.setjoint(H, q) sets the position of joint object with integer handle H to the value q.

# VREP.setjointtarget

Set target value of V-REP joint object

V.setjointtarget(H, q) sets the target position of joint object with integer handle H to the value q.

# VREP.setjointvel

Set velocity of V-REP joint object

V.setjointvel(H, qd) sets the target velocity of joint object with integer handle H to the value qd.

# VREP.setobjparam_bool

Set boolean parameter of a V-REP object

V.setobjparam_bool(H, param, val) sets the boolean parameter with identifier param of object H to value val.

# VREP.setobjparam_float

Set float parameter of a V-REP object

V.setobjparam_float(H, param, val) sets the float parameter with identifier param of object H to value val.

# VREP.setobjparam_int

Set Integer parameter of a V-REP object

V.setobjparam_int(H, param, val) sets the integer parameter with identifier param of object H to value val.

# VREP.setorient

Set orientation of V-REP object

V.setorient(H, R) sets the orientation of V-REP object with integer handle H to that given by rotation matrix R (3x3).

V.setorient(H, T) sets the orientation of V-REP object with integer handle H to rotational component of homogeneous transformation matrix T (4x4).

V.setorient(H, E) sets the orientation of V-REP object with integer handle H to ZYZ Euler angles (1x3).

V.setorient(H, x, hr) as above but orientation is set relative to the orientation of object with integer handle hr.

## See also

VREP.getorient, VREP.setpos, VREP.setpose

# VREP.setparam_bool

Set boolean parameter of the V-REP simulator

V.setparam_bool(name, val) sets the boolean parameter with name name to value val within the V-REP simulation engine.

## See also

VREP.getparam_bool

# VREP.setparam_float

Set float parameter of the V-REP simulator

V.setparam_float(name, val) sets the float parameter with name name to value val within the V-REP simulation engine.

## See also

VREP.getparam_float

# VREP.setparam_int

Set integer parameter of the V-REP simulator

V.setparam_int(name, val) sets the integer parameter with name name to value val within the V-REP simulation engine.

## See also

VREP.getparam_int

# VREP.setparam_str

Set string parameter of the V-REP simulator

V.setparam_str(name, val) sets the integer parameter with name name to value val within the V-REP simulation engine.

## See also

VREP.getparam_str

# VREP.setpos

Set position of V-REP object

V.setpos(H, T) sets the position of V-REP object with integer handle H to T (1x3).

V.setpos(H, T, hr) as above but position is set relative to the position of object with integer handle hr.

## See also

VREP.getpos, VREP.setpose, VREP.setorient

# VREP.setpose

Set pose of V-REP object

V.setpos(H, T) sets the pose of V-REP object with integer handle H according to homogeneous transform T (4x4).

V.setpos(H, T, hr) as above but pose is set relative to the pose of object with integer handle hr.

## See also

VREP.getpose, VREP.setpos, VREP.setorient

# VREP.signal_float

Send a float signal to the V-REP simulator

V.signal_float(name, val) send a float signal with name name and value val to the V-REP simulation engine.

# VREP.signal_int

Send an integer signal to the V-REP simulator

V.signal_int(name, val) send an integer signal with name name and value val to the V-REP simulation engine.

# VREP.signal_str

Send a string signal to the V-REP simulator

V.signal_str(name, val) send a string signal with name name and value val to the V-REP simulation engine.

# VREP.simpause

Pause V-REP simulation

V.simpause() pauses the V-REP simulation engine. Use V.simstart() to resume the simulation.

## See also

VREP.simstart

# VREP.simstart

Start V-REP simulation

V.simstart() starts the V-REP simulation engine.

## See also

VREP.simstop, VREP.simpause

# VREP.simstop

Stop V-REP simulation

V.simstop() stops the V-REP simulation engine.

## See also

VREP.simstart

# VREP.youbot

Return VREP_youbot object

V.youbot(name) is a factory method that returns a VREP_youbot object for the V-REP YouBot object named NAME.

## See also

vrep_youbot

© 1990-2014 Peter Corke.