59 lines
1.5 KiB
C++
59 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include "VectorAlgebra/Polar.h"
|
|
|
|
namespace Passer {
|
|
namespace RoboidControl {
|
|
|
|
/// @brief A thing is a functional component on a robot
|
|
class Thing {
|
|
public:
|
|
/// @brief Default constructor for a Thing
|
|
Thing();
|
|
|
|
/// @brief The type of Thing
|
|
unsigned int type;
|
|
|
|
/// @brief The type of a switch sensor
|
|
static const unsigned int SwitchType;
|
|
/// @brief The type of a distance sensor
|
|
static const unsigned int DistanceSensorType;
|
|
/// @brief The type of a controlled motor
|
|
static const unsigned int ControlledMotorType;
|
|
/// @brief The type of an uncontrolled motor
|
|
static const unsigned int UncontrolledMotorType;
|
|
/// @brief The type of an object received from the network
|
|
static const unsigned int ExternalType;
|
|
|
|
/// @brief Check if the Thing is a Motor
|
|
/// @returns True when the Thing is a Motor and False otherwise
|
|
bool IsMotor();
|
|
/// @brief Check if the Thing is a Sensor
|
|
/// @returns True when the Thing is a Sensor and False otherwise
|
|
bool IsSensor();
|
|
|
|
Polar position;
|
|
|
|
protected:
|
|
/// @brief Bitmask for Motor type
|
|
static const unsigned int MotorType = 0x8000;
|
|
/// @brief Bitmap for Sensor type
|
|
static const unsigned int SensorType = 0x4000;
|
|
|
|
/// @brief Basic Thing types
|
|
enum class Type {
|
|
Undetermined,
|
|
// Sensor,
|
|
Switch,
|
|
DistanceSensor,
|
|
// Motor,
|
|
ControlledMotor,
|
|
UncontrolledMotor,
|
|
// Other
|
|
ExternalSensor,
|
|
};
|
|
};
|
|
|
|
} // namespace RoboidControl
|
|
} // namespace Passer
|
|
using namespace Passer::RoboidControl; |