#include <CSWSonar.h>
Public Types | |
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 } |
Public Member Functions | |
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 |
Public Member Functions inherited from CodeSubWars::CSWEquipment | |
bool | isMoving () const |
Public Member Functions inherited from CodeSubWars::CSWObject | |
const std::string & | getName () const |
This is the base class for sonar like functionality. To cover regions the sonar can be rotated periodically. This can be controlled by the three different mode types (direction, velocity and range). The maximal angular velocity for adjusting is 180 degree/second.
Available scanning directions and areas.
const Vector3D & CodeSubWars::CSWSonar::getDirection | ( | ) | const |
Gets the current scanning direction in world coordinate system.
const Vector3D & CodeSubWars::CSWSonar::getScanDirection | ( | ) | const |
Gets the current custom main scanning direction for scan direction mode LOCAL_DIRECTION.
CSWSonar::ScanDirectionMode CodeSubWars::CSWSonar::getScanDirectionMode | ( | ) | const |
Gets the current scanning direction mode.
CSWSonar::ScanRangeMode CodeSubWars::CSWSonar::getScanRangeMode | ( | ) | const |
Gets the current scanning range mode.
CSWSonar::ScanVelocityMode CodeSubWars::CSWSonar::getScanVelocityMode | ( | ) | const |
Gets the current scanning velocity mode.
bool CodeSubWars::CSWSonar::isAutomaticRotationEnabled | ( | ) | const |
Returns whether the automatic rotation is enabled or not.
void CodeSubWars::CSWSonar::pointToGlobalPosition | ( | const Vector3D & | vecPosition | ) |
Lets the sonar always points to the given position in world coordinate system for scan direction mode GLOBAL_POSITION.
vecPosition | The global position to which the sonar should be directed. |
void CodeSubWars::CSWSonar::setEnableAutomaticRotation | ( | bool | bValue | ) |
Enable the automatic rotation. If this is set to false the sonar can be set manually to desired direction with setDirection().
bValue | If true the automatic rotation is activated otherwise not. |
void CodeSubWars::CSWSonar::setScanDirection | ( | const Vector3D & | vecDirection | ) |
Sets the new custom main scanning direction for scan direction mode LOCAL_DIRECTION.
vecDirection | The new custom main scanning direction in local coordinate system that should be used. |
void CodeSubWars::CSWSonar::setScanDirectionMode | ( | int | directionMode | ) |
Sets the scanning direction.
directionMode | The new scanning direction that should be used. |
void CodeSubWars::CSWSonar::setScanRangeMode | ( | int | rangeMode | ) |
Sets the scanning range.
rangeMode | The new scanning range that should be used. |
void CodeSubWars::CSWSonar::setScanVelocityMode | ( | int | velocityMode | ) |
Sets the scanning velocity.
velocityMode | The new scanning velocity that should be used. |