# VREP_camera

V-REP mirror of vision sensor object

Mirror objects are MATLAB objects that reflect 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 | 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

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

## Superclass methods (VREP_base)

setobjparam_bool | set object boolean parameter
setobjparam_int | set object integer parameter
setobjparam_float | set object float parameter

## Properties

n | Number of joints

## 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 a 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 environment

## See also

vrep_obj

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

# 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].

# 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).

# 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
- Very slow, ie. seconds to grab a 256x256 image
- 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_camera.setangle

Set field of view for V-REP vision sensor

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

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

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

Robotics Toolbox for MATLAB © 1990-2012 Peter Corke.