RobWorkProject  23.9.11-
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
Scanner2DModel Class Reference

The Scanner2DModel encapsulate the basic model of a 2 dimensional range scanning device such as SICK or Hokyuo laser range scanners. More...

#include <Scanner2DModel.hpp>

Inherits SensorModel.

Classes

class  Scanner2DModelCache
 cache to allow storing state information More...
 

Public Types

typedef rw::core::Ptr< Scanner2DModelPtr
 smart pointer type to this 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

 Scanner2DModel (const std::string &name, double angularRangeInRad, int maxDataPoints, rw::core::Ptr< rw::kinematics::Frame > frame)
 constructor More...
 
virtual ~Scanner2DModel ()
 Destructor. Closes scanner connection if not already closed.
 
rw::geometry::PointCloudgetScan (const rw::kinematics::State &state)
 get handle to point cloud data in state. More...
 
void setScan (const rw::geometry::PointCloud &data, const rw::kinematics::State &state)
 set point cloud data in state More...
 
std::pair< double, double > getAngularRange () const
 Returns the min and max angular range of the scanner, where the angles represent the beginning and end of scanning in the z-x plane. Hence, angles represent rotation of z-axis around the y-axis. Normally range would be something like -170 to 170 degree for a Hokyo or Sick scanner. More...
 
size_t getMeasurementCount () const
 Returns the number of scan points.
 
std::pair< double, double > getDistanceRange () const
 get the min an max range in meters that is scannable by the 2D scanner More...
 
void setDistanceRange (const std::pair< double, double > &range)
 set distance range More...
 
void setDistanceRange (double min, double max)
 set distance range 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...
 

Protected Attributes

rw::kinematics::StatelessData< int > _sstate
 
size_t _width
 
std::pair< double, double > _angleRange
 
std::pair< double, double > _distRange
 
- 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.
 

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
 

Detailed Description

The Scanner2DModel encapsulate the basic model of a 2 dimensional range scanning device such as SICK or Hokyuo laser range scanners.

The model supports any range scanner that measures distance in an arc around the origin of the sensor. The scanner scans in the z-x plane with z-axis being the 0 angle measurement.

TODO: enable the selection of internal format, either pointcloud (large) or range-array (compact).

Constructor & Destructor Documentation

◆ Scanner2DModel()

Scanner2DModel ( const std::string &  name,
double  angularRangeInRad,
int  maxDataPoints,
rw::core::Ptr< rw::kinematics::Frame frame 
)

constructor

Parameters
name[in] name of scanner sensor
angularRangeInRad[in] angular range in rad, with middle scan point pointin along z-axis
maxDataPoints[in] the number of scan points
frame[in] the sensor frame

Member Function Documentation

◆ getAngularRange()

std::pair<double, double> getAngularRange ( ) const
inline

Returns the min and max angular range of the scanner, where the angles represent the beginning and end of scanning in the z-x plane. Hence, angles represent rotation of z-axis around the y-axis. Normally range would be something like -170 to 170 degree for a Hokyo or Sick scanner.

Returns
Angular range in radians

◆ getDistanceRange()

std::pair<double, double> getDistanceRange ( ) const
inline

get the min an max range in meters that is scannable by the 2D scanner

Returns
range in meters

◆ getScan()

rw::geometry::PointCloud& getScan ( const rw::kinematics::State state)

get handle to point cloud data in state.

Parameters
state[in] the state with point cloud data

◆ setDistanceRange() [1/2]

void setDistanceRange ( const std::pair< double, double > &  range)
inline

set distance range

Parameters
range

◆ setDistanceRange() [2/2]

void setDistanceRange ( double  min,
double  max 
)
inline

set distance range

Parameters
mindocumentation missing !
maxdocumentation missing !

◆ setScan()

void setScan ( const rw::geometry::PointCloud data,
const rw::kinematics::State state 
)

set point cloud data in state

Parameters
data[in] point cloud data to set
state[in] state in which to set the point cloud

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