inertial
: Export an inertial sensor.
More...
#include <ServerInertial/ServerInertial.h>
Public Member Functions | |
ServerInertial () | |
Constructor. More... | |
ServerInertial (const ServerInertial &)=delete | |
ServerInertial (ServerInertial &&)=delete | |
ServerInertial & | operator= (const ServerInertial &)=delete |
ServerInertial & | operator= (ServerInertial &&)=delete |
~ServerInertial () override | |
bool | open (yarp::os::Searchable &config) override |
Open the device driver. More... | |
bool | close () override |
Close the DeviceDriver. More... | |
virtual bool | getInertial (yarp::os::Bottle &bot) |
void | run () override |
Main body of the new thread. More... | |
bool | read (yarp::os::ConnectionReader &connection) override |
Read this object from a network connection. More... | |
bool | read (yarp::sig::Vector &out) override |
Read a vector from the sensor. More... | |
bool | getChannels (int *nc) override |
Get the number of channels of the sensor. More... | |
bool | calibrate (int ch, double v) override |
Calibrate the sensor, single channel. More... | |
bool | attach (yarp::dev::PolyDriver *poly) override |
IWrapper interface Attach to another object. More... | |
bool | detach () override |
Detach the object (you must have first called attach). More... | |
bool | attachAll (const yarp::dev::PolyDriverList &p) override |
IMultipleWrapper interface Attach to a list of objects. More... | |
bool | detachAll () override |
Detach the object (you must have first called attach). More... | |
Public Member Functions inherited from yarp::dev::DeviceDriver | |
~DeviceDriver () override=default | |
Destructor. More... | |
template<class T > | |
bool | view (T *&x) |
Get an interface to the device driver. More... | |
virtual DeviceDriver * | getImplementation () |
Some drivers are bureaucrats, pointing at others. More... | |
Public Member Functions inherited from yarp::os::IConfig | |
virtual | ~IConfig () |
Destructor. More... | |
virtual bool | configure (Searchable &config) |
Change online parameters. More... | |
Public Member Functions inherited from yarp::dev::IWrapper | |
virtual | ~IWrapper () |
Destructor. More... | |
Public Member Functions inherited from yarp::dev::IMultipleWrapper | |
virtual | ~IMultipleWrapper () |
Destructor. More... | |
Public Member Functions inherited from yarp::os::PortReader | |
virtual | ~PortReader () |
Destructor. More... | |
virtual Type | getReadType () const |
Public Member Functions inherited from yarp::dev::IGenericSensor | |
virtual | ~IGenericSensor () |
inertial
: Export an inertial sensor.
The network interface is a single Port. We will stream bottles with 12 floats:
It reads the data from an Inertial measurement unit sensor and sends them through yarp port.
Parameters accepted in the config argument of the open method:
Parameter name | Type | Units | Default Value | Required | Description | Notes |
---|---|---|---|---|---|---|
name | string | - | - | Yes | full name of the port opened by the device, like /robotName/deviceId/sensorType:o | must start with a '/' character |
period | double | s | 0.005 | No | refresh period of the broadcasted values in ms (optional, default 5ms) | - |
subdevice | string | - | - | alternative to attach action | name of the yarp IMU device driver to be instantiated | if using yarprobotinterface or custom program the 'attach' action can be used instead |
ROS | group | - | - | No | Group containing parameter for ROS topic initialization | if missing, it is assumed to not use ROS topics |
useROS | string | true/false/only | - | if ROS group is present | set 'true' to have both yarp ports and ROS topic, set 'only' to have only ROS topic and no yarp port | - |
ROS_TopicName | string | - | - | if ROS group is present | set the name for ROS topic | must start with a leading '/' |
ROS_nodeName | string | - | - | if ROS group is present | set the name for ROS node | must start with a leading '/' |
ROS_msgType | string | enum | - | if ROS group is present | choose the message to be sent through ROS topic | supported value now is ONLY geometry_msgs/WrenchedStamped |
frame_id | string | - | - | if ROS group is present | name of reference frame the measures are referred to | - |
ROS message type used is sensor_msgs/Imu.msg (http://docs.ros.org/api/sensor_msgs/html/msg/Imu.html)
Some example of configuration files:
Configuration file using .ini format
Configuration file using .xml format.
ROS message type used is sensor_msgs/Imu.msg
Definition at line 108 of file ServerInertial.h.
ServerInertial::ServerInertial | ( | ) |
Constructor.
Definition at line 35 of file ServerInertial.cpp.
|
delete |
|
delete |
|
override |
Definition at line 81 of file ServerInertial.cpp.
|
overridevirtual |
IWrapper interface Attach to another object.
poly | the polydriver that you want to attach to. |
Implements yarp::dev::IWrapper.
Definition at line 517 of file ServerInertial.cpp.
|
overridevirtual |
IMultipleWrapper interface Attach to a list of objects.
p | the polydriver list that you want to attach to. |
Implements yarp::dev::IMultipleWrapper.
Definition at line 548 of file ServerInertial.cpp.
|
overridevirtual |
Calibrate the sensor, single channel.
ch | channel number |
v | reset valure |
Implements yarp::dev::IGenericSensor.
Definition at line 510 of file ServerInertial.cpp.
|
overridevirtual |
Close the DeviceDriver.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 342 of file ServerInertial.cpp.
|
overridevirtual |
Detach the object (you must have first called attach).
Implements yarp::dev::IWrapper.
Definition at line 543 of file ServerInertial.cpp.
|
overridevirtual |
Detach the object (you must have first called attach).
Implements yarp::dev::IMultipleWrapper.
Definition at line 559 of file ServerInertial.cpp.
|
overridevirtual |
Get the number of channels of the sensor.
nc | pointer to storage, return value |
Implements yarp::dev::IGenericSensor.
Definition at line 504 of file ServerInertial.cpp.
|
virtual |
Definition at line 362 of file ServerInertial.cpp.
|
overridevirtual |
Open the device driver.
Configure with a set of options.
config | The options to use |
These are:
subdevice | Common name of device to wrap (e.g. "fakeFrameGrabber"). |
name | Port name to assign to this server (default /grabber). |
config | The options to use |
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 274 of file ServerInertial.cpp.
|
delete |
|
delete |
|
overridevirtual |
Read this object from a network connection.
Override this for your particular class.
reader | an interface to the network connection for reading |
Implements yarp::os::PortReader.
Definition at line 488 of file ServerInertial.cpp.
|
overridevirtual |
Read a vector from the sensor.
out | a vector containing the sensor's last readings. |
Implements yarp::dev::IGenericSensor.
Definition at line 498 of file ServerInertial.cpp.
|
overridevirtual |
Main body of the new thread.
Override this method to do what you want. After Thread::start is called, this method will start running in a separate thread. It is important that this method either keeps checking Thread::isStopping to see if it should stop, or you override the Thread::onStop method to interact with it in some way to shut the new thread down. There is no really reliable, portable way to stop a thread cleanly unless that thread cooperates.
wait 5 ms.
Implements yarp::os::Thread.
Definition at line 394 of file ServerInertial.cpp.