Package org.robwork.sdurw_simulation
Class SimulatedCamera
- java.lang.Object
-
- org.robwork.sdurw_kinematics.Stateless
-
- org.robwork.sdurw_simulation.SimulatedSensor
-
- org.robwork.sdurw_simulation.SimulatedCamera
-
public class SimulatedCamera extends SimulatedSensor
The SimulatedCamera class makes it posible to use virtual camera
sensors by using different framegrapper implementations.
The SimulatedCamera implements the camera interface though the setting of
framerate has no meaning to the virtual camera since no timing is done in
this implementation.
-
-
Constructor Summary
Constructors Constructor Description SimulatedCamera(long cPtr, boolean cMemoryOwn)
SimulatedCamera(java.lang.String name, double fov, FramePtr frame, FrameGrabberPtr frameGrabber)
creates a simulated pinhole camera,SimulatedCamera(CameraModelPtr model, FrameGrabberPtr frameGrabber)
constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acquire()
void
delete()
CameraPtr
getCameraSensor()
Get the camera sensor.static long
getCPtr(SimulatedCamera obj)
double
getFrameRate()
long
getHeight()
Image
getImage()
SensorPtr
getSensor()
long
getWidth()
boolean
initialize()
boolean
isImageReady()
void
reset(State state)
Resets the state of the SimulatedSensor to that of statevoid
setFrameRate(double framerate)
boolean
start()
void
stop()
void
update(Simulator.UpdateInfo info, State state)
steps the the SimulatedSensor with time dt and saves any state
changes in state.-
Methods inherited from class org.robwork.sdurw_simulation.SimulatedSensor
getCPtr, getFrame, getName, getSensorHandle, getSensorModel
-
Methods inherited from class org.robwork.sdurw_kinematics.Stateless
getCPtr, getStateStructure, isRegistered, registerIn, registerIn, unregister
-
-
-
-
Constructor Detail
-
SimulatedCamera
public SimulatedCamera(long cPtr, boolean cMemoryOwn)
-
SimulatedCamera
public SimulatedCamera(java.lang.String name, double fov, FramePtr frame, FrameGrabberPtr frameGrabber)
creates a simulated pinhole camera,- Parameters:
name
- [in] name of sensorfov
- [in] field of view for the camera.frame
- [in] frame to which the camera is attachedframeGrabber
- [in] the frameGrabber from which this Camera should grab images
-
SimulatedCamera
public SimulatedCamera(CameraModelPtr model, FrameGrabberPtr frameGrabber)
constructor- Parameters:
model
- [in] the model and info of the cameraframeGrabber
- [in] the frameGrabber from which this Camera should grab
images.
-
-
Method Detail
-
getCPtr
public static long getCPtr(SimulatedCamera obj)
-
delete
public void delete()
- Overrides:
delete
in classSimulatedSensor
-
initialize
public boolean initialize()
-
start
public boolean start()
-
stop
public void stop()
-
acquire
public void acquire()
-
isImageReady
public boolean isImageReady()
-
getImage
public Image getImage()
-
getFrameRate
public double getFrameRate()
-
setFrameRate
public void setFrameRate(double framerate)
-
getWidth
public long getWidth()
-
getHeight
public long getHeight()
-
update
public void update(Simulator.UpdateInfo info, State state)
Description copied from class:SimulatedSensor
steps the the SimulatedSensor with time dt and saves any state
changes in state.- Overrides:
update
in classSimulatedSensor
- Parameters:
info
- [in] update information related to the time step.state
- [out] changes of the SimulatedSensor is saved in state.
-
reset
public void reset(State state)
Description copied from class:SimulatedSensor
Resets the state of the SimulatedSensor to that of state- Overrides:
reset
in classSimulatedSensor
- Parameters:
state
- [in] the state that the sensor is reset too.
-
getSensor
public SensorPtr getSensor()
-
getCameraSensor
public CameraPtr getCameraSensor()
Get the camera sensor.- Returns:
- the sensor.
-
-