Setters for verlocity and angular velocity
This commit is contained in:
parent
a6d1b0c945
commit
dd7b6225d9
@ -41,3 +41,17 @@ void Propulsion::SetTwistSpeed(Vector3 linear, float yaw, float pitch,
|
|||||||
float roll) {}
|
float roll) {}
|
||||||
|
|
||||||
Polar Propulsion::GetVelocity() { return Polar(0, 0); }
|
Polar Propulsion::GetVelocity() { return Polar(0, 0); }
|
||||||
|
|
||||||
|
float Propulsion::GetAngularVelocity() { return 0; }
|
||||||
|
|
||||||
|
Vector3 Propulsion::GetPosition() { return this->worldPosition; }
|
||||||
|
|
||||||
|
Quaternion Propulsion::GetOrientation() { return Quaternion::identity; }
|
||||||
|
|
||||||
|
void Propulsion::SetPosition(Vector3 worldPosition) {
|
||||||
|
this->worldPosition = worldPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Propulsion::SetOrientation(Quaternion worldOrientation) {
|
||||||
|
this->worldOrientation = worldOrientation;
|
||||||
|
}
|
11
Propulsion.h
11
Propulsion.h
@ -3,6 +3,7 @@
|
|||||||
#include "Motor.h"
|
#include "Motor.h"
|
||||||
#include "Placement.h"
|
#include "Placement.h"
|
||||||
#include "Polar.h"
|
#include "Polar.h"
|
||||||
|
#include "Quaternion.h"
|
||||||
#include "Vector2.h"
|
#include "Vector2.h"
|
||||||
|
|
||||||
namespace Passer {
|
namespace Passer {
|
||||||
@ -61,12 +62,22 @@ public:
|
|||||||
float pitch = 0.0F, float roll = 0.0F);
|
float pitch = 0.0F, float roll = 0.0F);
|
||||||
|
|
||||||
virtual Polar GetVelocity();
|
virtual Polar GetVelocity();
|
||||||
|
virtual float GetAngularVelocity();
|
||||||
|
|
||||||
|
virtual Vector3 GetPosition();
|
||||||
|
virtual Quaternion GetOrientation();
|
||||||
|
|
||||||
|
virtual void SetPosition(Vector3 worldPosition);
|
||||||
|
virtual void SetOrientation(Quaternion worldOrientation);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// @brief The number of motors used for Propulsion
|
/// @brief The number of motors used for Propulsion
|
||||||
unsigned int motorCount = 0;
|
unsigned int motorCount = 0;
|
||||||
/// @brief The Placement of the motors used for Propulsion
|
/// @brief The Placement of the motors used for Propulsion
|
||||||
Placement *placement = nullptr;
|
Placement *placement = nullptr;
|
||||||
|
|
||||||
|
Vector3 worldPosition = Vector3::zero;
|
||||||
|
Quaternion worldOrientation = Quaternion::identity;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace RoboidControl
|
} // namespace RoboidControl
|
||||||
|
Loading…
x
Reference in New Issue
Block a user