Fawkes API  Fawkes Development Version
fawkes::BlockedTimingAspect Class Reference

Thread aspect to use blocked timing. More...

#include <>>

Inherits fawkes::Aspect.

Inherited by AgentControlThread, AmclThread, BallPosLogThread, BBLogReplayBlockedTimingThread, Bumblebee2Thread, ClipsAgentThread, ColliActThread, DepthcamSimThread, DynamixelActThread, DynamixelSensorThread, ExampleBlackBoardThread, ExampleThread, FvBaseThread, GazeboNodeThread, GazsimCommThread, GazsimTimesourceThread, GossipExampleReceiverThread, GossipExampleSenderThread, IMUSensorThread, JacoActThread, JacoBimanualActThread, JacoInfoThread, JoystickActThread, JoystickSensorThread, JoystickTeleOpThread, KatanaActThread, KatanaSensorThread, LaserClusterThread, LaserFilterThread, LaserLinesThread, LaserPointCloudThread, LaserSensorThread, LaserSimThread, LocalizationSimThread, LuaAgentContinuousExecutionThread, LuaAgentPeriodicExecutionThread, MapLaserGenThread, NaoQiButtonThread, NaoQiDCMThread, NaoQiLedThread, NaoQiMotionThread, NaoQiSpeechSynthThread, NavGraphThread, OpenNiContextThread, OpenNiDepthThread, OpenNiHandTrackerThread, OpenNiImageThread, OpenNiPclOnlyThread, OpenNiPointCloudThread, OpenNiUserTrackerThread, OpenPRSAgentThread, OpenPRSExampleThread, OpenPRSThread, OpenRaveMessageHandlerThread, OpenRaveThread, PanTiltActThread, PanTiltSensorThread, PlayerClientThread, PlayerF2PThread, PlayerPostSyncThread, PlayerTimeSyncThread, PointCloudDBROSCommThread, RefBoxCommThread, RobotinoActThread, RobotinoIrPclThread, RobotinoRosJointsThread, RobotinoSensorThread, RobotinoSimThread, RobotStatePublisherThread, Roomba500Thread, RoombaJoystickThread, RoombaSensorThread, RosImagesThread, RosLaserScanThread, RosMoveBaseThread, RosNavgraphBreakoutThread, RosNavigatorThread, ROSNodeThread, ROSOdometryThread, RosPointCloudThread, RosSkillerThread, ROSTalkerPubThread, RosTfThread, RRDExampleThread, SkillerExecutionThread, TfExampleThread, VisLocalizationThread, WebcamSimThread, and XabslEngineThread.

Public Types

enum  WakeupHook {
  WAKEUP_HOOK_PRE_LOOP, WAKEUP_HOOK_SENSOR_ACQUIRE, WAKEUP_HOOK_SENSOR_PREPARE, WAKEUP_HOOK_SENSOR_PROCESS,
  WAKEUP_HOOK_WORLDSTATE, WAKEUP_HOOK_THINK, WAKEUP_HOOK_SKILL, WAKEUP_HOOK_ACT,
  WAKEUP_HOOK_ACT_EXEC, WAKEUP_HOOK_POST_LOOP
}
 Type to define at which hook the thread is woken up. More...
 

Public Member Functions

 BlockedTimingAspect (WakeupHook wakeup_hook)
 Constructor. More...
 
virtual ~BlockedTimingAspect ()
 Virtual empty destructor. More...
 
WakeupHook blockedTimingAspectHook () const
 Get the wakeup hook. More...
 
- Public Member Functions inherited from fawkes::Aspect
const std::list< const char * > & get_aspects () const
 Get list of aspect names attached to a aspected thread. More...
 

Static Public Member Functions

static const char * blocked_timing_hook_to_string (WakeupHook hook)
 Get string for wakeup hook. More...
 

Additional Inherited Members

- Protected Member Functions inherited from fawkes::Aspect
void add_aspect (const char *name)
 Add an aspect to a thread. More...
 

Detailed Description

Thread aspect to use blocked timing.

The Fawkes main application provides basic means to synchronize all running thread with respect to several given hooks (see WakeupHook). Threads of a woken up at a particular point in time. The hooks basically correspond to an extended sense - plan - act kind of loop. Your thread must run in Thread::OPMODE_WAITFORWAKEUP mode, otherwise it is not started. This is a requirement for having the BlockedTimingAspect.

See also
Thread::OpMode
Author
Tim Niemueller

Definition at line 34 of file blocked_timing.h.

Member Enumeration Documentation

◆ WakeupHook

Type to define at which hook the thread is woken up.

See FawkesMainThread for information when and in which order the hooks are called.

See also
FawkesMainThread::loop()
Enumerator
WAKEUP_HOOK_PRE_LOOP 

before each loop

WAKEUP_HOOK_SENSOR_ACQUIRE 

sensor acquisition thread, acquire data from sensor

WAKEUP_HOOK_SENSOR_PREPARE 

sensor data preparation thread, convert acquired data to usable format

WAKEUP_HOOK_SENSOR_PROCESS 

sensor data processing thread

WAKEUP_HOOK_WORLDSTATE 

world state thread

WAKEUP_HOOK_THINK 

think thread (agent)

WAKEUP_HOOK_SKILL 

skill thread (skill module)

WAKEUP_HOOK_ACT 

act thread (motor module etc.)

WAKEUP_HOOK_ACT_EXEC 

act execution thread

WAKEUP_HOOK_POST_LOOP 

run after loop

Definition at line 42 of file blocked_timing.h.

Constructor & Destructor Documentation

◆ BlockedTimingAspect()

fawkes::BlockedTimingAspect::BlockedTimingAspect ( WakeupHook  wakeup_hook)

Constructor.

This special constructor is needed to define the wakeup point.

Parameters
wakeup_hookhook when this thread should be woken up

Definition at line 54 of file blocked_timing.cpp.

References fawkes::Aspect::add_aspect().

Referenced by NavGraphThread::NavGraphThread().

◆ ~BlockedTimingAspect()

fawkes::BlockedTimingAspect::~BlockedTimingAspect ( )
virtual

Virtual empty destructor.

Definition at line 62 of file blocked_timing.cpp.

Member Function Documentation

◆ blocked_timing_hook_to_string()

const char * fawkes::BlockedTimingAspect::blocked_timing_hook_to_string ( WakeupHook  hook)
static

Get string for wakeup hook.

Parameters
hookwakeup hook to get string for
Returns
string representation of hook

Definition at line 84 of file blocked_timing.cpp.

References WAKEUP_HOOK_ACT, WAKEUP_HOOK_ACT_EXEC, WAKEUP_HOOK_POST_LOOP, WAKEUP_HOOK_PRE_LOOP, WAKEUP_HOOK_SENSOR_ACQUIRE, WAKEUP_HOOK_SENSOR_PREPARE, WAKEUP_HOOK_SENSOR_PROCESS, WAKEUP_HOOK_SKILL, WAKEUP_HOOK_THINK, and WAKEUP_HOOK_WORLDSTATE.

◆ blockedTimingAspectHook()

BlockedTimingAspect::WakeupHook fawkes::BlockedTimingAspect::blockedTimingAspectHook ( ) const

Get the wakeup hook.

The wakeup hook defines when this thread should be woken up. This heavily depends on the used main thread.

Returns
wakeup hook

Definition at line 73 of file blocked_timing.cpp.

Referenced by fawkes::ThreadManager::set_inifin().


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