7 #ifndef CAMERA_SENSOR_DIRECTIONAL_LED_DETECTOR_ALGORITHM_H
8 #define CAMERA_SENSOR_DIRECTIONAL_LED_DETECTOR_ALGORITHM_H
11 class CCameraSensorDirectionalLEDDetectorAlgorithm;
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/directional_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_directional_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);
65 m_cOcclusionCheckRay.
SetEnd(cLedPosition);
76 CRay3 m_cOcclusionCheckRay;
90 const std::array<CPlane, 6>& arr_frustum_planes,
93 const CVector3& c_bounding_box_position,
94 const CVector3& c_bounding_box_half_extents);
119 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
CRadians GetAngleWithCamera(const CPositionalEntity &c_entity) const
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 AddCheckedRay(bool b_intersected, const CRay3 &c_ray)
void SetShowRays(bool b_show_rays)
Sets whether or not the rays must be shown in the GUI.
void AddReading(const CColor &c_color, const CVector2 &c_center)
virtual void Init(TConfigurationNode &t_tree)
Initializes the resource.
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)
CCameraSensorDirectionalLEDDetectorAlgorithm()
virtual ~CCameraSensorDirectionalLEDDetectorAlgorithm()
bool IsShowRays()
Returns true if the rays must be shown in the GUI.
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, CCameraSensorDirectionalLEDDetectorAlgorithm &c_algorithm)
virtual ~CUpdateOperation()
virtual bool operator()(CDirectionalLEDEntity &c_led)
const CRadians & GetObservableAngle() const
Returns the observable angle of the LED.
const CColor & GetColor() const
Returns the current color of the LED.