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

Macro Definition Documentation

◆ ADD_GAUSSIAN

#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.

◆ ADD_NOISE

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

Definition at line 100 of file differential_steering_default_actuator.cpp.

◆ CHECK_ATTRIBUTE

#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.

◆ PARSE_ATTRIBUTES

#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.

◆ PICK_BIAS

#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()

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