#include <CSWActiveSonar.h>
Public Member Functions | |
const double & | getDistance () const |
const double & | getMaximalDistance () const |
bool | hasTargetDetected () const |
bool | isTargetDynamic () const |
bool | isTargetBorder () const |
bool | isTargetSubmarine () const |
bool | isTargetWeapon () const |
const Vector3D & | getTargetPosition () const |
![]() | |
void | setEnableAutomaticRotation (bool bValue) |
bool | isAutomaticRotationEnabled () const |
void | setScanDirectionMode (int directionMode) |
void | setScanVelocityMode (int velocityMode) |
void | setScanRangeMode (int rangeMode) |
ScanDirectionMode | getScanDirectionMode () const |
ScanVelocityMode | getScanVelocityMode () const |
ScanRangeMode | getScanRangeMode () const |
void | setScanDirection (const Vector3D &vecDirection) |
const Vector3D & | getScanDirection () const |
void | pointToGlobalPosition (const Vector3D &vecPosition) |
const Vector3D & | getDirection () const |
![]() | |
bool | isMoving () const |
![]() | |
const std::string & | getName () const |
Additional Inherited Members | |
![]() | |
enum | ScanDirectionMode { FULL = 1 , FRONT = 2 , BACK = 3 , LOCAL_DIRECTION = 4 , GLOBAL_POSITION = 5 } |
enum | ScanVelocityMode { FAST = 1 , SLOW = 2 } |
enum | ScanRangeMode { NEAR_RANGE = 1 , FAR_RANGE = 2 } |
This class specializes a sonar to an active sonar. The time difference between sent and received sonic waves gives the distance to detected solid objects within a small region. The three modes for direction, velocity and range have now additional meanings:
Detected objects are reported to the map.
const double & CodeSubWars::CSWActiveSonar::getDistance | ( | ) | const |
Returns the distance from the sensor to the detected object.
const double & CodeSubWars::CSWActiveSonar::getMaximalDistance | ( | ) | const |
Returns the maximal distance within objects can be detected.
const Vector3D & CodeSubWars::CSWActiveSonar::getTargetPosition | ( | ) | const |
Returns the position of the detection in world coordinates.
bool CodeSubWars::CSWActiveSonar::hasTargetDetected | ( | ) | const |
Returns true if an object has been detected otherwise false
bool CodeSubWars::CSWActiveSonar::isTargetBorder | ( | ) | const |
Returns true if a world border has been detected.
bool CodeSubWars::CSWActiveSonar::isTargetDynamic | ( | ) | const |
Returns true if a dynamic object has been detected.
bool CodeSubWars::CSWActiveSonar::isTargetSubmarine | ( | ) | const |
Returns true if a submarine has been detected.
bool CodeSubWars::CSWActiveSonar::isTargetWeapon | ( | ) | const |
Returns true if a weapon has been detected.