ARGoS 3
A parallel, multi-engine simulator for swarm robotics
ci_colored_blob_perspective_camera_sensor.h
Go to the documentation of this file.
1#ifndef CI_COLORED_BLOB_PERSPECTIVE_CAMERA_SENSOR_H
2#define CI_COLORED_BLOB_PERSPECTIVE_CAMERA_SENSOR_H
3
4namespace argos {
5 class CCI_ColoredBlobPerspectiveCameraSensor;
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
15namespace argos {
16
27
28 public:
29
40 struct SBlob {
41 /* Color */
43 /* Blob position */
49 Color(CColor::BLACK),
50 X(0), Y(0) {
51 }
55 SBlob(const CColor& c_color,
56 SInt32 n_x,
57 SInt32 n_y) :
58 Color(c_color),
59 X(n_x),
60 Y(n_y) {
61 }
62
63 friend std::ostream& operator<<(std::ostream& c_os, const SBlob& s_blob) {
64 c_os << "(Color = " << s_blob.Color << "," << "X = " << s_blob.X << ",Y = " << s_blob.Y << ")";
65 return c_os;
66 }
67 };
68
72 typedef std::vector<SBlob*> TBlobList;
73
79 struct SReadings {
82
84 Counter(0) {
85 }
86
87 friend std::ostream& operator<<(std::ostream& c_os, const SReadings& s_reading) {
88 c_os << "Counter: " << s_reading.Counter << std::endl;
89 for (size_t i = 0; i < s_reading.BlobList.size(); i++) {
90 c_os << "Blob[" << i << "]: " << s_reading.BlobList[i] << std::endl;
91 }
92 return c_os;
93 }
94 };
95
96 public:
97
102
107
112 const SReadings& GetReadings() const;
113
114#ifdef ARGOS_WITH_LUA
115 virtual void CreateLuaState(lua_State* pt_lua_state);
116
117 virtual void ReadingsToLuaState(lua_State* pt_lua_state);
118#endif
119
120 protected:
121
123
124 };
125
126}
127
128#endif
signed int SInt32
32-bit signed integer.
Definition datatypes.h:93
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
The basic interface for all sensors.
Definition ci_sensor.h:34
The basic color type.
Definition color.h:25
This class provides the most general interface to a camera.
const SReadings & GetReadings() const
Returns a reference to the current camera readings.
std::vector< SBlob * > TBlobList
Vector of pointers to colored blobs.
An SBlob represents a generic colored 2D segment in the image.
friend std::ostream & operator<<(std::ostream &c_os, const SBlob &s_blob)
SBlob(const CColor &c_color, SInt32 n_x, SInt32 n_y)
Constructor with paramters.
It represents the readings collected through the camera at a specific time step.
friend std::ostream & operator<<(std::ostream &c_os, const SReadings &s_reading)