Fawkes API
Fawkes Development Version
vision.cpp
1
2
/***************************************************************************
3
* vision.cpp - Vision aspect for Fawkes
4
*
5
* Created: Tue May 29 14:47:43 2007
6
* Copyright 2006-2010 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. A runtime exception applies to
14
* this software (see LICENSE.GPL_WRE file mentioned below for details).
15
*
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU Library General Public License for more details.
20
*
21
* Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22
*/
23
24
#include <aspect/vision.h>
25
26
namespace
fawkes
{
27
28
/** @class VisionAspect <aspect/vision.h>
29
* Thread aspect to use in FireVision apps.
30
*
31
* It is guaranteed that if used properly from within plugins that
32
* initVisionAspect() is called before the thread is started and that
33
* you can access the vision master via the vision_master member.
34
*
35
* A vision thread can be called either cyclic, which means that in every
36
* loop the vision master will wait for this vision thread to finish before
37
* the next loop. This also means that the thread has to operate in
38
* wait-for-wakeup mode. The thread is woken up when a new camera image is
39
* available. In general the vision thread should be very fast and under no
40
* conditions it should take longer to process an image than to aquire it.
41
* The thread can also operate in continuous mode, in this case also the
42
* thread has to operate in continuous mode. In this mode the vision
43
* application should keep running and the processing is independent from
44
* the camera speed. Make sure that you use strict logging on the shared
45
* memory camera to ensure healthy pictures.
46
*
47
* @ingroup Aspects
48
* @author Tim Niemueller
49
*/
50
51
/** Constructor.
52
* @param mode mode to operate in
53
*/
54
VisionAspect::VisionAspect
(VisionThreadMode mode)
55
{
56
add_aspect
(
"VisionAspect"
);
57
vision_thread_mode_ = mode;
58
}
59
60
/** Virtual empty Destructor. */
61
VisionAspect::~VisionAspect
()
62
{
63
}
64
65
/** Set vision master.
66
* @param vision_master vision master
67
* It is guaranteed that this is called for a logging thread before
68
* Thread::start() is called (when running regularly inside Fawkes).
69
* @see VisionMaster
70
*/
71
void
72
VisionAspect::init_VisionAspect
(
firevision::VisionMaster
*vision_master)
73
{
74
this->vision_master =
vision_master
;
75
}
76
77
/** Get the vision thread mode of this thread.
78
* @return vision thread mode
79
*/
80
VisionAspect::VisionThreadMode
81
VisionAspect::vision_thread_mode
()
82
{
83
return
vision_thread_mode_;
84
}
85
86
}
// end namespace fawkes
fawkes::Aspect::add_aspect
void add_aspect(const char *name)
Add an aspect to a thread.
Definition:
aspect.cpp:55
fawkes::VisionAspect::VisionAspect
VisionAspect(VisionThreadMode mode)
Constructor.
Definition:
vision.cpp:60
fawkes::VisionAspect::vision_thread_mode
VisionThreadMode vision_thread_mode()
Get the vision thread mode of this thread.
Definition:
vision.cpp:87
fawkes
fawkes::VisionAspect::vision_master
firevision::VisionMaster * vision_master
Vision master.
Definition:
vision.h:63
firevision::VisionMaster
Definition:
vision_master.h:43
fawkes::VisionAspect::~VisionAspect
virtual ~VisionAspect()
Virtual empty Destructor.
Definition:
vision.cpp:67
fawkes::VisionAspect::VisionThreadMode
VisionThreadMode
The operation mode of this vision thread.
Definition:
vision.h:50
fawkes::VisionAspect::init_VisionAspect
void init_VisionAspect(firevision::VisionMaster *vision_master)
Set vision master.
Definition:
vision.cpp:78
src
libs
aspect
vision.cpp
Generated by
1.8.17