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