![]() |
RobWorkProject
23.9.11-
|
The SimulatedCamera class makes it posible to use virtual camera sensors by using different framegrapper implementations. More...
#include <SimulatedCamera.hpp>
Inherits SimulatedSensor.
Public Types | |
typedef rw::core::Ptr< SimulatedCamera > | Ptr |
Smart pointer type for a SimulatedCamera. | |
![]() | |
typedef rw::core::Ptr< SimulatedSensor > | Ptr |
smart pointer type of this class | |
![]() | |
typedef rw::core::Ptr< Stateless > | Ptr |
Smart pointer type for Stateless. | |
Public Member Functions | |
SimulatedCamera (const std::string &name, double fov, rw::core::Ptr< rw::kinematics::Frame > frame, rw::core::Ptr< rwlibs::simulation::FrameGrabber > frameGrabber) | |
creates a simulated pinhole camera, More... | |
SimulatedCamera (rw::core::Ptr< rw::sensor::CameraModel > model, rw::core::Ptr< rwlibs::simulation::FrameGrabber > frameGrabber) | |
constructor More... | |
virtual | ~SimulatedCamera () |
destructor | |
bool | initialize () |
initializes the camera to the current settings (CaptureMode,ColorMode,etc.) More... | |
bool | start () |
starts this camera, if the camera has not been initialized the initialize function will be called. More... | |
void | stop () |
stops this camera. When the camera is stopped it can be reinitialized using initialize() More... | |
void | acquire () |
aquires an image from the camera. This method is not blocking. Use isImageReady to poll for completion of acquire. More... | |
bool | isImageReady () |
tests whether a image has been acquired More... | |
const rw::sensor::Image * | getImage () |
returns the last image acquired from the camera. This method is not blocking, if no image has been acquired yet an empty image is returned. The image returned can for some specific drivers be read only. More... | |
double | getFrameRate () |
returns the framerate that this camera is setup with More... | |
void | setFrameRate (double framerate) |
sets the framerate of this camera. If the framerate is not supported the closest supported framerate is choosen. More... | |
virtual unsigned int | getWidth () const |
get width of the captured images More... | |
virtual unsigned int | getHeight () const |
get width of the captured images More... | |
void | update (const rwlibs::simulation::Simulator::UpdateInfo &info, rw::kinematics::State &state) |
steps the the SimulatedSensor with time dt and saves any state changes in state. More... | |
void | reset (const rw::kinematics::State &state) |
Resets the state of the SimulatedSensor to that of state. More... | |
rw::core::Ptr< rw::sensor::Sensor > | getSensor () |
rw::core::Ptr< rw::sensor::Camera > | getCameraSensor () |
Get the camera sensor. More... | |
![]() | |
virtual | ~SimulatedSensor () |
destructor | |
const std::string & | getName () const |
get name of this simulated sensor | |
rw::kinematics::Frame * | getFrame () const |
get frame that this sensor is attached to. More... | |
rw::sensor::SensorModel::Ptr | getSensorModel () |
get the sensor model of this simulated sensor. | |
rw::sensor::Sensor::Ptr | getSensorHandle (rwlibs::simulation::Simulator::Ptr sim) |
get a handle to controlling an instance of the simulated sensor in a specific simulator More... | |
![]() | |
virtual | ~Stateless () |
destructor | |
virtual void | registerIn (State &state) |
initialize this stateless data to a specific state More... | |
virtual void | registerIn (StateStructure::Ptr state) |
register this stateless object in a statestructure. | |
virtual void | unregister () |
unregisters all state data of this stateless object | |
StateStructure::Ptr | getStateStructure () |
Get the state structure. More... | |
const StateStructure::Ptr | getStateStructure () const |
Get the state structure. More... | |
bool | isRegistered () |
Check if object has registered its state. More... | |
Additional Inherited Members | |
![]() | |
SimulatedSensor (rw::sensor::SensorModel::Ptr model) | |
constructor | |
![]() | |
Stateless () | |
constructor | |
template<class T > | |
void | add (StatelessData< T > &data) |
implementations of sensor should add all their stateless data on initialization | |
void | add (StateData *data) |
Add data. More... | |
void | add (rw::core::Ptr< StateData > data) |
implementations of sensor should add all their state data on initialization | |
![]() | |
bool | _registered |
True if object has registered its state. | |
std::vector< rw::core::Ptr< StateData > > | _datas |
Data. | |
StateStructure::Ptr | _stateStruct |
The state structure. | |
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.
SimulatedCamera | ( | const std::string & | name, |
double | fov, | ||
rw::core::Ptr< rw::kinematics::Frame > | frame, | ||
rw::core::Ptr< rwlibs::simulation::FrameGrabber > | frameGrabber | ||
) |
creates a simulated pinhole camera,
name | [in] name of sensor |
fov | [in] field of view for the camera. |
frame | [in] frame to which the camera is attached |
frameGrabber | [in] the frameGrabber from which this Camera should grab images |
SimulatedCamera | ( | rw::core::Ptr< rw::sensor::CameraModel > | model, |
rw::core::Ptr< rwlibs::simulation::FrameGrabber > | frameGrabber | ||
) |
constructor
model | [in] the model and info of the camera |
frameGrabber | [in] the frameGrabber from which this Camera should grab images. |
void acquire | ( | ) |
aquires an image from the camera. This method is not blocking. Use isImageReady to poll for completion of acquire.
|
inline |
Get the camera sensor.
double getFrameRate | ( | ) |
returns the framerate that this camera is setup with
|
virtual |
get width of the captured images
const rw::sensor::Image* getImage | ( | ) |
returns the last image acquired from the camera. This method is not blocking, if no image has been acquired yet an empty image is returned. The image returned can for some specific drivers be read only.
|
virtual |
get width of the captured images
bool initialize | ( | ) |
initializes the camera to the current settings (CaptureMode,ColorMode,etc.)
bool isImageReady | ( | ) |
tests whether a image has been acquired
|
inlinevirtual |
Resets the state of the SimulatedSensor to that of state.
state | [in] the state that the sensor is reset too. |
Implements SimulatedSensor.
void setFrameRate | ( | double | framerate | ) |
sets the framerate of this camera. If the framerate is not supported the closest supported framerate is choosen.
framerate | [in] the framerate |
bool start | ( | ) |
starts this camera, if the camera has not been initialized the initialize function will be called.
void stop | ( | ) |
stops this camera. When the camera is stopped it can be reinitialized using initialize()
|
virtual |
steps the the SimulatedSensor with time dt and saves any state changes in state.
info | [in] update information related to the time step. |
state | [out] changes of the SimulatedSensor is saved in state. |
Implements SimulatedSensor.