Fawkes API Fawkes Development Version
led_thread.cpp
1
2/***************************************************************************
3 * led_thread.cpp - Provide NaoQi LEDs to Fawkes
4 *
5 * Created: Thu Jun 30 19:52:00 2011
6 * Copyright 2006-2011 Tim Niemueller [www.niemueller.de]
7 *
8 ****************************************************************************/
9
10/* This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Library General Public License for more details.
19 *
20 * Read the full text in the LICENSE.GPL file in the doc directory.
21 */
22
23#include "led_thread.h"
24
25#include "dcm_utils.h"
26
27#include <alcore/alerror.h>
28#include <almemoryfastaccess/almemoryfastaccess.h>
29#include <alproxies/allauncherproxy.h>
30#include <alproxies/almemoryproxy.h>
31#include <alproxies/dcmproxy.h>
32#include <interfaces/LedInterface.h>
33#include <interfaces/NaoJointPositionInterface.h>
34#include <utils/system/pathparser.h>
35
36#include <cmath>
37
38using namespace fawkes;
39
40enum LedType {
41 LED_CHESTBOARD_RED,
42 LED_CHESTBOARD_GREEN,
43 LED_CHESTBOARD_BLUE,
44 LED_EARS_LEFT_0DEG,
45 LED_EARS_LEFT_36DEG,
46 LED_EARS_LEFT_72DEG,
47 LED_EARS_LEFT_108DEG,
48 LED_EARS_LEFT_144DEG,
49 LED_EARS_LEFT_180DEG,
50 LED_EARS_LEFT_216DEG,
51 LED_EARS_LEFT_252DEG,
52 LED_EARS_LEFT_288DEG,
53 LED_EARS_LEFT_324DEG,
54 LED_EARS_RIGHT_0DEG,
55 LED_EARS_RIGHT_36DEG,
56 LED_EARS_RIGHT_72DEG,
57 LED_EARS_RIGHT_108DEG,
58 LED_EARS_RIGHT_144DEG,
59 LED_EARS_RIGHT_180DEG,
60 LED_EARS_RIGHT_216DEG,
61 LED_EARS_RIGHT_252DEG,
62 LED_EARS_RIGHT_288DEG,
63 LED_EARS_RIGHT_324DEG,
64 LED_FACE_LEFT_RED_0DEG,
65 LED_FACE_LEFT_RED_45DEG,
66 LED_FACE_LEFT_RED_90DEG,
67 LED_FACE_LEFT_RED_135DEG,
68 LED_FACE_LEFT_RED_180DEG,
69 LED_FACE_LEFT_RED_225DEG,
70 LED_FACE_LEFT_RED_270DEG,
71 LED_FACE_LEFT_RED_315DEG,
72 LED_FACE_LEFT_GREEN_0DEG,
73 LED_FACE_LEFT_GREEN_45DEG,
74 LED_FACE_LEFT_GREEN_90DEG,
75 LED_FACE_LEFT_GREEN_135DEG,
76 LED_FACE_LEFT_GREEN_180DEG,
77 LED_FACE_LEFT_GREEN_225DEG,
78 LED_FACE_LEFT_GREEN_270DEG,
79 LED_FACE_LEFT_GREEN_315DEG,
80 LED_FACE_LEFT_BLUE_0DEG,
81 LED_FACE_LEFT_BLUE_45DEG,
82 LED_FACE_LEFT_BLUE_90DEG,
83 LED_FACE_LEFT_BLUE_135DEG,
84 LED_FACE_LEFT_BLUE_180DEG,
85 LED_FACE_LEFT_BLUE_225DEG,
86 LED_FACE_LEFT_BLUE_270DEG,
87 LED_FACE_LEFT_BLUE_315DEG,
88 LED_FACE_RIGHT_RED_0DEG,
89 LED_FACE_RIGHT_RED_45DEG,
90 LED_FACE_RIGHT_RED_90DEG,
91 LED_FACE_RIGHT_RED_135DEG,
92 LED_FACE_RIGHT_RED_180DEG,
93 LED_FACE_RIGHT_RED_225DEG,
94 LED_FACE_RIGHT_RED_270DEG,
95 LED_FACE_RIGHT_RED_315DEG,
96 LED_FACE_RIGHT_GREEN_0DEG,
97 LED_FACE_RIGHT_GREEN_45DEG,
98 LED_FACE_RIGHT_GREEN_90DEG,
99 LED_FACE_RIGHT_GREEN_135DEG,
100 LED_FACE_RIGHT_GREEN_180DEG,
101 LED_FACE_RIGHT_GREEN_225DEG,
102 LED_FACE_RIGHT_GREEN_270DEG,
103 LED_FACE_RIGHT_GREEN_315DEG,
104 LED_FACE_RIGHT_BLUE_0DEG,
105 LED_FACE_RIGHT_BLUE_45DEG,
106 LED_FACE_RIGHT_BLUE_90DEG,
107 LED_FACE_RIGHT_BLUE_135DEG,
108 LED_FACE_RIGHT_BLUE_180DEG,
109 LED_FACE_RIGHT_BLUE_225DEG,
110 LED_FACE_RIGHT_BLUE_270DEG,
111 LED_FACE_RIGHT_BLUE_315DEG,
112 LED_LFOOT_RED,
113 LED_LFOOT_GREEN,
114 LED_LFOOT_BLUE,
115 LED_RFOOT_RED,
116 LED_RFOOT_GREEN,
117 LED_RFOOT_BLUE,
118 LedTypeN
119};
120
121/** @class NaoQiLedThread "led_thread.h"
122 * Thread to synchronize with LEDs.
123 * This thread registered for data changed events to a specified LED and
124 * updates the blackboard interface. It also processes actuation commands.
125 * if there is a reader for any of the high frequency interfaces. It
126 * is also responsible for processing incoming commands.
127 */
128
129/** Constructor. */
131: Thread("NaoQiLedThread", Thread::OPMODE_WAITFORWAKEUP),
132 BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_SENSOR_ACQUIRE),
133 BlackBoardInterfaceListener("NaoQiLedThread")
134{
135}
136
137/** Destructor. */
139{
140}
141
142void
144{
145 cfg_verbose_face_ = false;
146 try {
147 cfg_verbose_face_ = config->get_bool("/hardware/nao/leds/verbose_face");
148 } catch (Exception &e) {
149 } // ignored, use default
150
151 dcm_ = naoqi_broker->getDcmProxy();
152 almem_ = naoqi_broker->getMemoryProxy();
153
154 try {
155 subd_prefix_ = (std::string)dcm_->getPrefix()[0];
156 } catch (AL::ALError &e) {
157 throw Exception("Failed to get DCM prefix: %s", e.toString().c_str());
158 }
159 PathParser subdpp(subd_prefix_);
160
161 std::vector<std::string> leddevs;
162 try {
163 leddevs = dcm::get_devices(dcm_, almem_, "Led");
164 } catch (AL::ALError &e) {
165 throw Exception("Failed to get LED devices: %s", e.toString().c_str());
166 }
167
168 // Initialize fast memory access
169 std::string prefix = subd_prefix_;
170 std::vector<std::string> keys;
171 keys.resize(LedTypeN);
172 values_.resize(LedTypeN);
173
174 keys[LED_CHESTBOARD_RED] = prefix + "ChestBoard/Led/Red/Actuator/Value";
175 keys[LED_CHESTBOARD_GREEN] = prefix + "ChestBoard/Led/Green/Actuator/Value";
176 keys[LED_CHESTBOARD_BLUE] = prefix + "ChestBoard/Led/Blue/Actuator/Value";
177
178 prefix = subd_prefix_ + "Ears/Led/";
179 keys[LED_EARS_LEFT_0DEG] = prefix + "Left/0Deg/Actuator/Value";
180 keys[LED_EARS_LEFT_36DEG] = prefix + "Left/36Deg/Actuator/Value";
181 keys[LED_EARS_LEFT_72DEG] = prefix + "Left/72Deg/Actuator/Value";
182 keys[LED_EARS_LEFT_108DEG] = prefix + "Left/108Deg/Actuator/Value";
183 keys[LED_EARS_LEFT_144DEG] = prefix + "Left/144Deg/Actuator/Value";
184 keys[LED_EARS_LEFT_180DEG] = prefix + "Left/180Deg/Actuator/Value";
185 keys[LED_EARS_LEFT_216DEG] = prefix + "Left/216Deg/Actuator/Value";
186 keys[LED_EARS_LEFT_252DEG] = prefix + "Left/252Deg/Actuator/Value";
187 keys[LED_EARS_LEFT_288DEG] = prefix + "Left/288Deg/Actuator/Value";
188 keys[LED_EARS_LEFT_324DEG] = prefix + "Left/324Deg/Actuator/Value";
189
190 keys[LED_EARS_RIGHT_0DEG] = prefix + "Right/0Deg/Actuator/Value";
191 keys[LED_EARS_RIGHT_36DEG] = prefix + "Right/36Deg/Actuator/Value";
192 keys[LED_EARS_RIGHT_72DEG] = prefix + "Right/72Deg/Actuator/Value";
193 keys[LED_EARS_RIGHT_108DEG] = prefix + "Right/108Deg/Actuator/Value";
194 keys[LED_EARS_RIGHT_144DEG] = prefix + "Right/144Deg/Actuator/Value";
195 keys[LED_EARS_RIGHT_180DEG] = prefix + "Right/180Deg/Actuator/Value";
196 keys[LED_EARS_RIGHT_216DEG] = prefix + "Right/216Deg/Actuator/Value";
197 keys[LED_EARS_RIGHT_252DEG] = prefix + "Right/252Deg/Actuator/Value";
198 keys[LED_EARS_RIGHT_288DEG] = prefix + "Right/288Deg/Actuator/Value";
199 keys[LED_EARS_RIGHT_324DEG] = prefix + "Right/324Deg/Actuator/Value";
200
201 prefix = subd_prefix_ + "Face/Led/";
202 keys[LED_FACE_LEFT_RED_0DEG] = prefix + "Red/Left/0Deg/Actuator/Value";
203 keys[LED_FACE_LEFT_RED_45DEG] = prefix + "Red/Left/45Deg/Actuator/Value";
204 keys[LED_FACE_LEFT_RED_90DEG] = prefix + "Red/Left/90Deg/Actuator/Value";
205 keys[LED_FACE_LEFT_RED_135DEG] = prefix + "Red/Left/135Deg/Actuator/Value";
206 keys[LED_FACE_LEFT_RED_180DEG] = prefix + "Red/Left/180Deg/Actuator/Value";
207 keys[LED_FACE_LEFT_RED_225DEG] = prefix + "Red/Left/225Deg/Actuator/Value";
208 keys[LED_FACE_LEFT_RED_270DEG] = prefix + "Red/Left/270Deg/Actuator/Value";
209 keys[LED_FACE_LEFT_RED_315DEG] = prefix + "Red/Left/315Deg/Actuator/Value";
210
211 keys[LED_FACE_LEFT_GREEN_0DEG] = prefix + "Green/Left/0Deg/Actuator/Value";
212 keys[LED_FACE_LEFT_GREEN_45DEG] = prefix + "Green/Left/45Deg/Actuator/Value";
213 keys[LED_FACE_LEFT_GREEN_90DEG] = prefix + "Green/Left/90Deg/Actuator/Value";
214 keys[LED_FACE_LEFT_GREEN_135DEG] = prefix + "Green/Left/135Deg/Actuator/Value";
215 keys[LED_FACE_LEFT_GREEN_180DEG] = prefix + "Green/Left/180Deg/Actuator/Value";
216 keys[LED_FACE_LEFT_GREEN_225DEG] = prefix + "Green/Left/225Deg/Actuator/Value";
217 keys[LED_FACE_LEFT_GREEN_270DEG] = prefix + "Green/Left/270Deg/Actuator/Value";
218 keys[LED_FACE_LEFT_GREEN_315DEG] = prefix + "Green/Left/315Deg/Actuator/Value";
219
220 keys[LED_FACE_LEFT_BLUE_0DEG] = prefix + "Blue/Left/0Deg/Actuator/Value";
221 keys[LED_FACE_LEFT_BLUE_45DEG] = prefix + "Blue/Left/45Deg/Actuator/Value";
222 keys[LED_FACE_LEFT_BLUE_90DEG] = prefix + "Blue/Left/90Deg/Actuator/Value";
223 keys[LED_FACE_LEFT_BLUE_135DEG] = prefix + "Blue/Left/135Deg/Actuator/Value";
224 keys[LED_FACE_LEFT_BLUE_180DEG] = prefix + "Blue/Left/180Deg/Actuator/Value";
225 keys[LED_FACE_LEFT_BLUE_225DEG] = prefix + "Blue/Left/225Deg/Actuator/Value";
226 keys[LED_FACE_LEFT_BLUE_270DEG] = prefix + "Blue/Left/270Deg/Actuator/Value";
227 keys[LED_FACE_LEFT_BLUE_315DEG] = prefix + "Blue/Left/315Deg/Actuator/Value";
228
229 keys[LED_FACE_RIGHT_RED_0DEG] = prefix + "Red/Right/0Deg/Actuator/Value";
230 keys[LED_FACE_RIGHT_RED_45DEG] = prefix + "Red/Right/45Deg/Actuator/Value";
231 keys[LED_FACE_RIGHT_RED_90DEG] = prefix + "Red/Right/90Deg/Actuator/Value";
232 keys[LED_FACE_RIGHT_RED_135DEG] = prefix + "Red/Right/135Deg/Actuator/Value";
233 keys[LED_FACE_RIGHT_RED_180DEG] = prefix + "Red/Right/180Deg/Actuator/Value";
234 keys[LED_FACE_RIGHT_RED_225DEG] = prefix + "Red/Right/225Deg/Actuator/Value";
235 keys[LED_FACE_RIGHT_RED_270DEG] = prefix + "Red/Right/270Deg/Actuator/Value";
236 keys[LED_FACE_RIGHT_RED_315DEG] = prefix + "Red/Right/315Deg/Actuator/Value";
237
238 keys[LED_FACE_RIGHT_GREEN_0DEG] = prefix + "Green/Right/0Deg/Actuator/Value";
239 keys[LED_FACE_RIGHT_GREEN_45DEG] = prefix + "Green/Right/45Deg/Actuator/Value";
240 keys[LED_FACE_RIGHT_GREEN_90DEG] = prefix + "Green/Right/90Deg/Actuator/Value";
241 keys[LED_FACE_RIGHT_GREEN_135DEG] = prefix + "Green/Right/135Deg/Actuator/Value";
242 keys[LED_FACE_RIGHT_GREEN_180DEG] = prefix + "Green/Right/180Deg/Actuator/Value";
243 keys[LED_FACE_RIGHT_GREEN_225DEG] = prefix + "Green/Right/225Deg/Actuator/Value";
244 keys[LED_FACE_RIGHT_GREEN_270DEG] = prefix + "Green/Right/270Deg/Actuator/Value";
245 keys[LED_FACE_RIGHT_GREEN_315DEG] = prefix + "Green/Right/315Deg/Actuator/Value";
246
247 keys[LED_FACE_RIGHT_BLUE_0DEG] = prefix + "Blue/Right/0Deg/Actuator/Value";
248 keys[LED_FACE_RIGHT_BLUE_45DEG] = prefix + "Blue/Right/45Deg/Actuator/Value";
249 keys[LED_FACE_RIGHT_BLUE_90DEG] = prefix + "Blue/Right/90Deg/Actuator/Value";
250 keys[LED_FACE_RIGHT_BLUE_135DEG] = prefix + "Blue/Right/135Deg/Actuator/Value";
251 keys[LED_FACE_RIGHT_BLUE_180DEG] = prefix + "Blue/Right/180Deg/Actuator/Value";
252 keys[LED_FACE_RIGHT_BLUE_225DEG] = prefix + "Blue/Right/225Deg/Actuator/Value";
253 keys[LED_FACE_RIGHT_BLUE_270DEG] = prefix + "Blue/Right/270Deg/Actuator/Value";
254 keys[LED_FACE_RIGHT_BLUE_315DEG] = prefix + "Blue/Right/315Deg/Actuator/Value";
255
256 prefix = subd_prefix_;
257 keys[LED_LFOOT_RED] = prefix + "LFoot/Led/Red/Actuator/Value";
258 keys[LED_LFOOT_GREEN] = prefix + "LFoot/Led/Green/Actuator/Value";
259 keys[LED_LFOOT_BLUE] = prefix + "LFoot/Led/Blue/Actuator/Value";
260
261 keys[LED_RFOOT_RED] = prefix + "RFoot/Led/Red/Actuator/Value";
262 keys[LED_RFOOT_GREEN] = prefix + "RFoot/Led/Green/Actuator/Value";
263 keys[LED_RFOOT_BLUE] = prefix + "RFoot/Led/Blue/Actuator/Value";
264
265 memfa_.reset(new AL::ALMemoryFastAccess());
266 try {
267 memfa_->ConnectToVariables(naoqi_broker, keys, false);
268 } catch (AL::ALError &e) {
269 throw Exception("Failed to setup fast memory access: %s", e.toString().c_str());
270 }
271
272 NaoJointPositionInterface *joint_pos_if =
274 if (!joint_pos_if->has_writer()) {
275 blackboard->close(joint_pos_if);
276 throw Exception("Joint Position interface has no writer");
277 }
278 joint_pos_if->read();
279 bool skip_head_leds =
280 (joint_pos_if->robot_type() != NaoJointPositionInterface::ROBOTYPE_ACADEMIC);
281 blackboard->close(joint_pos_if);
282
283 std::vector<std::string>::iterator l;
284 for (l = leddevs.begin(); l != leddevs.end(); ++l) {
285 PathParser pp(*l);
286 std::string loc = pp[subdpp.size()];
287
288 if (!cfg_verbose_face_) {
289 PathParser locpp(loc);
290 if (locpp[0] == "Face")
291 continue;
292 }
293 if (skip_head_leds) {
294 PathParser locpp(loc);
295 if (locpp[0] == "Head")
296 continue;
297 }
298
299 std::string id = "Nao LED " + loc;
300 PathParser::size_type i;
301 for (i = subdpp.size() + 2; (i < pp.size()) && (pp[i] != "Actuator"); ++i) {
302 id += "/";
303 id += pp[i];
304 }
305
306 try {
308 leds_.insert(make_pair(iface, *l + "/Value"));
309 } catch (Exception &e) {
310 fawkes::LedInterface *last = NULL;
311 for (LedMap::iterator i = leds_.begin(); i != leds_.end(); ++i) {
312 if (i->first != last) {
313 blackboard->close(i->first);
314 last = i->first;
315 }
316 }
317 leds_.clear();
318 throw;
319 }
320 }
321
322 try {
323 std::string left_right[2] = {"Left", "Right"};
324 std::string rgb[3] = {"Red", "Green", "Blue"};
325 std::string angles[8] = {"0", "45", "90", "135", "180", "225", "270", "315"};
326
327 for (unsigned int lr = 0; lr < 2; ++lr) {
328 for (unsigned int cl = 0; cl < 3; ++cl) {
329 std::string id = "Nao LED Face/" + rgb[cl] + "/" + left_right[lr];
331
332 for (unsigned int a = 0; a < 8; ++a) {
333 std::string entry = "Face/Led/" + rgb[cl] + "/" + left_right[lr];
334 std::string memid = subd_prefix_ + entry + "/" + angles[a] + "Deg/Actuator/Value";
335
336 leds_.insert(make_pair(iface, memid));
337 }
338 }
339 }
340
341 } catch (Exception &e) {
342 fawkes::LedInterface *last = NULL;
343 for (LedMap::iterator i = leds_.begin(); i != leds_.end(); ++i) {
344 if (i->first != last) {
345 blackboard->close(i->first);
346 last = i->first;
347 }
348 }
349 leds_.clear();
350 throw;
351 }
352
353 //logger->log_debug(name(), "Interfaces and device IDs:");
354 fawkes::LedInterface *last = NULL;
355 for (LedMap::iterator i = leds_.begin(); i != leds_.end(); ++i) {
356 if (i->first == last)
357 continue;
358
359 //logger->log_debug(name(), " %s", i->first->id());
360 std::pair<LedMap::iterator, LedMap::iterator> ret = leds_.equal_range(i->first);
361
362 for (LedMap::iterator j = ret.first; j != ret.second; ++j) {
363 //logger->log_debug(name(), " %s", j->second.c_str());
364
365 for (unsigned int k = 0; k < keys.size(); ++k) {
366 if (keys[k] == j->second) {
367 memids_.insert(std::make_pair(i->first, k));
368 break;
369 }
370 }
371
372 last = i->first;
373 }
374 }
375
376 last = NULL;
377 for (LedMap::iterator i = leds_.begin(); i != leds_.end(); ++i) {
378 if (i->first != last) {
380 last = i->first;
381 }
382 }
383 blackboard->register_listener(this, BlackBoard::BBIL_FLAG_MESSAGES);
384}
385
386void
388{
390
391 fawkes::LedInterface *last = NULL;
392 for (LedMap::iterator i = leds_.begin(); i != leds_.end(); ++i) {
393 if (i->first != last) {
394 blackboard->close(i->first);
395 last = i->first;
396 }
397 }
398
399 dcm_.reset();
400 almem_.reset();
401 memfa_.reset();
402}
403
404void
406{
407 memfa_->GetValues(values_);
408
409 fawkes::LedInterface *last = NULL;
410 for (LedMap::iterator i = leds_.begin(); i != leds_.end(); ++i) {
411 if (i->first == last)
412 continue;
413
414 float maxval = 0.;
415
416 std::pair<LedMemMap::iterator, LedMemMap::iterator> ret = memids_.equal_range(i->first);
417 for (LedMemMap::iterator j = ret.first; j != ret.second; ++j) {
418 if (values_[j->second] > maxval)
419 maxval = values_[j->second];
420 }
421
422 if (maxval != i->first->intensity()) {
423 i->first->set_intensity(maxval);
424 i->first->write();
425 }
426
427 last = i->first;
428 }
429}
430
431bool
433{
434 // some string magic to find the correct ALValue to write to
435 std::string kind = "Merge";
436 int dcm_time = dcm_->getTime(0);
437
439 dynamic_cast<LedInterface::SetIntensityMessage *>(message);
440
441 LedInterface *led_if = dynamic_cast<LedInterface *>(interface);
442 if (led_if == NULL)
443 return false;
444
445 std::pair<LedMap::iterator, LedMap::iterator> ret = leds_.equal_range(led_if);
446
447 if (sim != NULL) {
448 for (LedMap::iterator i = ret.first; i != ret.second; ++i) {
449 printf("Set %s to %f\n", i->second.c_str(), sim->intensity());
450 dcm::set_value(
451 dcm_, i->second, kind, sim->intensity(), (int)roundf(dcm_time + sim->time_sec() * 1000.));
452 }
453 } else if (dynamic_cast<LedInterface::TurnOnMessage *>(message) != NULL) {
454 for (LedMap::iterator i = ret.first; i != ret.second; ++i) {
455 dcm::set_value(dcm_, i->second, kind, 1., dcm_time);
456 }
457 } else if (dynamic_cast<LedInterface::TurnOffMessage *>(message) != NULL) {
458 for (LedMap::iterator i = ret.first; i != ret.second; ++i) {
459 dcm::set_value(dcm_, i->second, kind, 0., dcm_time);
460 }
461 }
462
463 return false;
464}
virtual void finalize()
Finalize the thread.
Definition: led_thread.cpp:387
virtual ~NaoQiLedThread()
Destructor.
Definition: led_thread.cpp:138
bool bb_interface_message_received(fawkes::Interface *interface, fawkes::Message *message) noexcept
BlackBoard message received notification.
Definition: led_thread.cpp:432
NaoQiLedThread()
Constructor.
Definition: led_thread.cpp:130
virtual void loop()
Code to execute in the thread.
Definition: led_thread.cpp:405
virtual void init()
Initialize the thread.
Definition: led_thread.cpp:143
BlackBoard * blackboard
This is the BlackBoard instance you can use to interact with the BlackBoard.
Definition: blackboard.h:44
BlackBoard interface listener.
void bbil_add_message_interface(Interface *interface)
Add an interface to the message received watch list.
virtual Interface * open_for_reading(const char *interface_type, const char *identifier, const char *owner=NULL)=0
Open interface for reading.
virtual void unregister_listener(BlackBoardInterfaceListener *listener)
Unregister BB interface listener.
Definition: blackboard.cpp:212
virtual Interface * open_for_writing(const char *interface_type, const char *identifier, const char *owner=NULL)=0
Open interface for writing.
virtual void register_listener(BlackBoardInterfaceListener *listener, ListenerRegisterFlag flag=BBIL_FLAG_ALL)
Register BB event listener.
Definition: blackboard.cpp:185
virtual void close(Interface *interface)=0
Close interface.
Thread aspect to use blocked timing.
Configuration * config
This is the Configuration member used to access the configuration.
Definition: configurable.h:41
virtual bool get_bool(const char *path)=0
Get value from configuration which is of type bool.
Base class for exceptions in Fawkes.
Definition: exception.h:36
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:80
void read()
Read from BlackBoard into local copy.
Definition: interface.cpp:479
bool has_writer() const
Check if there is a writer for the interface.
Definition: interface.cpp:848
SetIntensityMessage Fawkes BlackBoard Interface Message.
Definition: LedInterface.h:56
float intensity() const
Get intensity value.
float time_sec() const
Get time_sec value.
TurnOffMessage Fawkes BlackBoard Interface Message.
Definition: LedInterface.h:107
TurnOnMessage Fawkes BlackBoard Interface Message.
Definition: LedInterface.h:87
LedInterface Fawkes BlackBoard Interface.
Definition: LedInterface.h:34
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Definition: message.h:44
NaoJointPositionInterface Fawkes BlackBoard Interface.
RobotType robot_type() const
Get robot_type value.
AL::ALPtr< AL::ALBroker > naoqi_broker
NaoQi broker.
Definition: naoqi.h:44
Path parser.
Definition: pathparser.h:33
Thread class encapsulation of pthreads.
Definition: thread.h:46
Fawkes library namespace.