I start to rewrite our old original VTOL source code by arduplane.
I’m reading source code (arduplane 4.0.5) to learn about tilt rotor vtol.
Function “void QuadPlane::tiltrotor_slew(float newtilt)” in tiltrotor.cpp
controls the tilt angle of rotors.
But I can not find where tilt.current_tilt is set.
Its set in the slew functions, there is one for each type of tilt (line 43 and 145). If you use VS Code you can search the whole folder for ‘tilt.current_tilt’ and see exactly how it is used.
But I have not found any code to initialize’tilt.current_tilt ‘.
Where is’tilt.current_tilt’ initialized?
Iis the initial value of ‘tilt.current_tilt’ 0?
It is initialized on line 442 of quadplane.h, as it is a structure you can just search for current_tilt because it is not initialized with the tilt.current_tilt syntax. It is automatically set to 0