RobWorkProject  24.6.21-
Public Types | Public Member Functions | List of all members
SimulatedKinect Class Reference

Simulates a Kinnect grabbing RGBD images. More...

#include <SimulatedKinect.hpp>

Inherits SimulatedSensor.

Public Types

typedef rw::core::Ptr< SimulatedKinectPtr
 
- Public Types inherited from SimulatedSensor
typedef rw::core::Ptr< SimulatedSensorPtr
 smart pointer type of this class
 
- Public Types inherited from Stateless
typedef rw::core::Ptr< StatelessPtr
 Smart pointer type for Stateless.
 

Public Member Functions

 SimulatedKinect (const std::string &name, rw::core::Ptr< rw::kinematics::Frame > frame)
 constructor More...
 
 SimulatedKinect (const std::string &name, const std::string &desc, rw::core::Ptr< rw::kinematics::Frame > frame)
 constructor More...
 
 SimulatedKinect (rw::core::Ptr< rw::sensor::CameraModel > camModel, rw::core::Ptr< rw::sensor::Scanner25DModel > scannerModel)
 constructor More...
 
virtual ~SimulatedKinect ()
 destructor
 
bool init (rw::core::Ptr< rw::graphics::SceneViewer > drawer)
 Initialize sensor. More...
 
void setFrameRate (double rate)
 set the framerate in frames per sec. More...
 
void open ()
 Opens connection to the scanner. More...
 
bool isOpen ()
 Returns whether the scanner has been opened. More...
 
void close ()
 Closes the connection to the scanner. More...
 
void acquire ()
 Acquires data. More...
 
bool isDataReady ()
 tests whether an image has been acquired More...
 
std::pair< double, double > getRange () const
 Returns the min and max range of this Scanner. More...
 
double getFrameRate () const
 returns the framerate that this camera is setup with More...
 
const rw::geometry::PointCloudgetScan ()
 Simulates a Kinnect grabbing RGBD images. More...
 
const rw::sensor::ImagegetImage ()
 Get scanned image. 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::SensorgetSensorHandle (rw::core::Ptr< rwlibs::simulation::Simulator > simulator)
 get a handle to controlling an instance of the simulated sensor in a specific simulator More...
 
void setNoiseEnabled (bool enabled)
 set to true to enable realistic noise on the scan. More...
 
double getVerticalFieldOfView () const
 returns the vertical field of view More...
 
int getWidth () const
 returns the width of the image More...
 
int getHeight () const
 returns the height of the image More...
 
rw::core::Ptr< rw::sensor::CameraModelgetCameraModel ()
 get the model of the camera of this kinect
 
rw::core::Ptr< rw::sensor::Scanner25DModelgetScannerModel ()
 get the model of the range scannger of this kinect
 
- Public Member Functions inherited from SimulatedSensor
virtual ~SimulatedSensor ()
 destructor
 
const std::string & getName () const
 get name of this simulated sensor
 
rw::kinematics::FramegetFrame () 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...
 
- 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 SimulatedSensor
 SimulatedSensor (rw::sensor::SensorModel::Ptr model)
 constructor
 
- 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

Simulates a Kinnect grabbing RGBD images.

Constructor & Destructor Documentation

◆ SimulatedKinect() [1/3]

SimulatedKinect ( const std::string &  name,
rw::core::Ptr< rw::kinematics::Frame frame 
)

constructor

Parameters
name[in] name of this simulated scanner
frame[in] the frame the scanner is attached to.

◆ SimulatedKinect() [2/3]

SimulatedKinect ( const std::string &  name,
const std::string &  desc,
rw::core::Ptr< rw::kinematics::Frame frame 
)

constructor

Parameters
name[in] name of this simulated scanner
desc[in] description of this scanner
frame[in] the frame the scanner is attached to.

◆ SimulatedKinect() [3/3]

constructor

Parameters
camModel[in] the camera model to use
scannerModel[in] the scanner model to use

Member Function Documentation

◆ acquire()

void acquire ( )

Acquires data.

◆ close()

void close ( )

Closes the connection to the scanner.

◆ getFrameRate()

double getFrameRate ( ) const

returns the framerate that this camera is setup with

Returns
the framerate in frames per second

◆ getHeight()

int getHeight ( ) const
inline

returns the height of the image

Returns
the height of the image

◆ getImage()

const rw::sensor::Image& getImage ( )

Get scanned image.

Returns
a reference to the image.

◆ getRange()

std::pair<double, double> getRange ( ) const

Returns the min and max range of this Scanner.

Returns
min and max range

◆ getScan()

const rw::geometry::PointCloud& getScan ( )

Simulates a Kinnect grabbing RGBD images.

◆ getSensorHandle()

get a handle to controlling an instance of the simulated sensor in a specific simulator

Parameters
simulator[in] the simulator in which the handle is active

◆ getVerticalFieldOfView()

double getVerticalFieldOfView ( ) const
inline

returns the vertical field of view

Returns
the vertical field of view

◆ getWidth()

int getWidth ( ) const
inline

returns the width of the image

Returns
the width of the image

◆ init()

bool init ( rw::core::Ptr< rw::graphics::SceneViewer drawer)

Initialize sensor.

Parameters
drawer[in] the scene viewer.
Returns
true if initialization succeeded, false otherwise (depends on the capabilities of the SceneViewer).

◆ isDataReady()

bool isDataReady ( )

tests whether an image has been acquired

Returns
true if an image has been acquired, false otherwise.

◆ isOpen()

bool isOpen ( )

Returns whether the scanner has been opened.

Returns
true if scanner is opened

◆ open()

void open ( )

Opens connection to the scanner.

◆ reset()

void reset ( const rw::kinematics::State state)
virtual

Resets the state of the SimulatedSensor to that of state.

Parameters
state[in] the state that the sensor is reset too.

Implements SimulatedSensor.

◆ setFrameRate()

void setFrameRate ( double  rate)

set the framerate in frames per sec.

Parameters
rate[in] frames per sec

◆ setNoiseEnabled()

void setNoiseEnabled ( bool  enabled)
inline

set to true to enable realistic noise on the scan.

Parameters
enabled[in]

◆ update()

void update ( const rwlibs::simulation::Simulator::UpdateInfo info,
rw::kinematics::State state 
)
virtual

steps the the SimulatedSensor with time dt and saves any state changes in state.

Parameters
info[in] update information related to the time step.
state[out] changes of the SimulatedSensor is saved in state.

Implements SimulatedSensor.


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