#include <MobileRobotServer.h>
Inheritance diagram for propertyservice::mobilerobot::MobileRobotServer:

It provides default implementations for the setProperty and getProperty methods and parses property names according to the standard specification for mobile robots.
| Global Properties | |||||
| Property Name | read/ write | data type | Explanation | ||
| type | r | string | The type of the server. Always "robot" for mobile robots. | ||
| name | r | string | The name of the robot, i.e. "Pioneer" | ||
| version | r | string | The version of the robot server software. | ||
| properties | r | List<string> | A list of known properties.
| ||
| Mobile Robot Properties | |||||
| Property Name | read/ write | data type | Explanation | ||
| rw rw</br> | double double | The translational and rotational speed of a robot. Translation speed is expressed in m/s, and rotational speed in rad/s. Both velocities can also be set using a object of type RobotVelocity as the property value. | ||
| w rw w | RobotPosition RobotPosition | The robot's position can be set in either absolute or relative mode. In absolute mode, the coordinates are expressed in meters and the rotation angle in radians. In relative mode, coordinates are treated as differences to the current position. The internal coordinate system can be reset using the position.reset property. Relative position is always (0,0,0).
| ||
| Sensor Properties | |||||
| Property Name | read/ write | data type | Explanation | ||
| rw r r | SensorLocation double int | The location and measurement of a sensor referenced by "alias" can be read, and in some cases the location can also be set. The number of sensors that can be referenced using "alias" can be read using the alias.count property. |
Sensors are registed to a MobileRobotServer using an alias, e.g. "sonar", "bumper" etc. If multiple sensors are registered under the same alias, "alias.count" returns the number of registered sensors. Sensor properties can be set and read using a quite flexible notation: "alias[.numbers].property". If the number is omitted, 0 is used as a default. The number tells the server to set or read the numberth sensor. Examples:
sonar.count sonar.0.measurement (same as sonar.location) bumper.0.location sonar.0-7.measurement bumper.0,2,4,6.measurement radar.0,2-4,9.location
Public Methods | |
| MobileRobotServer () throw (ORBException&) | |
| Initialize a mobile robot server with default values. | |
| MobileRobotServer (CORBA::ORB_ptr orb) throw (ORBException&) | |
| Initialize a mobile robot server with a previously created orb. | |
| MobileRobotServer (std::string host, std::string name) throw (ORBException&) | |
| Initialize a mobile robot server and bind it to a name in a naming service. | |
| virtual | ~MobileRobotServer () |
| virtual void | setProperty (const util::List< std::string > &nameParts, util::Blob< char > value) throw (PropertyException&) |
| Default implementation for setProperty as inherited from PropertyServer. | |
| virtual void | setProperty (const util::List< std::string > &nameParts, const util::List< Sensor * > &sensors, util::Blob< char > value) |
| Set a value in multiple sensors. | |
| virtual util::Blob< char > * | getProperty (const util::List< std::string > &nameParts) throw (PropertyException&) |
| Default implementation for getProperty as inherited from PropertyServer. | |
| virtual util::Blob< char > * | getProperty (const util::List< std::string > &nameParts, const util::List< Sensor * > &sensors) |
| Get a value from multiple sensors. | |
| virtual std::string | getName () const=0 |
| Get the name of the robot, e.g. | |
| virtual std::string | getVersion () const=0 |
| Get the version of the software, e.g. | |
| virtual util::List< std::string > | getProperties () |
| Get a list of recognized properties. | |
| virtual RobotVelocity | getVelocity ()=0 |
| Get the current velocity of the robot. | |
| virtual void | setVelocity (RobotVelocity velocity)=0 |
| Set the velocity of the robot. | |
| virtual RobotPosition | getPosition ()=0 |
| Get the current position of the robot in world coordinates. | |
| virtual void | setAbsolutePosition (RobotPosition position)=0 |
| Set the target position of the robot in world coordinates. | |
| virtual void | setRelativePosition (RobotPosition position)=0 |
| Set the target position of the robot relative to its current coordinates. | |
| virtual void | resetPosition (RobotPosition position)=0 |
| Reset the robot's internal world coordinates to the given values. | |
| void | registerSensor (Sensor *sensor, std::string alias) |
| Register a sensor. | |
| void | unregisterSensor (Sensor *sensor, std::string alias) |
| Unregister a sensor that was previously registered under the indicated alias. | |
Protected Methods | |
| util::List< int > | extractIndices (std::string encoded) |
| Convert a notation like '1-3,5,9-11' to a list of integers (1,2,3,4,9,10,11). | |
| util::List< Sensor * > | extractSensors (const util::List< std::string > &nameParts, util::List< std::string > &propertyNames) throw (PropertyException&) |
| Convert a sensor request to a list of pointers to the requested sensors. | |
Protected Attributes | |
| util::Hashtable< std::string, util::List< Sensor * > > | _tblSensors |
| Table of sensors. | |
|
||||||||||||
|
Initialize a mobile robot server and bind it to a name in a naming service.
|
|
|
Get the name of the robot, e.g. "Pioneer". |
|
|
Get a list of recognized properties. The default implementation returns the standard property names. (Global and for all registered sensors.) |
|
||||||||||||
|
Get a value from multiple sensors. The default implementation recognizes the properties "location" and "measurement", which are passed to requested sensors.
|
|
|
Default implementation for getProperty as inherited from PropertyServer. This method parses the given property name parts, and recognizes the standard property names. It also passes sensor requests to getProperty(const List<string>&,const List<Sensor*>&). Subclasses may add whatever properties are needed by overriding this method. If the default behaviour is still needed, one may call MobileRobotServer::getProperty from the overridden method.
Implements propertyservice::PropertyServer. |
|
|
Get the version of the software, e.g. "1.2". |
|
||||||||||||
|
Register a sensor.
MobileRobotServer automatically parses requests to registered sensors. Example:
Sonar* sonar = new Sonar; server.registerSensor(sonar,"sonar"); In this case, sonar's getMeasurement() method is called whenever a client requests a property "sonar".
|
|
||||||||||||||||
|
Set a value in multiple sensors. The default implementation recognizes the property "location", which is passed to requested sensors.
|
|
||||||||||||
|
Default implementation for setProperty as inherited from PropertyServer. This method parses the given property name parts, and recognizes the standard property names. It also passes sensor requests to setProperty(const List<string>&,const List<Sensor*>&,Blob<char>). Subclasses may add whatever properties are needed by overriding this method. If the default behaviour is still needed, one may call MobileRobotServer::setProperty from the overridden method.
Implements propertyservice::PropertyServer. |
|
||||||||||||
|
Unregister a sensor that was previously registered under the indicated alias.
|
|
|
Table of sensors. Do not modify if you don't know what you are doing. |