Privacy
An open-source, flexible 3D physical simulation framework
mars::sim::RaySensor Class Reference

#include <RaySensor.h>

Public Member Functions

 RaySensor (interfaces::ControlCenter *control, RayConfig config)
 
 ~RaySensor (void)
 
std::vector< double > getSensorData () const
 
int getSensorData (double **) const
 
virtual void receiveData (const data_broker::DataInfo &info, const data_broker::DataPackage &package, int callbackParam)
 The DataBroker will call this method to notify the receiver of whenever the condition for which the receiver registered occur. More...
 
virtual void update (std::vector< interfaces::draw_item > *drawItems)
 This is the update function that updates the position of the vertices of all draw_item structs contained in drawItems. More...
 
virtual configmaps::ConfigMap createConfig () const
 
const RayConfiggetConfig () const
 
- Public Member Functions inherited from mars::interfaces::BasePolarIntersectionSensor
 BasePolarIntersectionSensor (unsigned long id, std::string name, int cols, int rows, double angleX, double angleY, double maxDistance=std::numeric_limits< double >::infinity())
 
virtual ~BasePolarIntersectionSensor ()
 
- Public Member Functions inherited from mars::interfaces::BaseNodeSensor
 BaseNodeSensor (unsigned long id, std::string name)
 
virtual ~BaseNodeSensor ()
 
utils::Quaternion getOrientation () const
 
unsigned long getAttachedNode ()
 
- Public Member Functions inherited from mars::interfaces::BaseSensor
 BaseSensor ()
 
virtual ~BaseSensor ()
 
 BaseSensor (unsigned long id, std::string name)
 
unsigned long getID () const
 
const std::string getName () const
 
virtual int getAsciiData (char *data) const
 
void getCoreExchange (core_objects_exchange *obj) const
 
- Public Member Functions inherited from mars::interfaces::BaseArraySensor< double >
 BaseArraySensor (int cols, int rows, int channels=1)
 
virtual ~BaseArraySensor ()
 
const std::vector< double > getData () const
 
const int & getCols () const
 
const int & getRows () const
 
const int & getChannels () const
 
double & operator[] (const int &index)
 
virtual void resize (int cols, int rows, int channels=1)
 
- Public Member Functions inherited from mars::interfaces::SensorInterface
 SensorInterface (ControlCenter *center)
 
virtual ~SensorInterface ()
 
- Public Member Functions inherited from mars::data_broker::ReceiverInterface
 ReceiverInterface ()
 
virtual ~ReceiverInterface ()
 
- Public Member Functions inherited from mars::interfaces::DrawInterface
virtual ~DrawInterface ()
 

Static Public Member Functions

static interfaces::BaseSensorinstanciate (interfaces::ControlCenter *control, interfaces::BaseConfig *config)
 
static interfaces::BaseConfigparseConfig (interfaces::ControlCenter *control, configmaps::ConfigMap *config)
 
- Static Public Member Functions inherited from mars::interfaces::BaseSensor
static BaseConfigparseConfig (ControlCenter *control, configmaps::ConfigMap *config)
 

Private Attributes

RayConfig config
 
std::vector< utils::Vectordirections
 
bool have_update
 
long positionIndices [3]
 
long rotationIndices [4]
 

Additional Inherited Members

- Public Attributes inherited from mars::interfaces::BasePolarIntersectionSensor
double stepX
 
double stepY
 
double maxDistance
 
- Public Attributes inherited from mars::interfaces::BaseSensor
unsigned long id
 
std::string name
 
unsigned long updateRate
 
- Protected Attributes inherited from mars::interfaces::BaseNodeSensor
unsigned long attached_node
 
bool calcAcceletaion
 
bool calcSpeed
 
bool calcPosition
 
bool calcRotationSpeed
 
bool calcOrientation
 
utils::Vector acceleration
 
utils::Vector speed
 
utils::Vector position
 
utils::Vector rotationSpeed
 
utils::Quaternion orientation
 
- Protected Attributes inherited from mars::interfaces::BaseArraySensor< double >
int cols
 
int rows
 
int channels
 
std::vector< double > data
 
- Protected Attributes inherited from mars::interfaces::SensorInterface
ControlCentercontrol
 

Detailed Description

Definition at line 71 of file RaySensor.h.

Constructor & Destructor Documentation

◆ RaySensor()

mars::sim::RaySensor::RaySensor ( interfaces::ControlCenter control,
RayConfig  config 
)

Definition at line 55 of file RaySensor.cpp.

◆ ~RaySensor()

mars::sim::RaySensor::~RaySensor ( void  )

Definition at line 130 of file RaySensor.cpp.

Member Function Documentation

◆ createConfig()

ConfigMap mars::sim::RaySensor::createConfig ( ) const
virtual

Reimplemented from mars::interfaces::BaseSensor.

Definition at line 249 of file RaySensor.cpp.

◆ getConfig()

const RayConfig & mars::sim::RaySensor::getConfig ( ) const

Definition at line 269 of file RaySensor.cpp.

◆ getSensorData() [1/2]

std::vector< double > mars::sim::RaySensor::getSensorData ( ) const

Definition at line 137 of file RaySensor.cpp.

◆ getSensorData() [2/2]

int mars::sim::RaySensor::getSensorData ( double **  data_) const
virtual

Reimplemented from mars::interfaces::BasePolarIntersectionSensor.

Definition at line 146 of file RaySensor.cpp.

◆ instanciate()

BaseSensor * mars::sim::RaySensor::instanciate ( interfaces::ControlCenter control,
interfaces::BaseConfig config 
)
static

Definition at line 49 of file RaySensor.cpp.

◆ parseConfig()

BaseConfig * mars::sim::RaySensor::parseConfig ( interfaces::ControlCenter control,
configmaps::ConfigMap config 
)
static

Definition at line 206 of file RaySensor.cpp.

◆ receiveData()

void mars::sim::RaySensor::receiveData ( const data_broker::DataInfo info,
const data_broker::DataPackage dataPackage,
int  callbackParam 
)
virtual

The DataBroker will call this method to notify the receiver of whenever the condition for which the receiver registered occur.

Parameters
infoInformation about the DataPackage.
dataPackageThe DataPackage containing all the data.
callbackParamThe int the receiver passed during registration. The default (the receiver didn't provide a callbackParam) is 0. This can be used to easily distinguish different registrations.

Implements mars::data_broker::ReceiverInterface.

Definition at line 154 of file RaySensor.cpp.

◆ update()

void mars::sim::RaySensor::update ( std::vector< interfaces::draw_item > *  drawItems)
virtual

This is the update function that updates the position of the vertices of all draw_item structs contained in drawItems.

Implements mars::interfaces::DrawInterface.

Definition at line 184 of file RaySensor.cpp.

Member Data Documentation

◆ config

RayConfig mars::sim::RaySensor::config
private

Definition at line 97 of file RaySensor.h.

◆ directions

std::vector<utils::Vector> mars::sim::RaySensor::directions
private

Definition at line 98 of file RaySensor.h.

◆ have_update

bool mars::sim::RaySensor::have_update
private

Definition at line 99 of file RaySensor.h.

◆ positionIndices

long mars::sim::RaySensor::positionIndices[3]
private

Definition at line 101 of file RaySensor.h.

◆ rotationIndices

long mars::sim::RaySensor::rotationIndices[4]
private

Definition at line 102 of file RaySensor.h.


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