Warning: include(php/utility.php): Failed to open stream: No such file or directory in /home/argos/argos3/doc/api/embedded/a00616_source.php on line 2

Warning: include(): Failed opening 'php/utility.php' for inclusion (include_path='.:/usr/lib64/php') in /home/argos/argos3/doc/api/embedded/a00616_source.php on line 2
The ARGoS Website

ci_colored_blob_omnidirectional_camera_sensor.h
Go to the documentation of this file.
1 #ifndef CI_COLORED_BLOB_OMNIDIRECTIONAL_CAMERA_SENSOR_H
2 #define CI_COLORED_BLOB_OMNIDIRECTIONAL_CAMERA_SENSOR_H
3 
4 namespace argos {
5  class CCI_ColoredBlobOmnidirectionalCameraSensor;
6 }
7 
8 #include <argos3/core/control_interface/ci_sensor.h>
9 #include <argos3/core/utility/math/angles.h>
10 #include <argos3/core/utility/datatypes/color.h>
11 #include <vector>
12 
13 #include <argos3/core/utility/logging/argos_log.h>
14 
15 namespace argos {
16 
27 
28  public:
29 
40  struct SBlob {
41  /* Color */
43  /* Angle */
45  /* Distance in cms */
50  SBlob() :
51  Color(CColor::BLACK),
52  Distance(0.0f) {
53  }
60  SBlob(const CColor& c_color,
61  const CRadians& c_angle,
62  Real f_distance) :
63  Color(c_color),
64  Angle(c_angle),
65  Distance(f_distance) {
66  }
67 
68  friend std::ostream& operator<<(std::ostream& c_os, const SBlob& s_blob) {
69  c_os << "(Color = " << s_blob.Color << "," << "Angle = " << ToDegrees(s_blob.Angle) << ","
70  << "Distance = " << s_blob.Distance << ")";
71  return c_os;
72  }
73  };
74 
78  typedef std::vector<SBlob*> TBlobList;
79 
85  struct SReadings {
86  TBlobList BlobList;
88 
90  Counter(0) {
91  }
92 
93  friend std::ostream& operator<<(std::ostream& c_os, const SReadings& s_reading) {
94  c_os << "Counter: " << s_reading.Counter << std::endl;
95  for (size_t i = 0; i < s_reading.BlobList.size(); i++) {
96  c_os << "Blob[" << i << "]: " << s_reading.BlobList[i] << std::endl;
97  }
98  return c_os;
99  }
100  };
101 
102  public:
103 
108 
113 
118  const SReadings& GetReadings() const;
119 
123  virtual void Enable() = 0;
124 
128  virtual void Disable() = 0;
129 
130 #ifdef ARGOS_WITH_LUA
131  virtual void CreateLuaState(lua_State* pt_lua_state);
132 
133  virtual void ReadingsToLuaState(lua_State* pt_lua_state);
134 #endif
135 
136  protected:
137 
139 
140  };
141 
142 }
143 
144 #endif
This class provides the most general interface to a camera.
std::vector< SBlob * > TBlobList
Vector of pointers to colored blobs.
CDegrees ToDegrees(const CRadians &c_radians)
Converts CRadians to CDegrees.
Definition: angles.h:489
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
const SReadings & GetReadings() const
Returns a reference to the current camera readings.
It defines the basic type CRadians, used to store an angle value in radians.
Definition: angles.h:42
It represents the readings collected through the camera at a specific time step.
virtual void Disable()=0
Disables image acquisition and processing.
The basic interface for all sensors.
Definition: ci_sensor.h:34
friend std::ostream & operator<<(std::ostream &c_os, const SBlob &s_blob)
SBlob(const CColor &c_color, const CRadians &c_angle, Real f_distance)
Constructor with paramters.
friend std::ostream & operator<<(std::ostream &c_os, const SReadings &s_reading)
The basic color type.
Definition: color.h:25
unsigned long long UInt64
64-bit unsigned integer.
Definition: datatypes.h:107
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
An SBlob represents a generic colored 2D segment in the image.
virtual void Enable()=0
Enables image acquisition and processing.