Vector, Quaternion - математика для ориентации. AdaptivePID - ПИД-регулятор. DroneOrientation.CalcAttitude() - цикл вычисления положения.
This commit is contained in:
45
DroneClient/utils/RC.cs
Normal file
45
DroneClient/utils/RC.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DroneClient.utils
|
||||
{
|
||||
internal class RC
|
||||
{
|
||||
private Vector control = new();
|
||||
private float throttle = 0;
|
||||
|
||||
public void SetControl(float roll, float pitch, float yaw)
|
||||
{
|
||||
control.X = roll;
|
||||
control.Y = pitch;
|
||||
control.Z = yaw;
|
||||
}
|
||||
|
||||
public void SetRoll(float roll)
|
||||
{
|
||||
control.X = roll;
|
||||
}
|
||||
|
||||
public void SetPitch(float pitch)
|
||||
{
|
||||
control.Y = pitch;
|
||||
}
|
||||
|
||||
public void SetYaw(float yaw)
|
||||
{
|
||||
control.Z = yaw;
|
||||
}
|
||||
|
||||
public void SetThrottle(float throttle)
|
||||
{
|
||||
this.throttle = throttle;
|
||||
}
|
||||
|
||||
public Vector GetControl() { return control; }
|
||||
|
||||
public float GetThrottle() { return throttle; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user