M-File Help: VREP | View code for 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.
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 |
VREP_obj, VREP_arm, VREP_camera, VREP_hokuyo
VREP object constructor
v = VREP(options) create a connection to an instance of the V-REP simulator.
'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 |
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.
vrep.arm('IRB 140');
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.
Convert to string
V.char() is a string representation the VREP parameters in human readable foramt.
Check communications to V-REP simulator
V.checkcomms() is true if a valid connection to the V-REP simulator exists.
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.
VREP object destructor
delete(v) closes the connection to the V-REP simulator
Display parameters
V.display() displays the VREP parameters in compact format.
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.
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).
Get value of V-REP joint object
V.getjoint(H, q) is the position of joint object with integer handle H.
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.
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.
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.
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.
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.
See tr2eul.
VREP.setorient, VREP.getpos, VREP.getpose
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.
v = VREP(); v.getparam_bool('sim_boolparam_mirrors_enabled')
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.
v = VREP(); v.getparam_float('sim_floatparam_simulation_time_step')
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.
v = VREP(); v.getparam_int('sim_intparam_settings')
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.
v = VREP(); v.getparam_str('sim_stringparam_application_path')
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.
VREP.setpose, VREP.getpose, VREP.getorient
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.
VREP.setpose, VREP.getpos, VREP.getorient
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.
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.
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.
'local' | The file is loaded relative to the MATLAB client's current folder, otherwise from the V-REP root folder. |
vrep.loadmodel('people/Walking Bill');
VREP.arm, VREP.camera, VREP.object
Load a scene into the V-REP simulator
V.loadscene(file, options) loads the scene file file with extension .ttt into the simulator.
'local' | The file is loaded relative to the MATLAB client's current folder, otherwise from the V-REP root folder. |
vrep.loadscene('2IndustrialRobots');
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.
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.
vrep.obj('Walking Bill');
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.
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.
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.
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.
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.
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.
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.
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.
VREP.getorient, VREP.setpos, VREP.setpose
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.
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.
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.
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.
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.
VREP.getpos, VREP.setpose, VREP.setorient
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.
VREP.getpose, VREP.setpos, VREP.setorient
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.
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.
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.
Pause V-REP simulation
V.simpause() pauses the V-REP simulation engine. Use V.simstart() to resume the simulation.
Start V-REP simulation
V.simstart() starts the V-REP simulation engine.
Stop V-REP simulation
V.simstop() stops the V-REP simulation engine.
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.
© 1990-2014 Peter Corke.