Fawkes API
Fawkes Development Version
|
#include <>>
Inherits fawkes::SyncPointAspect.
Inherited by AgentControlThread, AmclThread, BallPosLogThread, BBLogReplayBlockedTimingThread, Bumblebee2Thread, CedarThread, ClipsAgentThread, ClipsExecutiveThread, ColliActThread, DepthcamSimThread, 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, MetricsThread, NaoQiButtonThread, NaoQiDCMThread, NaoQiLedThread, NaoQiMotionThread, NaoQiSpeechSynthThread, NavGraphThread, OpenNiContextThread, OpenNiDepthThread, OpenNiHandTrackerThread, OpenNiImageThread, OpenNiPclOnlyThread, OpenNiPointCloudThread, OpenNiUserTrackerThread, OpenPRSAgentThread, OpenPRSExampleThread, OpenPRSThread, OpenRaveMessageHandlerThread, OpenraveRobotMemoryThread, OpenRaveThread, PanTiltActThread, PanTiltSensorThread, PlayerClientThread, PlayerF2PThread, PlayerPostSyncThread, PlayerTimeSyncThread, PointCloudDBROSCommThread, Realsense2Thread, RealsenseThread, RefBoxCommThread, RobotinoActThread, RobotinoIrPclThread, RobotinoRosJointsThread, RobotinoSensorThread, RobotinoSimThread, RobotMemoryTestThread, RobotStatePublisherThread, Roomba500Thread, RoombaJoystickThread, RoombaSensorThread, RosDynamicReconfigureThread, RosImagesThread, RosLaserScanThread, RosMoveBaseThread, RosNavgraphBreakoutThread, RosNavigatorThread, ROSNodeThread, ROSOdometryThread, RosPointCloudThread, RosSkillerThread, ROSTalkerPubThread, RosTfThread, RRDExampleThread, SkillerExecutionThread, SkillerSimulatorExecutionThread, SyncPointTestThread, 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... | |
void | init_BlockedTimingAspect (Thread *thread) |
Init BlockedTiming aspect. More... | |
void | finalize_BlockedTimingAspect (Thread *thread) |
Finalize BlockedTiming aspect. More... | |
WakeupHook | blockedTimingAspectHook () const |
Get the wakeup hook. More... | |
![]() | |
SyncPointAspect (SyncPoint::WakeupType type_in, std::string identifier_in, std::string identifier_out="") | |
Constructor. More... | |
SyncPointAspect (std::string out_identifier) | |
Constructor. More... | |
virtual | ~SyncPointAspect () |
Destructor. More... | |
void | init_SyncPointAspect (Thread *thread, SyncPointManager *syncpoint_manager) |
Init SyncPoint aspect. More... | |
void | finalize_SyncPointAspect (Thread *thread, SyncPointManager *syncpoint_manager) |
Finalize SyncPoint aspect. More... | |
void | pre_loop (Thread *thread) |
Wait for the input syncpoint before loop() More... | |
void | post_loop (Thread *thread) |
Emit the output syncpoint after loop() More... | |
![]() | |
const std::list< const char * > & | get_aspects () const |
Get list of aspect names attached to a aspected thread. More... | |
![]() | |
virtual | ~ThreadLoopListener () |
Virtual empty destructor. More... | |
Static Public Member Functions | |
static const char * | blocked_timing_hook_to_string (WakeupHook hook) |
Get string for wakeup hook. More... | |
static std::string | blocked_timing_hook_to_start_syncpoint (WakeupHook hook) |
Get the syncpoint identifier corresponding to the start of a wakeup hook. More... | |
static std::string | blocked_timing_hook_to_end_syncpoint (WakeupHook hook) |
Get the syncpoint identifier corresponding to the end of a wakeup hook. More... | |
Static Public Attributes | |
static const std::map< const WakeupHook, const std::string > | hook_to_syncpoint |
Translation from WakeupHooks to SyncPoints. More... | |
Additional Inherited Members | |
![]() | |
void | add_aspect (const char *name) |
Add an aspect to a thread. More... | |
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.
Definition at line 54 of file blocked_timing.h.
Type to define at which hook the thread is woken up.
See FawkesMainThread for information when and in which order the hooks are called.
Definition at line 62 of file blocked_timing.h.
fawkes::BlockedTimingAspect::BlockedTimingAspect | ( | WakeupHook | wakeup_hook | ) |
Constructor.
This special constructor is needed to define the wakeup point.
wakeup_hook | hook when this thread should be woken up |
Definition at line 56 of file blocked_timing.cpp.
|
virtual |
Virtual empty destructor.
Definition at line 67 of file blocked_timing.cpp.
References fawkes::Thread::add_loop_listener(), and fawkes::Thread::wakeup().
|
static |
Get the syncpoint identifier corresponding to the end of a wakeup hook.
This is the syncpoint emitted at the end of a hook.
hook | wakeup hook to get the syncpoint identifier for |
Definition at line 144 of file blocked_timing.cpp.
Referenced by fawkes::FawkesMainThread::once().
|
static |
Get the syncpoint identifier corresponding to the start of a wakeup hook.
This is the syncpoint waited for at the start of a hook.
hook | wakeup hook to get the syncpoint identifier for |
Definition at line 159 of file blocked_timing.cpp.
Referenced by fawkes::FawkesMainThread::once().
|
static |
Get string for wakeup hook.
hook | wakeup hook to get string for |
Definition at line 109 of file blocked_timing.cpp.
Referenced by SyncPointTestPlugin::SyncPointTestPlugin().
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.
Definition at line 99 of file blocked_timing.cpp.
References WAKEUP_HOOK_PRE_LOOP.
void fawkes::BlockedTimingAspect::finalize_BlockedTimingAspect | ( | Thread * | thread | ) |
Finalize BlockedTiming aspect.
This finalizes the aspect and removes the loop listener from the thread.
thread | thread which uses this aspect |
Definition at line 88 of file blocked_timing.cpp.
void fawkes::BlockedTimingAspect::init_BlockedTimingAspect | ( | Thread * | thread | ) |
Init BlockedTiming aspect.
This intializes the aspect and adds the loop listener to the thread.
thread | thread which uses this aspect |
Definition at line 77 of file blocked_timing.cpp.
|
static |
Translation from WakeupHooks to SyncPoints.
Each WakeupHook corresponds to exactly one SyncPoint, e.g., WAKEUP_HOOK_PRE_LOOP becomes /preloop.
Definition at line 93 of file blocked_timing.h.