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

A simulated line scanner. More...

#include <SimulatedScanner1D.hpp>

Inherits Scanner1D, and SimulatedSensor.

Public Types

typedef rw::core::Ptr< SimulatedScanner1DPtr
 
- Public Types inherited from Sensor
typedef rw::core::Ptr< SensorPtr
 smart pointer type
 
- 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

 SimulatedScanner1D (const std::string &name, rw::core::Ptr< rwlibs::simulation::FrameGrabber25D > framegrabber)
 constructor More...
 
 SimulatedScanner1D (const std::string &name, const std::string &desc, rw::core::Ptr< rwlibs::simulation::FrameGrabber25D > framegrabber)
 constructor More...
 
virtual ~SimulatedScanner1D ()
 destructor
 
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 isScanReady ()
 tests whether an image has been acquired More...
 
std::pair< double, double > getRange ()
 Returns the min and max range of this Scanner. More...
 
double getFrameRate ()
 returns the framerate that this camera is setup with More...
 
const rw::geometry::PointCloudgetImage ()
 Simulates a Kinnect grabbing RGBD images. More...
 
void update (double dt, rw::kinematics::State &state)
 steps the the sensor 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::sensor::SensorgetSensor ()
 
virtual const rw::geometry::PointCloudgetData ()
 returns a char pointer to the image data More...
 
virtual double getResolution ()
 
- Public Member Functions inherited from Sensor
virtual ~Sensor ()
 destructor
 
const std::string & getName () const
 returns the name of this sensor More...
 
const std::string & getDescription () const
 returns a description of this sensor More...
 
rw::core::Ptr< rw::sensor::SensorModelgetSensorModel () const
 The frame to which the sensor is attached. More...
 
virtual void setSensorModel (rw::core::Ptr< rw::sensor::SensorModel > smodel)
 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 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...
 
virtual void update (const rwlibs::simulation::Simulator::UpdateInfo &info, rw::kinematics::State &state)=0
 steps the the SimulatedSensor with time dt and saves any state changes in state. 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 Scanner
 Scanner (const std::string &name, const std::string &desc)
 constructor More...
 
 Scanner (const std::string &name)
 constructor More...
 
- Protected Member Functions inherited from Sensor
 Sensor (const std::string &name)
 constructor More...
 
 Sensor (const std::string &name, const std::string &description)
 constructor More...
 
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...
 
- 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

A simulated line scanner.

Constructor & Destructor Documentation

◆ SimulatedScanner1D() [1/2]

SimulatedScanner1D ( const std::string &  name,
rw::core::Ptr< rwlibs::simulation::FrameGrabber25D framegrabber 
)

constructor

Parameters
name[in] name of this simulated scanner
framegrabber[in] the framegrabber used for grabbing 2.5D images

◆ SimulatedScanner1D() [2/2]

SimulatedScanner1D ( const std::string &  name,
const std::string &  desc,
rw::core::Ptr< rwlibs::simulation::FrameGrabber25D framegrabber 
)

constructor

Parameters
name[in] name of this simulated scanner
desc[in] description of this scanner
framegrabber[in] the framegrabber used for grabbing 2.5D images

Member Function Documentation

◆ acquire()

void acquire ( )
virtual

Acquires data.

Implements Scanner.

◆ close()

void close ( )
virtual

Closes the connection to the scanner.

Implements Scanner.

◆ getData()

virtual const rw::geometry::PointCloud& getData ( )
inlinevirtual

returns a char pointer to the image data

Returns
char pointer to the image data

◆ getFrameRate()

double getFrameRate ( )
virtual

returns the framerate that this camera is setup with

Returns
the framerate in frames per second

Implements Scanner.

◆ getImage()

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

Simulates a Kinnect grabbing RGBD images.

◆ getRange()

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

Returns the min and max range of this Scanner.

Returns
min and max range

Implements Scanner.

◆ isOpen()

bool isOpen ( )
virtual

Returns whether the scanner has been opened.

Returns
true if scanner is opened

Implements Scanner.

◆ isScanReady()

bool isScanReady ( )
virtual

tests whether an image has been acquired

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

Implements Scanner.

◆ open()

void open ( )
virtual

Opens connection to the scanner.

Implements 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

◆ update()

void update ( double  dt,
rw::kinematics::State state 
)

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

Parameters
dt[in] the timestep.
state[out] changes of the SimulatedSensor is saved in state.

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