24 lines
429 B
C++
24 lines
429 B
C++
#pragma once
|
|
|
|
class Motormixer
|
|
{
|
|
public:
|
|
struct Output
|
|
{
|
|
float leftMotor;
|
|
float rightMotor;
|
|
};
|
|
|
|
//! @param throttle in [-1, 1]
|
|
//! @param steering in [-1, 1]
|
|
Output calculate(float throttle, float steering);
|
|
|
|
void setOutputScale(float scale);
|
|
void setDeadzone(float deadzone);
|
|
|
|
Motormixer() = default;
|
|
|
|
private:
|
|
float m_outputScale = 1.0;
|
|
float m_deadzone = 0.1;
|
|
}; |