Main Page · Modules · All Classes · Class Hierarchy
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
MALedsController Class Reference

Leds controller class. More...

#include <MALedsController.hpp>

Inheritance diagram for MALedsController:
MAController MARobotStateUpdater MAContainerLocker

Public Member Functions

virtual MA::DeviceList GetMotors () const override
 Get the list of the motors. More...
 
virtual int StartTransition (const std::string &name) override
 Start a transition. More...
 
virtual void StopTransition (const std::string &name) override
 Stop a transition. More...
 
virtual MA::DeviceGeneratorsMap GetSkitTransitionGenerators (MA::SkitBaseSPtr skit) override
 Get skit transition generators. More...
 
- Public Member Functions inherited from MAController
 MAController (MA::ControllerType controller_type)
 Class constructor. More...
 
MC::StringList GetTransitionNames () const
 Get the list of the transition names. More...
 
MC::StringList GetActiveTransitionsByDevice (const MADevice &device)
 Get a transition list by device. More...
 
bool IsTransitionActive (const std::string &name)
 Whenever the transition is still active. More...
 
bool IsAnyActiveTransition ()
 Check if any transition is active. More...
 
bool IsAnyActiveSkitTransition ()
 Check if any skit transition is active. More...
 
bool IsTransitionSuccessful (const std::string &name)
 Whenever the transition is successful. More...
 
bool TransitionHasCheck (const std::string &name)
 Test if the transition has a check. More...
 
- Public Member Functions inherited from MARobotStateUpdater
 MARobotStateUpdater (MA::RobotStateUpdateType update_type)
 Struct constructor.
 
virtual ~MARobotStateUpdater ()
 Struct destructor.
 
- Public Member Functions inherited from MAContainerLocker
 MAContainerLocker (const std::string &class_name, const std::string &file_name)
 Class constructor. More...
 
int RegisterContainer (const std::string &container_name)
 Register a container for locking. More...
 
int Lock (int container_id, int line, const char *file_name=nullptr)
 Lock a container. More...
 
int Unlock (int container_id, int line, const char *file_name=nullptr)
 Unlock a container. More...
 

Protected Attributes

boost::scoped_ptr< MADeviceBackFBlue
 Back fore blue LED.
 
boost::scoped_ptr< MADeviceBackFWhite
 Back fore white LED.
 
boost::scoped_ptr< MADeviceBackMOrange
 Back middle orange LED.
 
boost::scoped_ptr< MADeviceBackMWhite
 Back middle white LED.
 
boost::scoped_ptr< MADeviceBackRRed
 Back rear red LED.
 
boost::scoped_ptr< MADeviceBackRWhite
 Back rear white LED.
 
boost::scoped_ptr< MADeviceHeadWifi
 Head WiFi LED.
 
boost::scoped_ptr< MADeviceHeadYellow
 Head yellow LED.
 
boost::scoped_ptr< MADeviceHeadWhite
 Head white LED.
 
boost::scoped_ptr< MADeviceEarsRed
 Ears red LED.
 
boost::scoped_ptr< MADeviceEarsGreen
 Ears green LED.
 
boost::scoped_ptr< MADeviceEarsBlue
 Ears blue LED.
 
boost::scoped_ptr< MADeviceFace [14]
 Face LEDs.
 
MA::TransitionLedModeMap TransitionLedModes
 The map of the special transition LED modes.
 
int LedModeForSkitter
 LED mode for Skitter skits.
 
int ShownBatteryLevel
 The shown battery level on the LEDs.
 
- Protected Attributes inherited from MAController
MA::ControllerType Type
 Controller type.
 
MA::TransitionMap Transitions
 The map of the transitions.
 

Private Member Functions

virtual void UpdateRobotState (MARobotState &robot_state) override
 Update the robot state. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MAController
static void SetVerbose (bool new_state)
 Set the verbosity of the controller domain. More...
 
static bool IsVerbose ()
 Get the verbosity of the controller domain. More...
 
- Static Public Member Functions inherited from MARobotStateUpdater
static void RegisterUpdater (MARobotStateUpdater &updater)
 Register a robot state updater. More...
 
static void Run (MARobotState &state)
 Run the robot state updates. More...
 
- Protected Member Functions inherited from MAController
void GeneratorContainerExpired (MAGeneratorContainer &container)
 Slot for the expired generator containers. More...
 
MA::TransitionMap::iterator RegisterSkitTransition (const std::string &skit_name)
 Register a skit transition if it has not been. More...
 

Detailed Description

Leds controller class.

Definition at line 55 of file MALedsController.hpp.

Member Function Documentation

MA::DeviceList MALedsController::GetMotors ( ) const
overridevirtual

Get the list of the motors.

Returns
List of motors

Implements MAController.

Definition at line 108 of file MALedsController.cpp.

MA::DeviceGeneratorsMap MALedsController::GetSkitTransitionGenerators ( MA::SkitBaseSPtr  skit)
overridevirtual

Get skit transition generators.

Parameters
skitMotion skit
Returns
Generator map of a skit for the current controller

Implements MAController.

Definition at line 801 of file MALedsController.cpp.

int MALedsController::StartTransition ( const std::string &  name)
overridevirtual

Start a transition.

Parameters
nameThe name of transition
Returns
The duration of the transition

The Skitter skits have a special name format: "SKIT:name:1.23:0" where the components are separated with double colon. The prefix (SKIT) must be written in capitals, the second part is the skit name and the third is a duration multiplier. The last part defines a duration in milliseconds if the robot joints must be moved to the started position. If the third or fourth parts are not defined, their default values are 1.0 and 0 respectively.

Reimplemented from MAController.

Definition at line 115 of file MALedsController.cpp.

void MALedsController::StopTransition ( const std::string &  name)
overridevirtual

Stop a transition.

Parameters
nameThe name of transition

Reimplemented from MAController.

Definition at line 135 of file MALedsController.cpp.

void MALedsController::UpdateRobotState ( MARobotState state)
overrideprivatevirtual

Update the robot state.

Parameters
stateRobot state to be updated

Implements MARobotStateUpdater.

Definition at line 102 of file MALedsController.cpp.


The documentation for this class was generated from the following files: