M-File Help: VREP_camera | View code for VREP_camera

# VREP_camera

Mirror of V-REP vision sensor object

Mirror objects are MATLAB objects that reflect the state of objects in the V-REP environment. Methods allow the V-REP state to be examined or changed.

This is a concrete class, derived from VREP_mirror, for all V-REP vision sensor objects and allows access to images and image parameters.

Methods throw exception if an error occurs.

## Example

    vrep = VREP();
    camera = vrep.camera('Vision_sensor');
    im = camera.grab();
    camera.setpose(T);
    R = camera.getorient();

## Methods

grab | return an image from simulated camera
setangle | set field of view
setresolution | set image resolution
setclipping | set clipping boundaries

## Superclass methods (VREP_obj)

getpos | get position of object
setpos | set position of object
getorient | get orientation of object
setorient | set orientation of object
getpose | get pose of object
setpose | set pose of object

can be used to set/get the pose of the robot base.

## Superclass methods (VREP_mirror)

getname | get object name
setparam_bool | set object boolean parameter
setparam_int | set object integer parameter
setparam_float | set object float parameter

getparam_bool | get object boolean parameter
getparam_int | get object integer parameter
getparam_float | get object float parameter

## See also

VREP_mirror, VREP_obj, VREP_arm, VREP_camera, VREP_hokuyo

# VREP_camera.VREP_camera

Create a camera mirror object

C = VREP_camera(name, options) is a mirror object that corresponds to the vision senor named name in the V-REP environment.

## Options

'fov', A | Specify field of view in degreees (default 60)
'resolution', N | Specify resolution. If scalar NxN else N(1)xN(2)
'clipping', Z | Specify near Z(1) and far Z(2) clipping boundaries

## Notes

- Default parameters are set in the V-REP environmen
- Can be applied to "DefaultCamera" which controls the view in the simulator GUI.

## See also

VREP_obj

# VREP_camera.char

Convert to string

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

## See also

VREP.display

# VREP_camera.getangle

Fet field of view for V-REP vision sensor

fov = C.getangle(fov) is the field-of-view angle to fov in radians.

## See also

VREP_camera.setangle

# VREP_camera.getclipping

Get clipping boundaries for V-REP vision sensor

C.getclipping() is the near and far clipping boundaries (1x2) in the Z-direction as a 2-vector [NEAR,FAR].

## See also

VREP_camera.setclipping

# VREP_camera.getresolution

Get resolution for V-REP vision sensor

R = C.getresolution() is the image resolution (1x2) of the vision sensor R(1)xR(2).

## See also

VREP_camera.setresolution

# VREP_camera.grab

Get image from V-REP vision sensor

im = C.grab(options) is an image (WxH) returned from the V-REP vision sensor.

C.grab(options) as above but the image is displayed using idisp.

## Options

'grey' | Return a greyscale image (default color).

## Notes

- V-REP simulator must be running.
- Color images can be quite dark, ensure good light sources.
- Uses the signal 'handle_rgb_sensor' to trigger a single image generation.

## See also

idisp, VREP.simstart

# VREP_camera.setangle

Set field of view for V-REP vision sensor

C.setangle(fov) set the field-of-view angle to fov in radians.

## See also

VREP_camera.getangle

# VREP_camera.setclipping

Set clipping boundaries for V-REP vision sensor

C.setclipping(near, far) set clipping boundaries to the range of Z from near to far. Objects outside this range will not be rendered.

## See also

VREP_camera.getclipping

# VREP_camera.setresolution

Set resolution for V-REP vision sensor

C.setresolution(R) set image resolution to RxR if R is a scalar or R(1)xR(2) if it is a 2-vector.

## Notes

- By default V-REP cameras seem to have very low (32x32) resolution.
- Frame rate will decrease as frame size increases.

## See also

VREP_camera.getresolution

© 1990-2014 Peter Corke.