AirSim icon indicating copy to clipboard operation
AirSim copied to clipboard

Hexacopter Setup in Docs and MultiRotorParams seems a little off

Open benasena opened this issue 8 years ago • 6 comments

@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

benasena avatar Apr 07 '18 03:04 benasena

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.)

benasena avatar Apr 09 '18 10:04 benasena

@lovettchris might be interested in this.

sytelus avatar Apr 09 '18 20:04 sytelus

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.

benasena avatar Sep 01 '18 10:09 benasena

I have some fixes and a demo video in this pull request: https://github.com/Microsoft/AirSim/pull/1890

lovettchris avatar Apr 16 '19 09:04 lovettchris

@lovettchris is it possible to run the Hexacopter in a SITL mode or it is only supported for HIL

manthan99 avatar May 22 '20 06:05 manthan99

Issue solved. Doc update pending

jonyMarino avatar Oct 19 '20 17:10 jonyMarino