Module to which keeps track of objects around the roboid.
More...
#include <Perception.h>
Module to which keeps track of objects around the roboid.
◆ Perception() [1/3]
Perception::Perception |
( |
| ) |
|
◆ Perception() [2/3]
template<unsigned int sensorCount>
Passer::RoboidControl::Perception::Perception |
( |
Placement(&) |
sensors[sensorCount] | ) |
|
|
inline |
Template to make it possible to leave out ths sensorCount.
- Template Parameters
-
- Parameters
-
sensors | An array of sensor placements |
◆ Perception() [3/3]
Perception::Perception |
( |
Placement * |
sensors, |
|
|
unsigned int |
sensorCount |
|
) |
| |
Create a perception setup with the given Sensors.
- Parameters
-
sensors | The Placement of Sensors on the Roboid |
sensorCount | The number of sensors in the placement array |
◆ GetSensorCount()
unsigned int Perception::GetSensorCount |
( |
| ) |
|
Get the number of Sensors.
- Returns
- The number of sensors, zero when no sensors are present
◆ GetSensor()
Sensor * Perception::GetSensor |
( |
unsigned int |
sensorIx | ) |
|
Get a specific Sensor on the Roboid.
- Parameters
-
sensorId | The index of the Sensor |
- Returns
- The requested Sensor or a nullptr when no Sensor with the given index could be found
◆ GetSensorPlacement()
Placement * Passer::RoboidControl::Perception::GetSensorPlacement |
( |
unsigned int |
sensorIx | ) |
|
Get the placement of a specific Sensor.
- Parameters
-
motorIx | The index of the Sensor |
- Returns
- Returns the Placement or a nullptr when no Placement with the given index could be found
◆ DistanceForward()
float Perception::DistanceForward |
( |
float |
direction = 90 | ) |
|
Distance to the closest object on the front of the Roboid.
- Parameters
-
direction | The direction relative to the forward direction in which the object should be present |
- Returns
- The distance to the closest object within the given range, INFINITY when no object is detected
◆ DistanceLeft() [1/2]
float Passer::RoboidControl::Perception::DistanceLeft |
( |
| ) |
|
|
inline |
Distance to the closest object on the left.
- Returns
- distance in meters, INFINITY when no object is detected.
- Note
- An object is on the left when the
angle
is between -180 and 0 degrees.
-
An object dead straight (0 degrees) is not reported.
◆ DistanceLeft() [2/2]
float Perception::DistanceLeft |
( |
float |
angle | ) |
|
Distance to the closest object on the left.
- Parameters
-
angle | the maximum angle on the left used for detection. |
- Returns
- distance in meters, INFINITY when no object is detected.
- Note
- An object is on the left when the
angle
is between -angle
and 0 degrees.
-
An object dead straight (0 degrees) is not reported.
-
When an object is beyond
angle
meters, it is not reported.
◆ DistanceRight() [1/2]
float Passer::RoboidControl::Perception::DistanceRight |
( |
| ) |
|
|
inline |
Distance to the closest object on the right.
- Returns
- distance in meters, INFINITY when no object is detected
- Note
- An object is on the right when the
angle
is between 0 and 180 degrees
-
An object dead straight (0 degrees) is not reported
◆ DistanceRight() [2/2]
float Perception::DistanceRight |
( |
float |
angle | ) |
|
Distance to the closest object on the right.
- Parameters
-
angle | the maximum angle on the left used for detection. |
- Returns
- distance in meters, INFINITY when no object is detected
- Note
- An object is on the left when the
angle
is between 0 and angle
degrees.
-
An object dead straight (0 degrees) is not reported.
-
When an object is beyond
angle
meters, it is not reported.
◆ DistanceUp() [1/2]
float Passer::RoboidControl::Perception::DistanceUp |
( |
| ) |
|
|
inline |
Distance to the closest object above the Roboid.
- Returns
- distance in meters, INFINITY when no object is detected
◆ DistanceUp() [2/2]
float Perception::DistanceUp |
( |
float |
angle | ) |
|
Distance to the closest object above the Roboid within the give range.
- Parameters
-
angle | The angle relative to the upward direction to indicate the range |
- Returns
- distance in meters, INFINITY when no object is detected
◆ DistanceDown() [1/2]
float Passer::RoboidControl::Perception::DistanceDown |
( |
| ) |
|
|
inline |
Disatnce to the closest object under the Roboid.
- Returns
- distance in meters, INFINITY when no object is detected
◆ DistanceDown() [2/2]
float Perception::DistanceDown |
( |
float |
angle | ) |
|
Distance to the closest object under th4e Roboid within the given range.
- Parameters
-
angle | The angle relative to the downward direciton to indicate the range |
- Returns
- distance in meters, INFINITY when no object is detected
◆ SwitchOn()
bool Perception::SwitchOn |
( |
float |
fromAngle, |
|
|
float |
toAngle |
|
) |
| |
Checks if an object is close within the give range in the horizontal plane.
- Parameters
-
fromAngle | Start angle in the horizontal plane |
toAngle | End angle in the horizontal plane |
- Returns
- True is an object is closeby
- Note
- Whether an object is closeby depends on the Distance Sensor
◆ sensorPlacements
Placement* Passer::RoboidControl::Perception::sensorPlacements = nullptr |
|
protected |
◆ sensorCount
unsigned int Passer::RoboidControl::Perception::sensorCount = 0 |
|
protected |
The documentation for this class was generated from the following files:
- d:/PlatformIO/RoboidControlArduino/src/RoboidControl/Perception.h
- d:/PlatformIO/RoboidControlArduino/src/RoboidControl/Perception.cpp