9 #include <argos3/core/simulator/simulator.h>
10 #include <argos3/core/utility/math/matrix/squarematrix.h>
11 #include <argos3/core/utility/math/matrix/transformationmatrix3.h>
13 #include <argos3/plugins/simulator/media/directional_led_medium.h>
14 #include <argos3/plugins/simulator/entities/directional_led_entity.h>
23 m_pcLEDIndex(nullptr) {}
35 std::string strMedium;
48 const std::array<CPlane, 6>& arr_frustum_planes,
51 const CVector3& c_bounding_box_position,
52 const CVector3& c_bounding_box_half_extents) {
55 c_world_to_camera_transform, c_camera_location,
62 m_pcLEDIndex->ForEntitiesInBoxRange(c_bounding_box_position,
63 c_bounding_box_half_extents,
71 "directional_led_detector",
72 "Michael Allwright [allsey87@gmail.com]",
74 "This algorithm detects nearby LEDs seen by the camera and\n"
75 "returns the X and Y coordinates on the sensor",
76 "This algorithm detects nearby LEDs seen by the camera and\n"
77 "returns the X and Y coordinates on the sensor",
virtual void Update(const CSquareMatrix< 3 > &c_projection_matrix, const std::array< CPlane, 6 > &arr_frustum_planes, const CTransformationMatrix3 &c_world_to_camera_transform, const CVector3 &c_camera_location, const CVector3 &c_bounding_box_position, const CVector3 &c_bounding_box_half_extents)
void GetNodeAttributeOrDefault(TConfigurationNode &t_node, const std::string &str_attribute, T &t_buffer, const T &t_default)
Returns the value of a node's attribute, or the passed default value.
std::vector< SReading > m_vecReadings
CCameraSensorDirectionalLEDDetectorAlgorithm()
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
#define THROW_ARGOSEXCEPTION_NESTED(message, nested)
This macro throws an ARGoS exception with the passed message and nesting the passed exception...
virtual void Init(TConfigurationNode &t_node)
Initializes the resource.
This class provides the most general interface to a camera.
void GetNodeAttribute(TConfigurationNode &t_node, const std::string &str_attribute, T &t_buffer)
Returns the value of a node's attribute.
The exception that wraps all errors in ARGoS.
T & GetMedium(const std::string &str_id)
Returns a reference to a medium.
The namespace containing all the ARGoS related code.
REGISTER_CAMERA_SENSOR_ALGORITHM(CCameraSensorDirectionalLEDDetectorAlgorithm,"directional_led_detector","Michael Allwright [allsey87@gmail.com]","1.0","This algorithm detects nearby LEDs seen by the camera and\n""returns the X and Y coordinates on the sensor","This algorithm detects nearby LEDs seen by the camera and\n""returns the X and Y coordinates on the sensor","Under development")
std::vector< std::pair< bool, CRay3 > > m_vecCheckedRays
static CSimulator & GetInstance()
Returns the instance to the CSimulator class.
virtual void Init(TConfigurationNode &t_tree)
Initializes the resource.