4
* Created on: Nov 28, 2008
8
#ifndef SAMPLESENSOR_H_
9
#define SAMPLESENSOR_H_
11
// The following todo list do not refer to this class, but to the whole directory.
12
// The model/sensor directory is quite a stub. Please help to improve it ;)
14
/* TODO: improved sensor model. Different kind of sensor deviations should be considered to be included in such a model, including:
17
* - measurement of a property other than the one the sensor has to measure (such as temperature)
19
* - drift (short term / long term)
24
/* TODO: humidity / temperature / gas dispersion sensor,
25
* including a model that describes the dispersion of this environmental property. A special GMComponent need to be implemented,
26
* that simulates the gas dispersion and the sensor requests the current value at its given transform.
29
/* TODO: When an improved sensor model has been defined and it is clear what sensors will be on the real robot, these sensors need
30
* to be implemented accordingly.
33
#include <srCore/sensor/sensorBase.h>
37
class SampleSensor : public SensorBase
40
SampleSensor(dtCore::RefPtr<BodyBase> attachedBody = NULL,
41
osg::Vec3f translation = osg::Vec3f(2,0,0), osg::Vec3f orientation= osg::Vec3f(0,0,0),
42
std::string name = "noName",
45
virtual ~SampleSensor();
48
* \brief Writes the parameter value in parameter
50
* The available parameters can be retrieved by calling getParameterList()
51
* See also: ObjectBase::getParameter()
55
void getParameter(const std::string &name, ParameterReturnValue parameter);
58
* \brief Sets a parameter
60
* See also getParameter()
63
void setParameter(const std::string &name, ParameterReturnValue parameter);
65
//! sends command to retrieve data
66
void evaluate(ParameterReturnValue srv);
68
float myFancySimulatedEnvironmentFunction(osg::Vec3f pos, osg::Vec3f rot);
71
* \brief Request to get new data
73
* Put here your algorithms for simulated temperature, humidity and what so ever that can be expressed by function depending on the position and orientation.
79
* \brief Calculates a new sensor value
81
* It will be called every time step if it is an active sensor, otherwise it needs to be called by the controller
84
virtual void getNewSensorValue();
89
//! Will be called in RobotActorBase::TickLocal()
90
void update(float deltaSimTme);
94
virtual void getSensorValue(std::ostream& theStream) const;
103
#endif /* SAMPLESENSOR_H_ */