AUTh-ARL Core Stack  0.7
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
arl::robot::Sensor Class Reference

An abstract class that implements a robot sensor. More...

#include <sensor.h>

Inheritance diagram for arl::robot::Sensor:

Public Types

enum  Type { FT_SENSOR, FORCE_SENSOR }
 Different sensor types. More...
 

Public Member Functions

 Sensor ()
 Empty constructor. More...
 
 Sensor (const std::string &name="Unnamed")
 Default constructor. More...
 
virtual void getData (KDL::JntArray &output)
 Reads the current joint positions to the robot using KDL. More...
 
virtual void getData (arma::vec &output)
 Reads the current joint positions from the robot using Armadillo. More...
 
virtual Eigen::Vector6d getData (const Eigen::Matrix3d &rotation)
 
virtual void getData (Eigen::VectorXd &output)
 Reads the current joint positions from the robot using Eigen. More...
 
std::string getName ()
 Returns the name of the sensor. More...
 
virtual bool isOk ()
 Returns if the robot sensor is ok and operable. Should be implemented according to the robot in use. More...
 

Public Attributes

double cycle
 The control cycle of the robot sensor. More...
 
std::string alias
 The alias of the robot sensor, which is the name in lower case without spaces. More...
 
Type type
 
std::string frame_id
 

Protected Member Functions

void throwFunctionIsNotImplemented (std::string function_name)
 

Protected Attributes

std::string sensor_name
 The name of the robot sensor. More...
 

Detailed Description

An abstract class that implements a robot sensor.

This class encaptulates functionalities that abstracts any robot sensor. The core functionalities are initialize and read from the robot sensor. This API class aims to support multiple client libraries like KDL, Armadillo or Eigen.

Member Enumeration Documentation

Different sensor types.

Enumerator
FT_SENSOR 
FORCE_SENSOR 

Constructor & Destructor Documentation

arl::robot::Sensor::Sensor ( )

Empty constructor.

arl::robot::Sensor::Sensor ( const std::string &  name = "Unnamed")
explicit

Default constructor.

Parameters
nameThe name of the robot sensor. Defaults to "Unnamed"

Here is the call graph for this function:

Member Function Documentation

void arl::robot::Sensor::getData ( KDL::JntArray &  output)
virtual

Reads the current joint positions to the robot using KDL.

Parameters
outputThe output given by the robot sensor

Reimplemented in ati::sensor::Sensor.

Here is the call graph for this function:

void arl::robot::Sensor::getData ( arma::vec &  output)
virtual

Reads the current joint positions from the robot using Armadillo.

Parameters
outputThe output given by the robot sensor

Reimplemented in ati::sensor::Sensor.

Here is the call graph for this function:

virtual Eigen::Vector6d arl::robot::Sensor::getData ( const Eigen::Matrix3d &  rotation)
inlinevirtual

Reimplemented in ati::sensor::Sensor.

void arl::robot::Sensor::getData ( Eigen::VectorXd &  output)
virtual

Reads the current joint positions from the robot using Eigen.

Parameters
outputThe output given by the robot sensor

Reimplemented in ati::sensor::Sensor.

Here is the call graph for this function:

std::string arl::robot::Sensor::getName ( )

Returns the name of the sensor.

Returns
The name of the sensor.
bool arl::robot::Sensor::isOk ( )
virtual

Returns if the robot sensor is ok and operable. Should be implemented according to the robot in use.

Returns
True if the robot haven't returns any errors. False otherwise.

Reimplemented in ati::sensor::Sensor.

void arl::robot::Sensor::throwFunctionIsNotImplemented ( std::string  function_name)
protected

Prints a warning that the function is not implemented by the derived class.

Member Data Documentation

std::string arl::robot::Sensor::alias

The alias of the robot sensor, which is the name in lower case without spaces.

double arl::robot::Sensor::cycle

The control cycle of the robot sensor.

Can be reading it online by the robot sensor or setted by the contructor of your robot.

std::string arl::robot::Sensor::frame_id
std::string arl::robot::Sensor::sensor_name
protected

The name of the robot sensor.

Type arl::robot::Sensor::type