Hexacopter Setup in Docs and MultiRotorParams seems a little off
@lovettchris, I noticed that the generation of hexacopter motors in MultiRotorParams and the corresponding documentation might be a bit off. If I'm reading this correctly, the quaternions rotate the arm vectors always CCW by 30 degrees (pi/6), so motors 4 and 5 (zero-indexed) are 30 degrees off the East axis instead of 60 like I remember hexagons looking like.
I defined two different quaternions to solve this and keep the syntax the same: Quaternionr hexax_rot_30(AngleAxisr(M_PIf / 6, unit_z)); Quaternionr hexax_rot_60(AngleAxisr(M_PIf / 3, unit_z));
Do let me know if I'm completely off-base somehow.
https://github.com/Microsoft/AirSim/wiki/hexacopter https://github.com/Microsoft/AirSim/blob/master/AirLib/include/vehicles/multirotor/MultiRotorParams.hpp
I also noticed that FlyingPawn.h hard-codes rotor count as 4. Not sure if this modification or another workaround was forgotten in the write-up or if something about the implementation changed in the meantime, but it was necessary for me to update rotor_count = 6 to get the extra two props to animate.
https://github.com/Microsoft/AirSim/blob/master/Unreal/Plugins/AirSim/Source/Multirotor/FlyingPawn.h
(I also noticed you can change the direction of the RotationN variables in the Unreal blueprints by setting Plane Constraint Normal Z to -1, in case anyone else is as fussy as me.)
@lovettchris might be interested in this.
Should I go ahead and push a fix since he hasn't replied, at least for the first issue? The result is that the front right and back left motors are rotated 30 degrees clockwise from where they should be, which will affect the physics by giving yaw->pitch/roll and roll<->pitch coupling.
I have some fixes and a demo video in this pull request: https://github.com/Microsoft/AirSim/pull/1890
@lovettchris is it possible to run the Hexacopter in a SITL mode or it is only supported for HIL
Issue solved. Doc update pending