test default value

This commit is contained in:
Cyrille Nofficial 2022-03-29 19:47:22 +02:00
parent 5b5de07311
commit c24e0103e2

View File

@ -30,7 +30,7 @@ func (s *Steering) SetPulse(pulse int) {
func (s *Steering) SetPercentValue(p float32) { func (s *Steering) SetPercentValue(p float32) {
// map absolute angle to angle that vehicle can implement. // map absolute angle to angle that vehicle can implement.
pulse := s.centerPWM pulse := 0
if p > 0 { if p > 0 {
pulse = util.MapRange(float64(p), 0, RightAngle, float64(s.centerPWM), float64(s.rightPWM)) pulse = util.MapRange(float64(p), 0, RightAngle, float64(s.centerPWM), float64(s.rightPWM))
} else if p < 0 { } else if p < 0 {