NimbRo ROS Soccer Package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
behaviour_common.h File Reference

Common definitions include file for the internal Behaviour Control Framework source code. More...

#include <cstddef>
#include <vector>
#include <string>
#include <sstream>
#include <typeinfo>
#include <boost/static_assert.hpp>
#include <boost/type_traits.hpp>
#include <boost/utility/enable_if.hpp>

Go to the source code of this file.

Classes

class  behaviourcontrol::Sensor< T >
 Implements a single sensor of a given data type. More...
 
class  behaviourcontrol::Actuator< T >
 Implements a single actuator of a given data type. More...
 

Namespaces

 behaviourcontrol
 This namespace defines everything that is required for the Behaviour Control Framework.
 

Macros

#define CURRENT_FUNC   "<unknown>"
 
Error Macros

A collection of macros that wrap the reportError() function to make shortcuts for reporting warnings, errors and making assertions.

#define REPORT_ERROR(MBasePtr, msg)   (MBasePtr)->reportError((msg),true,CURRENT_FUNC,__FILE__,__LINE__)
 Reports a std::string error message msg to the behaviour manager pointed to by MBasePtr (fatal = true).
 
#define REPORT_ERROR_(MBase, msg)   (MBase).reportError((msg),true,CURRENT_FUNC,__FILE__,__LINE__)
 Reports a std::string error message msg to the MBase behaviour manager (fatal = true).
 
#define REPORT_WARNING(MBasePtr, msg)   (MBasePtr)->reportError((msg),false,CURRENT_FUNC,__FILE__,__LINE__)
 Reports a std::string warning message msg to the behaviour manager pointed to by MBasePtr (fatal = false).
 
#define REPORT_WARNING_(MBase, msg)   (MBase).reportError((msg),false,CURRENT_FUNC,__FILE__,__LINE__)
 Reports a std::string warning message msg to the MBase behaviour manager (fatal = false).
 
#define ASSERT_ERROR(cond, MBasePtr, msg)   if(!(cond)) { REPORT_ERROR((MBasePtr),msg); return; }
 Reports a std::string error message msg to the behaviour manager pointed to by MBasePtr if cond evaluates to false (fatal = true).
 
#define ASSERT_ERROR_(cond, MBase, msg)   if(!(cond)) { REPORT_ERROR_((MBase),msg); return; }
 Reports a std::string error message msg to the MBase behaviour manager if cond evaluates to false (fatal = true).
 
#define ASSERT_WARNING(cond, MBasePtr, msg)   if(!(cond)) { REPORT_WARNING((MBasePtr),msg); return; }
 Reports a std::string warning message msg to the behaviour manager pointed to by MBasePtr if cond evaluates to false (fatal = false).
 
#define ASSERT_WARNING_(cond, MBase, msg)   if(!(cond)) { REPORT_WARNING_((MBase),msg); return; }
 Reports a std::string warning message msg to the MBase behaviour manager if cond evaluates to false (fatal = false).
 

Typedefs

Sensor Typedefs

More synonyms have been included than you will normally ever need. Additional commonly-used typedefs (that have extra dependencies) can be added in the user's code. For example:

typedef Sensor<std::int64_t> SensorInt64 // Needs <cstdint>
typedef Sensor<std::uint64_t> SensorUInt64 // Needs <cstdint>
typedef Sensor<Eigen::Vector2f> SensorVec2f // Needs <Eigen/Core>
typedef Sensor<Eigen::Vector3f> SensorVec3f // Needs <Eigen/Core>
typedef Sensor<Eigen::Vector2d> SensorVec2d // Needs <Eigen/Core>
typedef Sensor<Eigen::Vector3d> SensorVec3d // Needs <Eigen/Core>
typedef Sensor< bool > behaviourcontrol::SensorBool
 An sensor of data type bool
 
typedef Sensor< int > behaviourcontrol::SensorInt
 An sensor of data type int
 
typedef Sensor< unsigned int > behaviourcontrol::SensorUInt
 An sensor of data type unsigned int
 
typedef Sensor< long > behaviourcontrol::SensorLong
 An sensor of data type long
 
typedef Sensor< unsigned long > behaviourcontrol::SensorULong
 An sensor of data type unsigned long
 
typedef Sensor< long long > behaviourcontrol::SensorLLong
 An sensor of data type long long
 
typedef Sensor< unsigned long
long > 
behaviourcontrol::SensorULLong
 An sensor of data type unsigned long long
 
typedef Sensor< float > behaviourcontrol::SensorFloat
 An sensor of data type float
 
typedef Sensor< double > behaviourcontrol::SensorDouble
 An sensor of data type double
 
typedef Sensor< long double > behaviourcontrol::SensorLDouble
 An sensor of data type long double
 
Actuator Typedefs

More synonyms have been included than you will normally ever need. Additional commonly-used typedefs (that have extra dependencies) can be added in the user's code. For example:

typedef Actuator<std::int64_t> ActuatorInt64 // Needs <cstdint>
typedef Actuator<std::uint64_t> ActuatorUInt64 // Needs <cstdint>
typedef Actuator<Eigen::Vector2f> ActuatorVec2f // Needs <Eigen/Core>
typedef Actuator<Eigen::Vector3f> ActuatorVec3f // Needs <Eigen/Core>
typedef Actuator<Eigen::Vector2d> ActuatorVec2d // Needs <Eigen/Core>
typedef Actuator<Eigen::Vector3d> ActuatorVec3d // Needs <Eigen/Core>
typedef Actuator< bool > behaviourcontrol::ActuatorBool
 An actuator of data type bool
 
typedef Actuator< int > behaviourcontrol::ActuatorInt
 An actuator of data type int
 
typedef Actuator< unsigned int > behaviourcontrol::ActuatorUInt
 An actuator of data type unsigned int
 
typedef Actuator< long > behaviourcontrol::ActuatorLong
 An actuator of data type long
 
typedef Actuator< unsigned long > behaviourcontrol::ActuatorULong
 An actuator of data type unsigned long
 
typedef Actuator< long long > behaviourcontrol::ActuatorLLong
 An actuator of data type long long
 
typedef Actuator< unsigned
long long > 
behaviourcontrol::ActuatorULLong
 An actuator of data type unsigned long long
 
typedef Actuator< float > behaviourcontrol::ActuatorFloat
 An actuator of data type float
 
typedef Actuator< double > behaviourcontrol::ActuatorDouble
 An actuator of data type double
 
typedef Actuator< long double > behaviourcontrol::ActuatorLDouble
 An actuator of data type long double
 
Miscellaneous Typedefs
typedef std::size_t behaviourcontrol::index_t
 Used to represent an array or vector index (must be an unsigned type)
 
typedef float behaviourcontrol::level_t
 Used to represent an activation level (raw activation levels should always be in the range [0,1])
 
typedef int behaviourcontrol::ret_t
 Used to represent an error code/function return value.
 

Enumerations

enum  behaviourcontrol::FuncReturnID {
  behaviourcontrol::RET_OK = 0, behaviourcontrol::RET_MISC_FAILURE, behaviourcontrol::RET_NULL_POINTER, behaviourcontrol::RET_PREVIOUS_FATAL_ERROR,
  behaviourcontrol::RET_ALREADY_INITIALISED, behaviourcontrol::RET_BIND_FAILED_NS, behaviourcontrol::RET_BIND_FAILED_ANF, behaviourcontrol::RET_BIND_FAILED_ASI,
  behaviourcontrol::RET_INHIBITION_CYCLE
}
 Used to specify return values and error codes of certain behaviour control framework functions. More...
 

Functions

template<class T >
void behaviourcontrol::addIfUnique (std::vector< T > &V, T &value)
 Add an element to a std::vector if an equivalent element (A == B) is not already in there. More...
 

Variables

const std::string behaviourcontrol::nullString = ""
 Used to avoid the need for null string literals throughout the code.
 
const level_t behaviourcontrol::LVL_ACTIVE = 1.0
 Used to signal that a behaviour wishes to be fully activated.
 
const level_t behaviourcontrol::LVL_INACTIVE = 0.0
 Used to signal that a behaviour wishes to be fully deactivated.
 
const bool behaviourcontrol::AGGREGATABLE = true
 Used in the Actuator constructor to explicitly specify an aggregatable actuator.
 
const bool behaviourcontrol::NOT_AGGREGATABLE = false
 Used in the Actuator constructor to specify a non-aggregatable actuator.
 

Detailed Description

Common definitions include file for the internal Behaviour Control Framework source code.