RobWorkProject  23.9.11-
Classes | Public Types | Public Member Functions | List of all members
CameraModel Class Reference

The CameraModel class defines a generel pinhole camera model where camera parameters and state values are stored. More...

#include <CameraModel.hpp>

Inherits SensorModel.

Classes

class  CameraModelCache
 CameraModelCache that define data to store in the State. More...
 

Public Types

typedef rw::core::Ptr< CameraModelPtr
 smart pointer type to this class
 
typedef rw::core::Ptr< const CameraModelCPtr
 smart pointer type to this const class
 
- Public Types inherited from SensorModel
typedef rw::core::Ptr< SensorModelPtr
 smart pointer type
 
- Public Types inherited from Stateless
typedef rw::core::Ptr< StatelessPtr
 Smart pointer type for Stateless.
 

Public Member Functions

 CameraModel (const rw::math::ProjectionMatrix &projection, const std::string &name, rw::core::Ptr< rw::kinematics::Frame > frame, const std::string &modelInfo="")
 
virtual ~CameraModel ()
 destructor
 
Image::Ptr getImage (const rw::kinematics::State &state)
 returns the image if it has been saved in the State. Else null is returned. More...
 
void setImage (Image::Ptr img, rw::kinematics::State &state)
 set the image in the state More...
 
rw::math::ProjectionMatrix getProjectionMatrix () const
 get the camera projection matrix
 
double getFieldOfViewX () const
 get horisontal field of view. More...
 
double getFieldOfViewY () const
 get Vertical field of view. More...
 
double getFarClippingPlane () const
 get far clipping plane More...
 
double getNearClippingPlane () const
 get near clipping plane More...
 
- Public Member Functions inherited from SensorModel
 SensorModel (const std::string &name, rw::core::Ptr< kinematics::Frame > frame)
 constructor More...
 
 SensorModel (const std::string &name, rw::core::Ptr< kinematics::Frame > frame, const std::string &description)
 constructor More...
 
virtual ~SensorModel ()
 destructor
 
void setName (const std::string &name)
 sets the name of this sensor More...
 
void setDescription (const std::string &description)
 sets the description of this sensor More...
 
const std::string & getName () const
 returns the name of this sensor More...
 
const std::string & getDescription () const
 returns a description of this sensor More...
 
kinematics::FramegetFrame () const
 The frame to which the sensor is attached. More...
 
virtual void attachTo (rw::core::Ptr< kinematics::Frame > frame)
 Sets the frame to which the sensor should be attached. More...
 
rw::core::PropertyMapgetPropertyMap ()
 gets the propertymap of this sensor
 
const rw::core::PropertyMapgetPropertyMap () const
 gets the propertymap of this sensor
 
- Public Member Functions inherited from Stateless
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

- Protected Member Functions inherited from Stateless
 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
 
- Protected Attributes inherited from Stateless
bool _registered
 True if object has registered its state.
 
std::vector< rw::core::Ptr< StateData > > _datas
 Data.
 
StateStructure::Ptr _stateStruct
 The state structure.
 

Detailed Description

The CameraModel class defines a generel pinhole camera model where camera parameters and state values are stored.

Constructor & Destructor Documentation

◆ CameraModel()

CameraModel ( const rw::math::ProjectionMatrix projection,
const std::string &  name,
rw::core::Ptr< rw::kinematics::Frame frame,
const std::string &  modelInfo = "" 
)

constructor

Parameters
projection[in] pinhole projection model
name[in] name of camera
frame[in] frame that camera is attached/referenced to
modelInfo[in] text description of the camera

Member Function Documentation

◆ getFarClippingPlane()

double getFarClippingPlane ( ) const

get far clipping plane

Returns
distance to far clipping plane in meters.

◆ getFieldOfViewX()

double getFieldOfViewX ( ) const

get horisontal field of view.

Returns
field of view in degrees

◆ getFieldOfViewY()

double getFieldOfViewY ( ) const

get Vertical field of view.

Returns
field of view in degrees

◆ getImage()

Image::Ptr getImage ( const rw::kinematics::State state)

returns the image if it has been saved in the State. Else null is returned.

Parameters
state[in] the state in which the image is taken.
Returns
last image captured from camera.

◆ getNearClippingPlane()

double getNearClippingPlane ( ) const

get near clipping plane

Returns
distance to near clipping plane in meters.

◆ setImage()

void setImage ( Image::Ptr  img,
rw::kinematics::State state 
)

set the image in the state

Parameters
img[in] image to set in state
state[in/out] the state in which to set the image.

The documentation for this class was generated from the following file: