|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
43 fprintf(stderr,
"%s\n", config.
toString().c_str());
52 if(!config.
check(
"period"))
55 yCError(FAKEANALOGSENSOR) <<
"Parameter 'period' missing";
60 yCError(FAKEANALOGSENSOR) <<
"Insufficient parameters to FakeAnalogSensor\n";
64 double period=config.
find(
"period").
asInt32() / 1000.0;
68 this->channelsNum = 1;
72 return PeriodicThread::start();
79 PeriodicThread::stop();
148 if (timeNow > timeStamp+10)
149 status = IAnalogSensor::AS_TIMEOUT;
151 status = IAnalogSensor::AS_OK;
FakeAnalogSensor(double period=0.02)
void threadRelease() override
Release method.
void resize(size_t size) override
Resize the vector.
A base class for nested structures that can be searched.
void run() override
Loop function.
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
int calibrateSensor() override
Calibrates the whole sensor.
#define YARP_LOG_COMPONENT(name,...)
double now()
Return the current time in seconds, relative to an arbitrary starting point.
An interface for the device drivers.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
bool setPeriod(double period)
Set the (new) period of the thread.
void zero()
Zero the elements of the vector.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
A generic interface to sensors (gyro, a/d converters).
int calibrateChannel(int ch) override
Calibrates one single channel.
int getChannels() override
Get the number of channels of the sensor.
#define yCError(component,...)
bool close() override
Close the DeviceDriver.
bool threadInit() override
Initialization method.
virtual std::int32_t asInt32() const
Get 32-bit integer value.
int getState(int ch) override
Check the state value of a given channel.
int read(yarp::sig::Vector &out) override
Read a vector from the sensor.
#define yCTrace(component,...)
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.