gusimplewhiteboard
SimpleWhiteboardTest.mm
Go to the documentation of this file.
1/*
2 * SimpleWhiteboardTest.mm
3 *
4 * Created by René Hexel on 20/12/11.
5 * Copyright (c) 2011, 2014, 2015 Rene Hexel.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer in the documentation and/or other materials
18 * provided with the distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgement:
22 *
23 * This product includes software developed by Rene Hexel.
24 *
25 * 4. Neither the name of the author nor the names of contributors
26 * may be used to endorse or promote products derived from this
27 * software without specific prior written permission.
28 *
29 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
33 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
34 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
35 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
36 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
37 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
38 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
39 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 *
41 * -----------------------------------------------------------------------
42 * This program is free software; you can redistribute it and/or
43 * modify it under the above terms or under the terms of the GNU
44 * General Public License as published by the Free Software Foundation;
45 * either version 2 of the License, or (at your option) any later version.
46 *
47 * This program is distributed in the hope that it will be useful,
48 * but WITHOUT ANY WARRANTY; without even the implied warranty of
49 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50 * GNU General Public License for more details.
51 *
52 * You should have received a copy of the GNU General Public License
53 * along with this program; if not, see http://www.gnu.org/licenses/
54 * or write to the Free Software Foundation, Inc., 51 Franklin Street,
55 * Fifth Floor, Boston, MA 02110-1301, USA.
56 *
57 */
58#import <errno.h>
59#import <sys/stat.h>
60#import "FSM_Control.h"
67
68#import "FSMControlStatus.h"
69
70#define WB_FNAME "guWhiteboard_SimpleWhiteboardTest"
71
72using namespace guWhiteboard;
73using namespace std;
74
77{
79 whiteboard_watcher *watcher;
80public:
85 {
86 watcher = new whiteboard_watcher();
88 usleep(50000); //gives the monitor thread in the whiteboard a chance to get started.
89 }
90
95 {
96 watcher->unsubscribe(kPrint_v);
97 // delete watcher;
98 }
99
104 {
105 Print_t value;
106 string str = value.get_from(m);
107 self.stringValue = [[NSString alloc] initWithUTF8String: str.c_str()];
108 self.callbackCount++;
109 dispatch_semaphore_signal(self.semaphore);
110 }
111};
112
113@implementation SimpleWhiteboardTest
114@synthesize callbackCount, semaphore, stringValue=_stringValue;
115
116#pragma clang diagnostic push
117#pragma clang diagnostic ignored "-Wdeprecated-declarations"
118#pragma clang diagnostic ignored "-Wdirect-ivar-access"
119
123- (void) setUp
124{
125 setenv(GSW_DEFAULT_ENV, WB_FNAME, 1);
126
127 Print_t wb;
128 (void) wb.get(); // create whiteboard (if it doesn't exist)
129
130 [super setUp];
131
132 self.callbackCount = 0;
133 self.semaphore = dispatch_semaphore_create(0);
134
135 //generic wb object testing
136
137// generic_whiteboard_object<gu_simple_message> *testInt = new generic_whiteboard_object<gu_simple_message>(self.whiteboard->_wbd, 20);
138
139
140
141
142// gu_simple_message m;
143// m.sint = 2300;
144// testInt->set(m);
145//
146// fprintf(stderr, "Got %d\n", testInt->get()->sint);
147//
148
149
150
151// exit(0);
152}
153
157- (void) tearDown
158{
159 //fix compiler complaint about releasing when using ARC - Carl.
160 //if (self.semaphore) dispatch_release(self.semaphore);
161
162 self.semaphore = NULL;
163
164 [super tearDown];
165
166 unsetenv(GSW_DEFAULT_ENV);
167}
168
172- (void) testStringPutGet
173{
174 string testString("Testing the Whiteboard");
175 Say_t wbSpeech(testString); // put a message on the whiteboard
176 string result = wbSpeech(); // try and get it back
177
178 XCTAssertTrue(result == testString, @"Expected result to be '%s', but got '%s'", testString.c_str(), result.c_str());
179}
180
184- (void) testIntGetPutGetPut
185{
186 PlayerNumber_t playerNumber;
187 int oldNumber = playerNumber(); // get what is currently on the wb
188 int newNumber = 5;
189 playerNumber = newNumber; // set new number
190 int result = playerNumber; // get new number back out
191
192 XCTAssertEqual(result, newNumber, @"Expected player '%d', but got '%d'", newNumber, result);
193
194 playerNumber.set(oldNumber);
195 result = playerNumber.get();
196
197 XCTAssertEqual(result, oldNumber, @"Expected old player '%d', but got '%d'", oldNumber, result);
198}
199
200- (void) testFSMPutGet
201{
202 FSM_Status_t fsmStatus;
203 FSMControlStatus oldStatus = fsmStatus(); // get old from wb
204 FSMControlStatus newStatus = oldStatus; // copy
205 newStatus.clr(0);
206 newStatus.set(1);
207 newStatus.clr(2);
208 newStatus.set(3);
209 newStatus.set(4);
210 fsmStatus.set(newStatus); // write to wb
211 FSMControlStatus result = fsmStatus(); // get back out
212 XCTAssertFalse(result.get(0), @"Expecting 0 to be unset");
213 XCTAssertTrue(result.get(1), @"Expecting 1 to be set");
214 XCTAssertFalse(result.get(2), @"Expecting 2 to be unset");
215 XCTAssertTrue(result.get(3), @"Expecting 3 to be set");
216 XCTAssertTrue(result.get(4), @"Expecting 4 to be set");
217 fsmStatus.set(oldStatus);
218 result = fsmStatus.get();
219 XCTAssertTrue(result == oldStatus, @"Expecting old status to be restored");
220}
221
222
224{
225 SENSORSTorsoJointSensors testA("0.174533,0.349066");
226 XCTAssertEqualWithAccuracy(DEG2RAD(10), testA.HeadYaw (), 0.01, @"Head Yaw match");
227 XCTAssertEqualWithAccuracy(DEG2RAD(20), testA.HeadPitch(), 0.01, @"Head Pitch match");
228 // XCTAssertFalse(true, @"Head Pitch match");
229
230}
232{
233 FilteredOneDimSonar testA("");
234
235 XCTAssertEqual(sizeof(testA), sizeof(wb_filteredsonarobject), @"Size %ld of testA does not match size %ld of wb_filteredsonarobject", sizeof(testA), sizeof(wb_filteredsonarobject));
236
237 XCTAssertFalse(testA.isVisible(), @"Expected not visible");
238
239 FilteredOneDimSonar testB("IsVisible,10,FRAME:100,");
240
241 XCTAssertTrue(testB.isVisible(), @"Expected visible");
242 XCTAssertEqual(10, testB.distance(), @"Distance match");
243 XCTAssertEqual(100, testB.frameCounter(), @"frameCounter match");
244
245 string s = testB.description();
246
247 FilteredOneDimSonar testC(s);
248 XCTAssertTrue(testC.isVisible(), @"Expected visible");
249 XCTAssertEqual(testC.distance(), testB.distance(), @"Distance match");
250 XCTAssertEqual(testC.frameCounter(), testB.frameCounter(), @"frameCounter match");
251
252
253}
254
256{
257 FilteredOneDimObject testA("");
258
259 XCTAssertEqual(sizeof(testA), sizeof(wb_filtered_vision_object), @"Size %ld of testA does not match size %ld of wb_filteredvisionobject", sizeof(testA), sizeof(wb_filtered_vision_object));
260
261 XCTAssertFalse(testA.isVisible(), @"Expected not visible");
262
263 FilteredOneDimObject testB("IsVisible,10,20,30,40,FRAME:100,");
264
265 XCTAssertTrue(testB.isVisible(), @"Expected visible");
266 XCTAssertEqual(10, testB.distance(), @"distance match");
267 XCTAssertEqual(20, testB.x(), @"'x' match");
268 XCTAssertEqual(30, testB.y(), @"'y' match");
269 XCTAssertEqual(40, testB.yaw(), @"yaw match");
270 XCTAssertEqual(100, testB.frameCounter(), @"frameCounter match");
271
272 string s = testB.description();
273
274 FilteredOneDimObject testC(s);
275 XCTAssertTrue(testC.isVisible(), @"Expected visible");
276 XCTAssertEqual(testC.distance(), testB.distance(), @"distance match");
277 XCTAssertEqual(testC.x(), testB.x(), @"'x' match");
278 XCTAssertEqual(testC.y(), testB.y(), @"'y' match");
279 XCTAssertEqual(testC.yaw(), testB.yaw(), @"yaw match");
280 XCTAssertEqual(testC.frameCounter(), testB.frameCounter(), @"frameCounter match");
281
282}
283
285{
286 FilteredOneDimSonar testA("IsVisible,10,FRAME:100,");
287
288 FilteredArrayOneDimSonar testArray(testA);
289
290 FilteredOneDimSonar testB=testArray.get_object(FSLeft);
291
292 XCTAssertTrue(testA.isVisible(), @"Expected visible");
293 XCTAssertTrue(testB.isVisible(), @"Expected visible");
294 XCTAssertEqual(testA.distance(), testB.distance(), @"distance match");
295 XCTAssertEqual(testA.frameCounter(), testB.frameCounter(), @"frameCounter match");
296
297 FilteredOneDimSonar testC("IsVisible,20,FRAME:200,");
298
299 testArray.set_object(testC,FSRight);
300
301 FilteredOneDimSonar testD=testArray.get_object(FSRight);
302
303 XCTAssertTrue(testC.isVisible(), @"Expected visible");
304 XCTAssertTrue(testD.isVisible(), @"Expected visible");
305 XCTAssertEqual(testC.distance(), testD.distance(), @"distance match");
306 XCTAssertEqual(testC.frameCounter(), testD.frameCounter(), @"frameCounter match");
307
308
309 FilteredArrayOneDimSonar testArrayB(testArray);
310 FilteredOneDimSonar testE=testArrayB.get_object(FSLeft);
311 FilteredOneDimSonar testF=testArrayB.get_object(FSRight);
312 XCTAssertTrue(testE.isVisible(), @"Expected visible");
313 XCTAssertTrue(testF.isVisible(), @"Expected visible");
314 XCTAssertEqual(testE.distance(), testB.distance(), @"distance match");
315 XCTAssertEqual(testE.frameCounter(), testB.frameCounter(), @"frameCounter match");
316 XCTAssertEqual(testF.distance(), testC.distance(), @"distance match");
317 XCTAssertEqual(testF.frameCounter(), testC.frameCounter(), @"frameCounter match");
318
319 string s =testArrayB.description();
320
321 FilteredArrayOneDimSonar testArrayC(s);
322 XCTAssertTrue(testArrayC.get_object(FSLeft).isVisible(), @"Expected visible");
323 XCTAssertTrue(testArrayC.get_object(FSRight).isVisible(), @"Expected visible");
324 XCTAssertEqual(testArrayC.get_object(FSLeft).distance(), testB.distance(), @"distance match");
325 XCTAssertEqual(testArrayC.get_object(FSLeft).frameCounter(), testB.frameCounter(), @"frameCounter match");
326 XCTAssertEqual(testArrayC.get_object(FSRight).distance(), testC.distance(), @"distance match");
327 XCTAssertEqual(testArrayC.get_object(FSRight).frameCounter(), testC.frameCounter(), @"frameCounter match");
328
329}
330
332{
333 FilteredOneDimObject testP("IsVisible,10,20,30,40,FRAME:100,");
334
336 testArray.set_objects(testP, 0);
337
339
340 XCTAssertTrue(testP.isVisible(), @"Expected visible");
341 XCTAssertTrue(testB.isVisible(), @"Expected visible");
342 XCTAssertEqual(testP.distance(), testB.distance(), @"distance match");
343 XCTAssertEqual(testP.x(), testB.x(), @"'x' match");
344 XCTAssertEqual(testP.y(), testB.y(), @"'y' match");
345 XCTAssertEqual(testP.yaw(), testB.yaw(), @"yaw match");
346 XCTAssertEqual(testP.frameCounter(), testB.frameCounter(), @"frameCounter match");
347
348 FilteredOneDimObject testL("IsVisible,15,25,35,45,FRAME:105,");
349
350 testArray.set_objects(testL,FVOGoalPostLeftTop);
351
353
354 XCTAssertTrue(testL.isVisible(), @"Expected visible");
355 XCTAssertTrue(testL1.isVisible(), @"Expected visible");
356 XCTAssertEqual(testL1.distance(), testL.distance(), @"distance match");
357 XCTAssertEqual(testL1.x(), testL.x(), @"'x' match");
358 XCTAssertEqual(testL1.y(), testL.y(), @"'y' match");
359 XCTAssertEqual(testL1.yaw(), testL.yaw(), @"yaw match");
360 XCTAssertEqual(testL1.frameCounter(), testL.frameCounter(), @"frameCounter match");
361
362 FilteredOneDimObject testR("IsVisible,13,23,33,43,FRAME:108,");
363 FilteredOneDimObject testC("IsVisible,12,22,32,42,FRAME:102,");
364
365 testArray.set_objects(testR,FVOGoalPostRightTop);
366 testArray.set_objects(testC,FVOGoalCrossBarTop);
367
368 FilteredArrayOneDimObjects testArrayB(testArray);
369
370 FilteredOneDimObject testPostLeft=testArrayB.objects(FVOGoalPostLeftTop);
371 FilteredOneDimObject testPostRight=testArrayB.objects(FVOGoalPostRightTop);
372 FilteredOneDimObject testCrossbar=testArrayB.objects(FVOGoalCrossBarTop);
373 XCTAssertTrue(testPostLeft.isVisible(), @"Expected visible");
374 XCTAssertEqual(testPostLeft.distance(), testL.distance(), @"distance match");
375 XCTAssertEqual(testPostLeft.x(), testL.x(), @"'x' match");
376 XCTAssertEqual(testPostLeft.y(), testL.y(), @"'y' match");
377 XCTAssertEqual(testPostLeft.yaw(), testL.yaw(), @"yaw match");
378 XCTAssertEqual(testPostLeft.frameCounter(), testL.frameCounter(), @"frameCounter match");
379 XCTAssertTrue(testPostRight.isVisible(), @"Expected visible");
380 XCTAssertEqual(testPostRight.distance(), testR.distance(), @"distance match");
381 XCTAssertEqual(testPostRight.x(), testR.x(), @"'x' match");
382 XCTAssertEqual(testPostRight.y(), testR.y(), @"'y' match");
383 XCTAssertEqual(testPostRight.yaw(), testR.yaw(), @"yaw match");
384 XCTAssertEqual(testPostRight.frameCounter(), testR.frameCounter(), @"frameCounter match");
385
386 XCTAssertTrue(testCrossbar.isVisible(), @"Expected visible");
387 XCTAssertEqual(testCrossbar.distance(), testC.distance(), @"distance match");
388 XCTAssertEqual(testCrossbar.x(), testC.x(), @"'x' match");
389 XCTAssertEqual(testCrossbar.y(), testC.y(), @"'y' match");
390 XCTAssertEqual(testCrossbar.yaw(), testC.yaw(), @"yaw match");
391 XCTAssertEqual(testCrossbar.frameCounter(), testC.frameCounter(), @"frameCounter match");
392
393 string s =testArrayB.description();
394
395 FilteredArrayOneDimObjects testArrayC(s);
396 XCTAssertTrue(testArrayC.objects(FVOGoalPostLeftTop).isVisible(), @"Expected visible");
397 XCTAssertTrue(testArrayC.objects(FVOGoalPostRightTop).isVisible(), @"Expected visible");
398 XCTAssertEqual(testArrayC.objects(FVOGoalPostLeftTop).distance(), testL.distance(), @"distance match");
399 XCTAssertEqual(testArrayC.objects(FVOGoalPostLeftTop).frameCounter(), testL.frameCounter(), @"frameCounter match");
400 XCTAssertEqual(testArrayC.objects(FVOGoalPostRightTop).distance(), testR.distance(), @"distance match");
401 XCTAssertEqual(testArrayC.objects(FVOGoalPostRightTop).frameCounter(), testR.frameCounter(), @"frameCounter match");
402
403}
404
406{
407 VisionBall_t aBallHandler;
408
409 VisionBall testBall("TopBall:(-42,45)@103");
410
411 bool ballInTopIsVisible=testBall.topVisible();
412 bool ballInBottomIsVisible=testBall.bottomVisible();
413 int x = testBall.topX();
414 int y = testBall.topY();
415 int radious = testBall.topRadius();
416
417 XCTAssertEqual(radious, 103, @"radious incorrect");
418
419 aBallHandler.set(testBall); // write to wb
420
421 VisionBall ballSighting = aBallHandler.get();
422
423 ballInTopIsVisible=ballSighting.topVisible();
424 ballInBottomIsVisible=ballSighting.bottomVisible();
425 int myTopRadius=0; int centerTopX=0; int centerTopY=0;
426 int myBottomRadius=0; int centerBottomX=0; int centerBottomY=0;
427
428 XCTAssertTrue(ballInTopIsVisible, @"Expected top ball");
429 if ( ballInTopIsVisible )
430 {
431 DBG( std::cout << " Top ball radious ("<< theBalls[Top]->GetRadius() << ")" << std::endl; )
432 myTopRadius = ballSighting.topRadius();
433 centerTopX = ballSighting.topX();
434 centerTopY = ballSighting.topY();
435 }
436
437 XCTAssertFalse(ballInBottomIsVisible, @"Expected no bottom ball");
438
439 if ( ballInBottomIsVisible )
440 {
441 DBG( std::cout << " Bottom ball radious ("<< theBalls[Bottom]->GetRadius() << ")" << std::endl; )
442 myBottomRadius = ballSighting.bottomRadius();
443 centerBottomX = ballSighting.bottomX();
444 centerBottomY = ballSighting.bottomY();
445 }
446
447 XCTAssertEqual(x, centerTopX, @"'x' match");
448 XCTAssertEqual(y, centerTopY, @"'y' match");
449 XCTAssertEqual(radious, myTopRadius, @"radiousr match");
450 XCTAssertEqual(ballSighting.frameNumber(), testBall.frameNumber(), @"frameCounter match");
451
452
453}
454
455- (void) testSubscribe
456{
457 WBSubscriber subscriber(self);
458
459 XCTAssertEqual(callbackCount, 0, @"Expected zero callback count to begin with, but got %d", callbackCount);
460
461 string testString("Testing Whiteboard subscription");
462 Print_t print(testString);
463 XCTAssertEqual(dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER), 0L, @"Expected callback within a second");
464 XCTAssertEqual(callbackCount, 1, @"Expected callback count of 1, but got %d", callbackCount);
465 XCTAssertTrue(testString == self.stringValue.UTF8String, @"Expected '%s' from callback, but got '%@'", testString.c_str(), self.stringValue);
466
467 testString = [[[NSDate date] description] UTF8String];
468 print(testString);
469 XCTAssertEqual(dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER), 0L, @"Expected second callback within a second");
470 XCTAssertEqual(callbackCount, 2, @"Expected callback count of 2, but got %d", callbackCount);
471 XCTAssertTrue(testString == self.stringValue.UTF8String, @"Expected '%s' from callback, but got '%@'", testString.c_str(), self.stringValue);
472}
473
475 // FIXME: vision below
477
478- (void) testStringPostings
479{
480 string testString("000");
481
482 for (int wbtype = 1; wbtype < GSW_NUM_TYPES_DEFINED; wbtype++) try
483 {
484 bool result = guWhiteboard::postmsg(static_cast<WBTypes>(wbtype), testString);
485 bool needStringConversion = true;
486 for (size_t i = 0; i < sizeof(nasty_wb_without_string_conversion)/sizeof(nasty_wb_without_string_conversion[0]); i++)
487 {
488 if (wbtype == nasty_wb_without_string_conversion[i])
489 {
490 needStringConversion = false;
491 break;
492 }
493 }
494 XCTAssertTrue(!needStringConversion || result, @"Could not post wb message %d (%s):", wbtype, WBTypes_stringValues[wbtype]);
495 }
496 catch (...)
497 {
498 XCTAssertNoThrow(guWhiteboard::postmsg(static_cast<WBTypes>(wbtype), testString), @"Exception posting wb message %d (%s):", wbtype, WBTypes_stringValues[wbtype]);
499 }
500}
501
502
504{
505#ifndef GSW_IOS_DEVICE
506 const char *wbenv = getenv(GSW_DEFAULT_ENV);
507 XCTAssert(wbenv, @"Whiteboard environment variable '%s' not set", GSW_DEFAULT_ENV);
508 XCTAssertTrue(strcmp(wbenv, WB_FNAME) == 0, @"Whiteboard environment '%s' instead of '%s'", wbenv, WB_FNAME);
509 const char *fname = "/tmp/" WB_FNAME;
510 struct stat buf;
511 XCTAssertTrue(stat(fname, &buf) != -1, @"Could not open whiteboard '%s': %s", fname, strerror(errno));
512 unlink(fname);
513#endif
514}
515
516#pragma clang diagnostic pop
517
518@end
#define WB_FNAME
#define WB_TYPE_BIND(t, f)
Definition: WBFunctor.h:33
subscription test class
~WBSubscriber()
Test Destructor.
void sub(WBTypes, gu_simple_message *m)
Trigger subscription test.
WBSubscriber(SimpleWhiteboardTest *t)
Test Constructor.
void set(const object_type &msg)
designated setter for posting whiteboard messages
object_type get()
designated getter for getting a whiteboard message
object_type get_from(gu_simple_message *msg)
access method to get data from an existing, low-level message
Class for controlling and getting the status of FSMs.
void clr(int fsm)
machine control/status clearer
void set(int fsm)
machine control/status setter
bool get(int fsm) const
machine status setter
Provides a C++ wrapper around wb_filtered_arrayonedimobjects.
void set_objects(const FilteredVisionObject *t_newValue)
const FilteredVisionObject * objects() const
Class for for the array of sonar messages, LEFT and RIGHT.
A class to contain objects that have been filtered through localisation.
Class for for one filtered sonar message.
Provides a C++ wrapper around wb_sensors_torsojointsensors.
Whiteboard Class used by vision to report detect ball Reports balls detected in top or bottom camera,...
Definition: VisionBall.hpp:32
int16_t bottomY() const
Center Y Position of the bottom ball.
Definition: VisionBall.hpp:156
int16_t topRadius() const
Radius of the top ball.
Definition: VisionBall.hpp:126
int16_t topY() const
Center Y Position of the top ball.
Definition: VisionBall.hpp:138
int16_t bottomRadius() const
Radius of the bottom ball.
Definition: VisionBall.hpp:144
int16_t topX() const
Center X Position of the top ball.
Definition: VisionBall.hpp:132
int16_t bottomX() const
Center X Position of the bottom ball.
Definition: VisionBall.hpp:150
This class provides a subscription implementation for the 'simple' whiteboard, aka the 'typed' whiteb...
void subscribe(WBFunctorBase *func)
Allows you to subscribe to a specific whiteboard type and get callbacks when that type is updated.
void unsubscribe(guWhiteboard ::wb_types t)
Stop getting callbacks for a particular whiteboard type.
const char ** WBTypes_stringValues
allow whiteboard to use old functions for whiteboard initialisation and choose which messages and con...
#define GSW_NUM_TYPES_DEFINED
allow whiteboard to use old functions for whiteboard initialisation and choose which messages and con...
#define GSW_DEFAULT_ENV
environment variable containing the default whiteboard file name
#define kFilteredGoalSighting_v
#define kSoloTypeExample_v
#define kFilteredBallSighting_v
#define kSENSORSLedsSensors_v
#define kTotoDoingMotion_v
#define kSENSORSLegJointTemps_v
#define kOculusPrime_Command_v
#define kTeleoperationControlStatus_v
#define kSensorsFootSensors_v
#define kSENSORSTorsoJointTemps_v
wb_types
All the message 'types' for the class based whiteboard.
#define kwb_reserved_SubscribeToAllTypes_v
NSString * stringValue
not sure, some string for test
void setUp()
Setup objects for testing.
void tearDown()
Destroy testing objects.
dispatch_semaphore_t semaphore
not sure, some sem used in testing
void testStringPutGet()
String Test function for 'simple' whiteboard setter and getter.
int callbackCount
counter used for testing callbacks
void testIntGetPutGetPut()
Int Test function for 'simple' whiteboard setter and getter.
/file APM_Interface.h
bool postmsg(wb_types message_index, std::string message_content, gu_simple_whiteboard_descriptor *wbd)
WHITEBOARD_POSTER_STRING_CONVERSION.
Simple sonar information for the whiteboard.
union type that is used to store data in shared memory
@ FVOGoalPostLeftTop
Filtered information for a post we know is Left.
@ FVOGoalCrossBarTop
Filtered information for the cross BAR.
@ FVOGoalPostTop
Filtered information for a post we cannot tell is Left or right.
@ FVOGoalPostRightTop
Filtered information for a post we know is right.
@ Bottom
Bottom Camera on the nao.
@ Top
Top Camera on the nao.