Improved max vellocity

This commit is contained in:
Pascal Serrarens 2024-07-02 11:31:36 +02:00
parent edf2df6c7e
commit 4223961fe7

View File

@ -18,7 +18,7 @@ void ServoMotor::SetTargetAngle(float angle) {
this->limitedTargetAngle = angle; this->limitedTargetAngle = angle;
} else if (angle != this->targetAngle) { } else if (angle != this->targetAngle) {
// if the new target is the same, the limited angle is not overwritten // if the new target is the same, the limited angle is not overwritten
this->limitedTargetAngle = this->targetAngle; // this->limitedTargetAngle = this->targetAngle;
} }
this->controlMode = ControlMode::Position; this->controlMode = ControlMode::Position;
@ -26,7 +26,9 @@ void ServoMotor::SetTargetAngle(float angle) {
this->hasTargetAngle = true; this->hasTargetAngle = true;
} }
float ServoMotor::GetTargetAngle() { return this->targetAngle; } float ServoMotor::GetTargetAngle() {
return this->targetAngle;
}
void ServoMotor::SetMaximumVelocity(float maxVelocity) { void ServoMotor::SetMaximumVelocity(float maxVelocity) {
this->maxVelocity = maxVelocity; this->maxVelocity = maxVelocity;
@ -41,7 +43,9 @@ void ServoMotor::SetTargetVelocity(float targetVelocity) {
this->hasTargetAngle = false; // can't we use the controlMode for this? this->hasTargetAngle = false; // can't we use the controlMode for this?
} }
float ServoMotor::GetTargetVelocity() { return this->targetVelocity; } float ServoMotor::GetTargetVelocity() {
return this->targetVelocity;
}
void ServoMotor::Update(unsigned long currentTimeMs) { void ServoMotor::Update(unsigned long currentTimeMs) {
for (unsigned char childIx = 0; childIx < this->childCount; childIx++) { for (unsigned char childIx = 0; childIx < this->childCount; childIx++) {