Added actual angle

This commit is contained in:
Pascal Serrarens 2024-08-30 16:28:15 +02:00
parent 25cb1e1822
commit 0779554313
3 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,6 @@
#include "NetworkSync.h" #include "NetworkSync.h"
#define RC_DEBUG 1 // #define RC_DEBUG 1
#ifdef RC_DEBUG #ifdef RC_DEBUG
#include <Arduino.h> #include <Arduino.h>

View File

@ -97,4 +97,8 @@ void ServoMotor::Update(unsigned long currentTimeMs) {
this->lastUpdateTimeMs = currentTimeMs; this->lastUpdateTimeMs = currentTimeMs;
} }
} }
void ServoMotor::SetAngle(Angle16 angle) {
this->actualAngle = angle;
};

View File

@ -32,6 +32,7 @@ class ServoMotor : public Thing {
protected: protected:
bool hasTargetAngle = false; bool hasTargetAngle = false;
Angle16 targetAngle = 0.0F; Angle16 targetAngle = 0.0F;
Angle16 actualAngle = 0.0F;
float maxVelocity = 0.0F; float maxVelocity = 0.0F;
@ -40,7 +41,7 @@ class ServoMotor : public Thing {
float lastUpdateTimeMs = 0.0F; float lastUpdateTimeMs = 0.0F;
virtual void SetAngle(Angle16 angle) {}; virtual void SetAngle(Angle16 angle);
}; };
} // namespace RoboidContol } // namespace RoboidContol