Go to the documentation of this file.
36 #ifndef __PERCEPTIVEMODELS_NODES_H__
37 #define __PERCEPTIVEMODELS_NODES_H__
42 #include <yarp/os/Value.h>
43 #include <yarp/os/Property.h>
83 virtual void execute(
void* ptr) = 0;
159 virtual bool fromProperty(
const yarp::os::Property &options) = 0;
166 virtual void toProperty(yarp::os::Property &options)
const = 0;
176 virtual bool toStream(std::ostream &str)
const = 0;
187 virtual bool calibrate(
const yarp::os::Property &options) = 0;
std::string getName() const
Retrieve the node name.
EventCallback()
Constructor.
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.
virtual bool calibrate(const yarp::os::Property &options)=0
Some kinds of nodes need to be calibrated to properly operate.
void addNeighbor(Node &node)
Add a node as a neighbor for the process of building the architecture.
Node * getNeighbor(const std::string &name) const
Retrieve a neighbor node by its name.
virtual bool getSensorsData(yarp::os::Value &data) const =0
Retrieve data from the whole set of attached sensors, giving back a standard representation of it.
virtual bool toStream(std::ostream &str) const =0
Similar to the toProperty() method but it operates on output streams (e.g.
bool removeNeighbor(const std::string &name)
Remove a node previously added as neighbor.
std::map< std::string, Sensor * > sensors
virtual bool getOutput(yarp::os::Value &out) const =0
Retrieve the node output computed over the sensors data.
virtual void toProperty(yarp::os::Property &options) const =0
Return a Property representation of all the node parameters.
void attachSensor(Sensor &sensor)
Attach a sensor object to the node.
virtual void execute(void *ptr)=0
The callback routine.
virtual bool isCalibrated() const =0
Return the internal status of the calibration.
std::map< std::string, Node * > neighbors
std::string getName() const
Retrieve the node name.
virtual bool fromProperty(const yarp::os::Property &options)=0
Configure the node taking its parameters from a Property object.
string(REPLACE "-rdynamic" "" CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS}") include_directories($
void attachCallback(EventCallback &callback)
Attach an event callback to the node.
virtual ~Node()
Destructor.
std::map< std::string, EventCallback * > callbacks