24 #include <aspect/blocked_timing.h> 25 #include <core/exception.h> 26 #include <core/threading/thread.h> 53 blocked_timing_hook_to_start_syncpoint(wakeup_hook),
54 blocked_timing_hook_to_end_syncpoint(wakeup_hook))
57 wakeup_hook_ = wakeup_hook;
64 delete loop_listener_;
117 default:
throw Exception(
"Unknown blocked timing wakeup hook");
121 const std::map<const BlockedTimingAspect::WakeupHook, const std::string>
123 {WAKEUP_HOOK_SENSOR_ACQUIRE,
"/sensors/acquire"},
124 {WAKEUP_HOOK_SENSOR_PREPARE,
"/sensors/prepare"},
125 {WAKEUP_HOOK_SENSOR_PROCESS,
"/sensors/process"},
126 {WAKEUP_HOOK_WORLDSTATE,
"/worldstate"},
127 {WAKEUP_HOOK_THINK,
"/agent"},
128 {WAKEUP_HOOK_SKILL,
"/skill"},
129 {WAKEUP_HOOK_ACT,
"/act/main"},
130 {WAKEUP_HOOK_ACT_EXEC,
"/act/exec"},
131 {WAKEUP_HOOK_POST_LOOP,
"/postloop"}};
143 }
catch (
const std::out_of_range &e) {
144 throw Exception(
"Unknown blocked timing wakeup hook. Error: %s", e.what());
158 }
catch (
const std::out_of_range &e) {
159 throw Exception(
"Unknown blocked timing wakeup hook. Error: %s", e.what());
act thread (motor module etc.)
void finalize_BlockedTimingAspect(Thread *thread)
Finalize BlockedTiming aspect.
static const std::map< const WakeupHook, const std::string > hook_to_syncpoint
Translation from WakeupHooks to SyncPoints.
sensor data preparation thread, convert acquired data to usable format
Fawkes library namespace.
void init_BlockedTimingAspect(Thread *thread)
Init BlockedTiming aspect.
Thread class encapsulation of pthreads.
skill thread (skill module)
static std::string blocked_timing_hook_to_start_syncpoint(WakeupHook hook)
Get the syncpoint identifier corresponding to the start of a wakeup hook.
sensor data processing thread
void add_aspect(const char *name)
Add an aspect to a thread.
Thread aspect to acces to SyncPoints Give this aspect to your thread to manage SyncPoints,...
void add_loop_listener(ThreadLoopListener *loop_listener)
Add loop listener.
void wakeup()
Wake up thread.
static std::string blocked_timing_hook_to_end_syncpoint(WakeupHook hook)
Get the syncpoint identifier corresponding to the end of a wakeup hook.
WakeupHook
Type to define at which hook the thread is woken up.
Base class for exceptions in Fawkes.
void post_loop(Thread *thread)
The post loop function of the BlockedTimingAspect This function is called right after the loop of the...
void remove_loop_listener(ThreadLoopListener *loop_listener)
Remove loop listener.
static const char * blocked_timing_hook_to_string(WakeupHook hook)
Get string for wakeup hook.
Loop Listener of the BlockedTimingAspect.
virtual ~BlockedTimingAspect()
Virtual empty destructor.
BlockedTimingAspect(WakeupHook wakeup_hook)
Constructor.
WakeupHook blockedTimingAspectHook() const
Get the wakeup hook.
sensor acquisition thread, acquire data from sensor