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

#include <HapticFieldSensor.h>

Public Member Functions

 HapticFieldSensor (interfaces::ControlCenter *control, HapticFieldConfig config)
 
 ~HapticFieldSensor ()
 
virtual int getAsciiData (char *data) const
 
virtual int getSensorData (interfaces::sReal **data) 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 produceData (const data_broker::DataInfo &info, data_broker::DataPackage *package, int callbackParam)
 
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...
 
- Public Member Functions inherited from mars::interfaces::SensorInterface
 SensorInterface (ControlCenter *center)
 
virtual ~SensorInterface ()
 
- Public Member Functions inherited from mars::interfaces::BaseGridIntersectionSensor
 BaseGridIntersectionSensor (unsigned long id, std::string name, int cols, int rows, double stepX, double stepY, double maxDistance=std::numeric_limits< double >::infinity())
 
virtual ~BaseGridIntersectionSensor ()
 
- 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
 
void getCoreExchange (core_objects_exchange *obj) const
 
virtual configmaps::ConfigMap createConfig () 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::data_broker::ProducerInterface
 ProducerInterface ()
 
virtual ~ProducerInterface ()
 
- 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::BaseConfigparseConfig (interfaces::ControlCenter *control, configmaps::ConfigMap *config)
 
static interfaces::BaseSensorinstanciate (interfaces::ControlCenter *control, interfaces::BaseConfig *config)
 
- Static Public Member Functions inherited from mars::interfaces::BaseSensor
static BaseConfigparseConfig (ControlCenter *control, configmaps::ConfigMap *config)
 

Private Member Functions

void computeForces ()
 

Private Attributes

interfaces::drawStruct draw
 
int contactForceIndex
 
int contactIndex
 
double contactForce
 
bool contact
 
bool haveUpdate
 
long positionIndices [3]
 
long rotationIndices [4]
 
std::vector< utils::Vectorsensorpoints
 
utils::Vector ray
 
std::vector< double > forces
 
std::vector< double > weights
 
double fieldwidth
 
double fieldheight
 
HapticFieldConfig config
 
data_broker::DataPackage dbPackage
 
unsigned long dbPushId
 

Additional Inherited Members

- Public Attributes inherited from mars::interfaces::BaseGridIntersectionSensor
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::SensorInterface
ControlCentercontrol
 
- 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
 

Detailed Description

Definition at line 81 of file HapticFieldSensor.h.

Constructor & Destructor Documentation

◆ HapticFieldSensor()

mars::sim::HapticFieldSensor::HapticFieldSensor ( interfaces::ControlCenter control,
HapticFieldConfig  config 
)

Definition at line 59 of file HapticFieldSensor.cpp.

◆ ~HapticFieldSensor()

mars::sim::HapticFieldSensor::~HapticFieldSensor ( void  )

Definition at line 139 of file HapticFieldSensor.cpp.

Member Function Documentation

◆ computeForces()

void mars::sim::HapticFieldSensor::computeForces ( )
private

Definition at line 253 of file HapticFieldSensor.cpp.

◆ getAsciiData()

int mars::sim::HapticFieldSensor::getAsciiData ( char *  data) const
virtual

Reimplemented from mars::interfaces::BaseSensor.

Definition at line 145 of file HapticFieldSensor.cpp.

◆ getSensorData()

int mars::sim::HapticFieldSensor::getSensorData ( interfaces::sReal **  data) const
virtual

Reimplemented from mars::interfaces::BaseSensor.

Definition at line 156 of file HapticFieldSensor.cpp.

◆ instanciate()

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

Definition at line 46 of file HapticFieldSensor.cpp.

◆ parseConfig()

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

Definition at line 52 of file HapticFieldSensor.cpp.

◆ produceData()

void mars::sim::HapticFieldSensor::produceData ( const data_broker::DataInfo info,
data_broker::DataPackage package,
int  callbackParam 
)
virtual

Implements mars::data_broker::ProducerInterface.

Definition at line 206 of file HapticFieldSensor.cpp.

◆ receiveData()

void mars::sim::HapticFieldSensor::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 169 of file HapticFieldSensor.cpp.

◆ update()

void mars::sim::HapticFieldSensor::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 218 of file HapticFieldSensor.cpp.

Member Data Documentation

◆ config

HapticFieldConfig mars::sim::HapticFieldSensor::config
private

Definition at line 122 of file HapticFieldSensor.h.

◆ contact

bool mars::sim::HapticFieldSensor::contact
private

Definition at line 113 of file HapticFieldSensor.h.

◆ contactForce

double mars::sim::HapticFieldSensor::contactForce
private

Definition at line 112 of file HapticFieldSensor.h.

◆ contactForceIndex

int mars::sim::HapticFieldSensor::contactForceIndex
private

Definition at line 111 of file HapticFieldSensor.h.

◆ contactIndex

int mars::sim::HapticFieldSensor::contactIndex
private

Definition at line 111 of file HapticFieldSensor.h.

◆ dbPackage

data_broker::DataPackage mars::sim::HapticFieldSensor::dbPackage
private

Definition at line 123 of file HapticFieldSensor.h.

◆ dbPushId

unsigned long mars::sim::HapticFieldSensor::dbPushId
private

Definition at line 124 of file HapticFieldSensor.h.

◆ draw

interfaces::drawStruct mars::sim::HapticFieldSensor::draw
private

Definition at line 110 of file HapticFieldSensor.h.

◆ fieldheight

double mars::sim::HapticFieldSensor::fieldheight
private

Definition at line 121 of file HapticFieldSensor.h.

◆ fieldwidth

double mars::sim::HapticFieldSensor::fieldwidth
private

Definition at line 121 of file HapticFieldSensor.h.

◆ forces

std::vector<double> mars::sim::HapticFieldSensor::forces
private

Definition at line 119 of file HapticFieldSensor.h.

◆ haveUpdate

bool mars::sim::HapticFieldSensor::haveUpdate
private

Definition at line 114 of file HapticFieldSensor.h.

◆ positionIndices

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

Definition at line 115 of file HapticFieldSensor.h.

◆ ray

utils::Vector mars::sim::HapticFieldSensor::ray
private

Definition at line 118 of file HapticFieldSensor.h.

◆ rotationIndices

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

Definition at line 116 of file HapticFieldSensor.h.

◆ sensorpoints

std::vector<utils::Vector> mars::sim::HapticFieldSensor::sensorpoints
private

Definition at line 117 of file HapticFieldSensor.h.

◆ weights

std::vector<double> mars::sim::HapticFieldSensor::weights
private

Definition at line 120 of file HapticFieldSensor.h.


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