Robot Simulator of the Robotics Group for Self-Organization of Control
0.8.0
|
Class for sensing the torque that are applied to the joint by a motor. More...
#include <torquesensor.h>
Public Member Functions | |
TorqueSensor (double maxtorque=1.0, int avg=1) | |
virtual | ~TorqueSensor () |
virtual void | init (Primitive *own, Joint *joint=0) |
the primitive is not required here, set it to NULL More... | |
virtual int | getSensorNumber () const |
returns the number of sensors values produced by this sensor More... | |
virtual bool | sense (const GlobalData &globaldata) |
performs sense action More... | |
virtual std::list< sensor > | getList () const |
returns a list of sensor values (usually in the range [-1,1] ) This function should be overloaded. More... | |
virtual int | get (sensor *sensors, int length) const |
writes the sensor values (usually in the range [-1,1] ) into the given sensor array and returns the number of sensors written. More... | |
![]() | |
Sensor () | |
virtual | ~Sensor () |
virtual std::list < SensorMotorInfo > | getSensorInfos () const |
returns a list of sensor infos ( More... | |
virtual void | update () |
to update any visual appearance More... | |
std::list< sensor > | getListOfArray () const |
helper function for performance implementation of list<> get() based on array-get More... | |
![]() | |
SensorMotorInfoAble () | |
void | setBaseName (const std::string &basename) |
void | setBaseInfo (const SensorMotorInfo &baseinfo) |
SensorMotorInfo | getBaseInfo () |
void | setNamingFunc (const NamingFunction &func) |
NamingFunction | getNamingFunc () const |
void | setNames (const std::vector< std::string > &names) |
set names explicitly (basename is anyway suffixed) More... | |
std::string | getName (int index) const |
returns the name of a single item. Typically called from within Sensor and Motor class. More... | |
std::list< SensorMotorInfo > | getInfos (int number) const |
get all infos. More... | |
Additional Inherited Members | |
![]() | |
enum | Dimensions { X = 1, Y = 2, Z = 4, XY = X | Y, XZ = X | Z, YZ = Y | Z, XYZ = X | Y | Z } |
defines which dimensions should be sensed. The meaning is sensor specific. More... | |
![]() | |
typedef std::function < std::string(int)> | NamingFunction |
function that returns the name given the index More... | |
![]() | |
static std::list< sensor > | selectrows (const matrix::Matrix &m, short dimensions) |
selects the rows specified by dimensions (X->0, Y->1, Z->2) More... | |
static int | selectrows (sensor *sensors, int length, const matrix::Matrix &m, short dimensions) |
selects the rows specified by dimensions (X->0, Y->1, Z->2) More... | |
static Dimensions | parseSensorDimension (char *str) |
static std::string | dimensions2String (short dimensions) |
![]() | |
static std::string | defaultNameing (int index) |
the default implementation is for index==0: basename, otherwise basename + (index+1) More... | |
![]() | |
NamingFunction | func |
SensorMotorInfo | baseinfo |
Class for sensing the torque that are applied to the joint by a motor.
The sensor value can be interpreted as a motor current.
TorqueSensor | ( | double | maxtorque = 1.0 , |
int | avg = 1 |
||
) |
maxtorque | at this torque the sensor value is 1. |
avg | number of averaging steps (def 1) (very noisy for universal joint) |
|
virtual |
|
virtual |
writes the sensor values (usually in the range [-1,1] ) into the given sensor array and returns the number of sensors written.
A default implementation based on get() is provided. Only if performance matters overwrite this function.
sensors | call by refernce array which received the values |
length | capacity of sensors array |
Reimplemented from Sensor.
|
virtual |
returns a list of sensor values (usually in the range [-1,1] ) This function should be overloaded.
If performance matters, implement get(double*, int) and use getListOfArray to implement this.
Implements Sensor.
|
virtual |
returns the number of sensors values produced by this sensor
Implements Sensor.
the primitive is not required here, set it to NULL
joint | the joint on which to measure the torques. |
Implements Sensor.
|
virtual |
performs sense action
Implements Sensor.