 //emergency breaking
 bool emergency_breaking = false;
 
+float mapfloat(float x, float in_min, float in_max, float out_min, float out_max)
+{
+ return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
+}
+
 //sets the steering angle between -45, 45 for full left /right respectively. set to zero for straight ahead
 void set_steer_angle(float angle) {
   steering_angle = angle;
+  Serial.print(steering_angle);
   commander.sendBinCmd(cmd_steer,steering_angle);
 
   


//when using the transmitter, map the steering to the TX output
void set_steer_angle_manual(float sp) {
  float map_angle = map(sp, STEER_MIN, STEER_MAX, -45.0, 45.0);
  set_steer_angle(map_angle);
}



//when using the transmitter, map the throttle to the TX output
void set_throttle_position_manual(float sp) {
  float map_throttle = mapfloat(sp, THROTTLE_MIN, THROTTLE_MAX, -100, 100);
  set_throttle_position(map_throttle);
}

