differential_steering_default_actuator.cpp File Reference
#include "differential_steering_default_actuator.h"
#include <argos3/core/utility/logging/argos_log.h>
#include <argos3/core/utility/plugins/factory.h>
Include dependency graph for differential_steering_default_actuator.cpp:

Go to the source code of this file.

Namespaces

 argos
 The namespace containing all the ARGoS related code.
 

Macros

#define CHECK_ATTRIBUTE(ATTR)
 
#define PARSE_ATTRIBUTES(ATTR, VAR)
 
#define PICK_BIAS(LRW)   m_fNoiseBias[LRW ## _WHEEL] = m_pcRNG->Gaussian(fNoiseBiasStdDev[LRW ## _WHEEL], fNoiseBiasAvg[LRW ## _WHEEL])
 
#define ADD_GAUSSIAN(LRW)
 
#define ADD_NOISE(LRW)
 

Functions

 REGISTER_ACTUATOR (CDifferentialSteeringDefaultActuator,"differential_steering","default","Carlo Pinciroli [ilpincy@gmail.com]","1.0","The differential steering actuator.","This actuator controls the two wheels a differential steering robot. For a\n""complete description of its usage, refer to the\n""ci_differential_steering_actuator.h file.\n\n""REQUIRED XML CONFIGURATION\n\n"" <controllers>\n"" ...\n"" <my_controller ...>\n"" ...\n"" <actuators>\n"" ...\n"" <differential_steering implementation=\"default\" />\n"" ...\n"" </actuators>\n"" ...\n"" </my_controller>\n"" ...\n"" </controllers>\n\n""OPTIONAL XML CONFIGURATION\n\n""It is possible to specify noisy speed in order to match the characteristics\n""of the real robot. For each wheel, the noise model is as follows:\n\n""w = ideal wheel actuation (as set in the controller)\n""b = random bias from a Gaussian distribution\n""f = random factor from a Gaussian distribution\n""a = actual actuated value\n\n""a = f * (w + b)\n\n""You can configure the average and stddev of both the bias and the factor. This\n""can be done with the optional attributes: 'bias_avg', 'bias_stddev',\n""'factor_avg', and 'factor_stddev'. Bias attributes are expressed in m/s, while\n""factor attributes are dimensionless. If none of these attributed is specified,\n""no noise is added. If at least one of these attributed is specified, noise is\n""added and, for the non-specified attributes, the default value of 1 is used for\n""the '*_avg' attributes, while 0 is used for '*_stddev' attributes. Examples:\n\n"" <controllers>\n"" ...\n"" <my_controller ...>\n"" ...\n"" <actuators>\n"" ...\n"" <!-- Only the stddev of the bias\n"" Noise is on, other attributes are default -->\n"" <differential_steering implementation=\"default\"\n"" bias_stddev=\"2\" />\n"" <!-- Only the stddev of the factor\n"" Noise is on, other attributes are default -->\n"" <differential_steering implementation=\"default\"\n"" factor_stddev=\"4\" />\n"" <!-- All attributes set\n"" Noise is on, specified values are set -->\n"" <differential_steering implementation=\"default\"\n"" bias_avg=\"1\"\n"" bias_stddev=\"2\"\n"" factor_avg=\"3\"\n"" factor_stddev=\"4\" />\n"" ...\n"" </actuators>\n"" ...\n"" </my_controller>\n"" ...\n"" </controllers>\n\n""The above examples set the same noise for both wheels. If you want to set\n""different noise parameters for each wheel, append '_left' and '_right' to the\n""attribute names:\n\n"" <controllers>\n"" ...\n"" <my_controller ...>\n"" ...\n"" <actuators>\n"" ...\n"" <!-- Mix of wheel-specific attributes set\n"" Noise is on, specified values are set -->\n"" <differential_steering implementation=\"default\"\n"" bias_avg_left=\"1\"\n"" bias_stddev_right=\"2\"\n"" factor_avg_left=\"3\"\n"" factor_stddev_right=\"4\" />\n"" ...\n"" </actuators>\n"" ...\n"" </my_controller>\n"" ...\n"" </controllers>\n\n""Wheel-specific attributes overwrite the values of non-wheel specific attributes.\n""So, if you set 'bias_avg' = 2 and then 'bias_avg_left' = 3, the left wheel will\n""use 3 and the right wheel will use 2.\n\n""Physics-engine-specific attributes that affect this actuator might also be\n""available. Check the documentation of the physics engine you're using for more\n""information.","Usable")
 

Macro Definition Documentation

#define ADD_GAUSSIAN (   LRW)
Value:
(m_fNoiseFactorStdDev[LRW ## _WHEEL] > 0.0 ? \
m_pcRNG->Gaussian(m_fNoiseFactorStdDev[LRW ## _WHEEL], \
m_fNoiseFactorAvg[LRW ## _WHEEL]) : \
m_fNoiseFactorAvg[LRW ## _WHEEL])

Definition at line 94 of file differential_steering_default_actuator.cpp.

#define ADD_NOISE (   LRW)
Value:
m_fCurrentVelocity[LRW ## _WHEEL] = \
* \
(m_fCurrentVelocity[LRW ## _WHEEL] + \
m_fNoiseBias[LRW ## _WHEEL]);

Definition at line 100 of file differential_steering_default_actuator.cpp.

#define CHECK_ATTRIBUTE (   ATTR)
Value:
(NodeAttributeExists(t_tree, ATTR) || \
NodeAttributeExists(t_tree, ATTR "_left") || \
NodeAttributeExists(t_tree, ATTR "_right"))
bool NodeAttributeExists(TConfigurationNode &t_node, const std::string &str_attribute)
Returns true if the specified attribute of a node exists.

Definition at line 48 of file differential_steering_default_actuator.cpp.

#define PARSE_ATTRIBUTES (   ATTR,
  VAR 
)
Value:
GetNodeAttributeOrDefault<Real>(t_tree, ATTR, VAR[LEFT_WHEEL], VAR[LEFT_WHEEL]); \
VAR[RIGHT_WHEEL] = VAR[LEFT_WHEEL]; \
GetNodeAttributeOrDefault<Real>(t_tree, ATTR "_left", VAR[LEFT_WHEEL], VAR[LEFT_WHEEL]); \
GetNodeAttributeOrDefault<Real>(t_tree, ATTR "_right", VAR[RIGHT_WHEEL], VAR[RIGHT_WHEEL]);

Definition at line 53 of file differential_steering_default_actuator.cpp.

#define PICK_BIAS (   LRW)    m_fNoiseBias[LRW ## _WHEEL] = m_pcRNG->Gaussian(fNoiseBiasStdDev[LRW ## _WHEEL], fNoiseBiasAvg[LRW ## _WHEEL])

Definition at line 59 of file differential_steering_default_actuator.cpp.

Function Documentation

REGISTER_ACTUATOR ( CDifferentialSteeringDefaultActuator  ,
"differential_steering"  ,
"default"  ,
"Carlo Pinciroli "  [ilpincy @gmail.com],
"1.0"  ,
"The differential steering actuator."  ,
"This actuator controls the two wheels a differential steering robot. For a\n""complete description of its  usage,
refer to the\n""ci_differential_steering_actuator.h file.\n\n""REQUIRED XML CONFIGURATION\n\n""< controllers >\n""...\n""< my_controller...>\n""...\n""< actuators >\n""...\n""< differential_steering implementation=\"default\" />\n"" ...\n"" </actuators>\n"" ...\n"" </my_controller>\n"" ...\n"" </controllers>\n\n""OPTIONAL XML CONFIGURATION\n\n""It is possible to specify noisy speed in order to match the characteristics\n""of the real robot. For each  wheel,
the noise model is as follows:\n\n""  w = ideal wheel actuation (as set in the controller)\n""b = random bias from a Gaussian distribution\n""f = random factor from a Gaussian distribution\n""a = actual actuated value\n\n""a = f * (w + b)\n\n""You can configure the average and stddev of both the bias and the factor. This\n""can be done with the optional attributes: 'bias_avg',
'bias_stddev'  ,
\n""'factor_avg'  ,
and 'factor_stddev'.Bias attributes are expressed in m/  s,
while\n""factor attributes are dimensionless.If none of these attributed is  specified,
\n""no noise is added.If at least one of these attributed is  specified,
noise is\n""added  and,
for the non-specified  attributes,
the default value of 1 is used for\n""the '*_avg'  attributes,
while 0 is used for '*_stddev'attributes.Examples:\n\n""< controllers >\n""...\n""< my_controller...>\n""...\n""< actuators >\n""...\n""<!--Only the stddev of the bias\n""Noise is on, other attributes are default-->\n""< differential_steering implementation=\"default\"\n"" bias_stddev=\"2\" />\n"" <!-- Only the stddev of the factor\n"" Noise is on, other attributes are default -->\n"" <differential_steering implementation=\"default\"\n"" factor_stddev=\"4\" />\n"" <!-- All attributes set\n"" Noise is on, specified values are set -->\n"" <differential_steering implementation=\"default\"\n"" bias_avg=\"1\"\n"" bias_stddev=\"2\"\n"" factor_avg=\"3\"\n"" factor_stddev=\"4\" />\n"" ...\n"" </actuators>\n"" ...\n"" </my_controller>\n"" ...\n"" </controllers>\n\n""The above examples set the same noise for both wheels. If you want to set\n""different noise parameters for each  wheel,
append '_left'and '_right'to the\n""attribute names:\n\n""< controllers >\n""...\n""< my_controller...>\n""...\n""< actuators >\n""...\n""<!--Mix of wheel-specific attributes set\n""Noise is on, specified values are set-->\n""< differential_steering implementation=\"default\"\n"" bias_avg_left=\"1\"\n"" bias_stddev_right=\"2\"\n"" factor_avg_left=\"3\"\n"" factor_stddev_right=\"4\" />\n"" ...\n"" </actuators>\n"" ...\n"" </my_controller>\n"" ...\n"" </controllers>\n\n""Wheel-specific attributes overwrite the values of non-wheel specific attributes.\n""  So,
if you set 'bias_avg'  = 2 and then 'bias_avg_left' = 3,
the left wheel will\n""use 3 and the right wheel will use 2.\n\n""Physics-engine-specific attributes that affect this actuator might also be\n""available.Check the documentation of the physics engine you're using for more\n""information."  ,
"Usable"   
)