21 #ifndef MARS_INTERFACES_SENSOR_BASES_H 22 #define MARS_INTERFACES_SENSOR_BASES_H 25 #warning "sensor_bases.h" 30 #include <configmaps/ConfigData.h> 31 #include <mars/utils/Quaternion.h> 32 #include <mars/utils/Vector.h> 40 namespace interfaces {
122 calcAcceletaion =
false;
124 calcPosition =
false;
125 calcRotationSpeed =
false;
126 calcOrientation =
false;
127 acceleration.setZero();
130 rotationSpeed.setZero();
131 orientation.setIdentity();
141 return attached_node;
146 bool calcAcceletaion,
calcSpeed, calcPosition,calcRotationSpeed,calcOrientation;
164 data.resize(rows*cols*channels);
183 assert(index >= 0 && index < (
int)data.size());
186 virtual void resize(
int cols,
int rows,
int channels=1){
189 this->channels = channels;
190 data.resize(rows*cols*channels);
208 depthImage(depthImage),
232 BasePolarIntersectionSensor(
unsigned long id, std::string
name,
int cols,
int rows,
double angleX,
double angleY,
double maxDistance= std::numeric_limits<double>::infinity()):
235 maxDistance(maxDistance)
237 if(cols == 1) stepX = 0;
238 else stepX = angleX / (cols-1);
239 if(rows == 1) stepY = 0;
240 else stepY = angleY / (rows-1);
243 calcOrientation =
true;
249 (*data) = (
new double[this->data.size()]);
250 memcpy((*data),&this->data[0],
sizeof(
double)*this->data.size());
251 return this->data.size();
267 BaseGridIntersectionSensor(
unsigned long id, std::string
name,
int cols,
int rows,
double stepX,
double stepY,
double maxDistance= std::numeric_limits<double>::infinity()):
272 maxDistance(maxDistance)
289 #endif // MARS_INTERFACES_SENSOR_BASES_H
virtual int getAsciiData(char *data) const
const int & getRows() const
unsigned long attached_node
virtual ~BasePolarIntersectionSensor()
BaseGridIntersectionSensor(unsigned long id, std::string name, int cols, int rows, double stepX, double stepY, double maxDistance=std::numeric_limits< double >::infinity())
std::string name
The name of the object.
unsigned long getAttachedNode()
const int & getCols() const
const std::vector< T > getData() const
The declaration of the ControlCenter.
const int & getChannels() const
static BaseConfig * parseConfig(ControlCenter *control, configmaps::ConfigMap *config)
virtual ~BaseCameraSensor()
virtual ~BaseNodeSensor()
virtual void resize(int cols, int rows, int channels=1)
BaseSensor(unsigned long id, std::string name)
utils::Quaternion getOrientation() const
virtual configmaps::ConfigMap createConfig() const
core_objects_exchange is a struct to exchange core objects information between the modules of the sim...
virtual ~BaseArraySensor()
utils::Vector acceleration
BasePolarIntersectionSensor(unsigned long id, std::string name, int cols, int rows, double angleX, double angleY, double maxDistance=std::numeric_limits< double >::infinity())
unsigned long getID() const
BaseNodeSensor(unsigned long id, std::string name)
void getCoreExchange(core_objects_exchange *obj) const
Copyright 2012, DFKI GmbH Robotics Innovation Center.
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vector
Eigen::Quaternion< double, Eigen::DontAlign > Quaternion
utils::Quaternion orientation
utils::Vector rotationSpeed
virtual int getSensorData(double **data) const
virtual ~BaseGridIntersectionSensor()
BaseArraySensor(int cols, int rows, int channels=1)
BaseCameraSensor(unsigned long id, std::string name, int cols, int rows, int nChannels, bool depthImage)
const std::string getName() const
T & operator[](const int &index)
virtual int getSensorData(double **data) const
unsigned long index
The unique id of the object.