SITL: Yaw rate calculation uses wheel offset

This commit is contained in:
Ebin 2019-09-26 23:44:28 +05:30 committed by Peter Barker
parent e32d8ecda1
commit f6c7ac88d0

View File

@ -25,7 +25,7 @@ namespace SITL {
BalanceBot::BalanceBot(const char *frame_str) :
Aircraft(frame_str),
skid_turn_rate(140) // degrees/sec
skid_turn_rate(0.15708) // meters/sec
{
dcm.from_euler(0,0,0); // initial yaw, pitch and roll in radians
printf("Balance Bot Simulation Started\n");
@ -36,7 +36,8 @@ BalanceBot::BalanceBot(const char *frame_str) :
*/
float BalanceBot::calc_yaw_rate(float steering)
{
return steering * skid_turn_rate;
float wheel_base_length = 0.15f;
return steering * degrees( skid_turn_rate/wheel_base_length );
}