7 #ifndef CAMERA_SENSOR_LED_DETECTOR_ALGORITHM_H
8 #define CAMERA_SENSOR_LED_DETECTOR_ALGORITHM_H
11 class CCameraSensorLEDDetectorAlgorithm;
14 #include <argos3/core/simulator/entity/embodied_entity.h>
15 #include <argos3/core/simulator/space/positional_indices/positional_index.h>
16 #include <argos3/core/utility/math/ray3.h>
17 #include <argos3/core/utility/math/matrix/transformationmatrix3.h>
19 #include <argos3/plugins/simulator/entities/led_entity.h>
20 #include <argos3/plugins/robots/generic/simulator/camera_sensor_algorithm.h>
21 #include <argos3/plugins/robots/generic/control_interface/ci_camera_sensor_algorithms/ci_camera_sensor_led_detector_algorithm.h>
40 const std::array<CPlane, 6>& arr_frustum_planes,
46 c_camera_to_world_transform,
48 m_cAlgorithm(c_algorithm) {
49 m_cOcclusionCheckRay.
SetStart(c_camera_location);
62 m_cOcclusionCheckRay.
SetEnd(cLedPosition);
73 CRay3 m_cOcclusionCheckRay;
87 const std::array<CPlane, 6>& arr_frustum_planes,
90 const CVector3& c_bounding_box_position,
91 const CVector3& c_bounding_box_half_extents);
116 m_bShowRays = b_show_rays;
The namespace containing all the ARGoS related code.
bool GetClosestEmbodiedEntityIntersectedByRay(SEmbodiedEntityIntersectionItem &s_item, const CRay3 &c_ray)
Returns the closest intersection with an embodied entity to the ray start.
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
const CVector3 & GetPosition() const
A data structure that contains positional entities.
void SetEnd(const CVector3 &c_end)
void SetStart(const CVector3 &c_start)
std::vector< SReading > m_vecReadings
std::vector< std::pair< bool, CRay3 > > m_vecCheckedRays
CVector2 ProjectOntoSensor(const CVector3 &c_vector) const
bool IsPointInsideFrustum(const CVector3 &c_point) const
This class provides the most general interface to a camera.
void SetShowRays(bool b_show_rays)
Sets whether or not the rays must be shown in the GUI.
CCameraSensorLEDDetectorAlgorithm()
virtual ~CCameraSensorLEDDetectorAlgorithm()
bool IsShowRays()
Returns true if the rays must be shown in the GUI.
virtual void Update(const CSquareMatrix< 3 > &c_projection_matrix, const std::array< CPlane, 6 > &arr_frustum_planes, const CTransformationMatrix3 &c_camera_to_world_transform, const CVector3 &c_camera_location, const CVector3 &c_bounding_box_position, const CVector3 &c_bounding_box_half_extents)
virtual void Init(TConfigurationNode &t_tree)
Initializes the resource.
void AddReading(const CColor &c_color, const CVector2 &c_center)
void AddCheckedRay(bool b_intersected, const CRay3 &c_ray)
virtual bool operator()(CLEDEntity &c_led)
virtual ~CUpdateOperation()
CUpdateOperation(const CSquareMatrix< 3 > &c_projection_matrix, const std::array< CPlane, 6 > &arr_frustum_planes, const CTransformationMatrix3 &c_camera_to_world_transform, const CVector3 &c_camera_location, CCameraSensorLEDDetectorAlgorithm &c_algorithm)
const CColor & GetColor() const
Returns the current color of the LED.