hello there.
I’m reading the code base and learning from it. i just realized that the Plane::roll_limit_cd
variable is always being set in function Plane::ahrs_update
with the highest priority, and with quadPlane mode disabled, it will be set to
roll_limit_cd = aparm.roll_limit*100*ahrs.cos_pitch();
but i just realized that it will also being changed in the function Plane::update_load_factor
(in Plane/Attitude.cpp
file). the function is called whenever the nav_roll_cd
is calculated, so it will constrain the navigation roll in some cases. i understand that update_load_factor
is crucial, but after limiting nav_roll_cd
it will change Plane::roll_limit_cd
and according to my understanding of the code base, the high priority of ahrs_update
will ignore it and always when Plane::calc_nav_roll()
is called, the roll_limit_cd
that is calculated inside ahrs_update
will be applied.
why is that? is there some thing that I’m missing?