Updated documentation
This commit is contained in:
parent
2d94f61c83
commit
fc246c8f1c
@ -7,6 +7,7 @@ namespace Passer {
|
||||
namespace RoboidControl {
|
||||
|
||||
/// @brief Activation function for control
|
||||
/// @note This is mainly for future use :-)
|
||||
class Activation {
|
||||
public:
|
||||
static float HeavisideStep(float inputValue, float bias = 0); // Range: {0,1}
|
||||
@ -17,13 +18,10 @@ class Activation {
|
||||
|
||||
static float Linear(float inputValue, float bias = 0, float range = 0);
|
||||
|
||||
static float Quadratic(float inputValue,
|
||||
float bias = 0,
|
||||
static float Quadratic(float inputValue, float bias = 0,
|
||||
float range = 0); // minValue = bias
|
||||
|
||||
static float ParticleLife(float minValue,
|
||||
float maxValue,
|
||||
float attraction,
|
||||
static float ParticleLife(float minValue, float maxValue, float attraction,
|
||||
float inputValue); // minValue = bias
|
||||
};
|
||||
|
||||
|
@ -43,7 +43,7 @@ include_directories(
|
||||
add_library(RoboidControl STATIC
|
||||
"Roboid.cpp"
|
||||
"Perception.cpp"
|
||||
"PerceivedObject.cpp"
|
||||
"TrackedObject.cpp"
|
||||
"Propulsion.cpp"
|
||||
"Motor.cpp"
|
||||
"DifferentialDrive.cpp"
|
||||
@ -52,6 +52,7 @@ add_library(RoboidControl STATIC
|
||||
"Sensor.cpp"
|
||||
"Switch.cpp"
|
||||
"Thing.cpp"
|
||||
"Quadcopter.cpp"
|
||||
)
|
||||
|
||||
enable_testing()
|
||||
|
@ -54,7 +54,22 @@ public:
|
||||
/// forward, float yaw) function.
|
||||
virtual void SetTwistSpeed(Vector3 linear, float yaw = 0.0F,
|
||||
float pitch = 0.0F, float roll = 0.0F);
|
||||
|
||||
/// @brief Calculate the linear velocity of the roboid based on the wheel
|
||||
/// velocities
|
||||
/// @return The velocity of the roboid in local space
|
||||
/// @details The actual values may not be accurate, depending on the available
|
||||
/// information
|
||||
/// @remark This will be more expanded/detailed in a future version of Roboid
|
||||
/// Control
|
||||
virtual Polar GetVelocity() override;
|
||||
/// @brief Calculate the angular velocity of the roboid based on the wheel
|
||||
/// velocities
|
||||
/// @return The angular speed of the roboid in local space
|
||||
/// @details The actual value may not be accurate, depending on the available
|
||||
/// information
|
||||
/// @remark This will be more expanded/detailed in a future version of Roboid
|
||||
/// Control
|
||||
virtual float GetAngularVelocity() override;
|
||||
};
|
||||
|
||||
|
11
Placement.h
11
Placement.h
@ -8,7 +8,7 @@ namespace Passer {
|
||||
namespace RoboidControl {
|
||||
|
||||
/// @brief A plament is used to specify where a Thing is placed on the Roboid.
|
||||
///
|
||||
/// @details
|
||||
/// It is not always necessary to exactly specify the position and orientation
|
||||
/// of a Thing. You can use a simple constructor in that case:
|
||||
///
|
||||
@ -44,18 +44,15 @@ class Placement {
|
||||
/// Negative angles are to the left.
|
||||
/// @param verticalAngle The vertical direction angle of the Thing. Negative
|
||||
/// angles are downward.
|
||||
Placement(Thing* thing,
|
||||
Vector3 position = Vector3::zero,
|
||||
float horizontalDirection = 0.0F,
|
||||
float verticalAngle = 0.0F);
|
||||
Placement(Thing *thing, Vector3 position = Vector3::zero,
|
||||
float horizontalDirection = 0.0F, float verticalAngle = 0.0F);
|
||||
/// @brief Placement of a Thing on a Roboid without position
|
||||
/// @param thing The Thing which is place
|
||||
/// @param horizontalDirection The horizontal direction angle of the Thing.
|
||||
/// Negative angles are to the left.
|
||||
/// @param verticalDirection The vertical direction angle of the Thing.
|
||||
/// Negative angles are downward.
|
||||
Placement(Thing* thing,
|
||||
float horizontalDirection,
|
||||
Placement(Thing *thing, float horizontalDirection,
|
||||
float verticalDirection = 0.0F);
|
||||
/// @brief Default constructor with a zero placement
|
||||
Placement();
|
||||
|
10
Propulsion.h
10
Propulsion.h
@ -13,10 +13,9 @@ class Roboid;
|
||||
|
||||
/// @brief The Propulsion module for a Roboid is used to move the Roboid in
|
||||
/// space
|
||||
///
|
||||
/// Usually, a specific implementation of the propulsion module is used for a
|
||||
/// robot. This base class does not implement the functions to move the Roboid
|
||||
/// around.
|
||||
/// @details Usually, a specific implementation of the propulsion module is used
|
||||
/// for a robot. This base class does not implement the functions to move the
|
||||
/// Roboid around.
|
||||
class Propulsion {
|
||||
public:
|
||||
/// @brief Default Constructor for Propulsion
|
||||
@ -40,8 +39,6 @@ public:
|
||||
/// index could be found
|
||||
Placement *GetMotorPlacement(unsigned int motorIx);
|
||||
|
||||
// Velocity control
|
||||
|
||||
/// @brief Sets the forward and rotation speed of a (grounded) Roboid
|
||||
/// @param forward The target forward speed
|
||||
/// @param yaw The target rotation speed around the vertical axis
|
||||
@ -72,6 +69,7 @@ public:
|
||||
/// The actual unit of the angular velocity depend on the implementation
|
||||
virtual float GetAngularVelocity();
|
||||
|
||||
/// @brief The roboid of this propulsion system
|
||||
Roboid *roboid = nullptr;
|
||||
|
||||
protected:
|
||||
|
@ -8,6 +8,7 @@ namespace Passer {
|
||||
namespace RoboidControl {
|
||||
|
||||
/// @brief Support for Quadcopter as a propulsion method
|
||||
/// @note This is work in progress
|
||||
class Quadcopter : public Propulsion {
|
||||
public:
|
||||
/// @brief Default constuctor
|
||||
@ -15,10 +16,8 @@ class Quadcopter : public Propulsion {
|
||||
|
||||
virtual void SetTwistSpeed(float forward, float yaw = 0.0F) override;
|
||||
virtual void SetTwistSpeed(Vector2 linear, float yaw = 0.0F) override;
|
||||
virtual void SetTwistSpeed(Vector3 linear,
|
||||
float yaw = 0.0F,
|
||||
float pitch = 0.0F,
|
||||
float roll = 0.0F) override;
|
||||
virtual void SetTwistSpeed(Vector3 linear, float yaw = 0.0F,
|
||||
float pitch = 0.0F, float roll = 0.0F) override;
|
||||
|
||||
Vector3 GetTargetVelocity();
|
||||
float GetYawSpeed();
|
||||
|
25
Roboid.h
25
Roboid.h
@ -33,41 +33,42 @@ public:
|
||||
|
||||
/// @brief Retrieve the current position of the roboid
|
||||
/// @return The position in carthesian coordinates in world space
|
||||
/// The origin and units of the position depends on the position tracking
|
||||
/// system used. This value will be Vector3::zero unless a position is
|
||||
/// received through network synchronisation
|
||||
/// @details The origin and units of the position depends on the position
|
||||
/// tracking system used. This value will be Vector3::zero unless a position
|
||||
/// is received through network synchronisation
|
||||
virtual Vector3 GetPosition();
|
||||
/// @brief Retrieve the current orientation of the roboid
|
||||
/// @return The orientation quaternion in world space
|
||||
/// The origin orientation depends on the position tracking system used. This
|
||||
/// value will be Quaternion::identity unless an orientation is received
|
||||
/// though network synchronization
|
||||
/// @details The origin orientation depends on the position tracking system
|
||||
/// used. This value will be Quaternion::identity unless an orientation is
|
||||
/// received though network synchronization
|
||||
virtual Quaternion GetOrientation();
|
||||
|
||||
/// @brief Update the current position of the roboid
|
||||
/// @param worldPosition The position of the roboid in carthesian coordinates
|
||||
/// in world space The use of this function will also update the positions and
|
||||
/// in world space
|
||||
/// @details The use of this function will also update the positions and
|
||||
/// orientations of the perceived objects by the roboid
|
||||
/// (roboid->perception->perceivedObjects), as these are local to the
|
||||
/// roboid's position.
|
||||
virtual void SetPosition(Vector3 worldPosition);
|
||||
/// @brief Update the current orientation of the roboid
|
||||
/// @param worldOrientation The orientation of the roboid in world space
|
||||
/// The use of this function will also update the orientations of the
|
||||
/// @details The use of this function will also update the orientations of the
|
||||
/// perceived objects by the roboid (roboid->perception->perceivedObjets),
|
||||
/// as these are local to the roboid' orientation.
|
||||
virtual void SetOrientation(Quaternion worldOrientation);
|
||||
|
||||
private:
|
||||
/// @brief The position of the roboid in carthesian coordinates in world space
|
||||
/// This position may be set when NetworkSync is used to receive
|
||||
/// @details This position may be set when NetworkSync is used to receive
|
||||
/// positions from an external tracking system. These values should not be set
|
||||
/// directly, but SetPosition should be used instead.
|
||||
Vector3 worldPosition = Vector3::zero;
|
||||
/// @brief The orientation of the roboid in world space
|
||||
/// The position may be set when NetworkSync is used to receive orientations
|
||||
/// from an external tracking system. This value should not be set directly,
|
||||
/// but SetOrientation should be used instead.
|
||||
/// @details The position may be set when NetworkSync is used to receive
|
||||
/// orientations from an external tracking system. This value should not be
|
||||
/// set directly, but SetOrientation should be used instead.
|
||||
Quaternion worldOrientation = Quaternion::identity;
|
||||
};
|
||||
|
||||
|
2
Switch.h
2
Switch.h
@ -11,6 +11,8 @@ class Switch : public Sensor {
|
||||
/// @brief Default constructor
|
||||
Switch();
|
||||
|
||||
/// @brief Test of the switch is on
|
||||
/// @return true when the switch returns a HIGH value
|
||||
virtual bool IsOn();
|
||||
};
|
||||
|
||||
|
5
Thing.h
5
Thing.h
@ -12,10 +12,15 @@ public:
|
||||
/// @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
|
||||
|
Loading…
x
Reference in New Issue
Block a user