fractional turns for loiter

I would like to be able to define degrees of the loiter. For example when i set param1 (turns) 0.5f ( 180°) should fly only half of the circle. I know param1 should be integer, can we make it into fractional turns to make incomplete circles (For example 180 for half of the circle) ?

Pull requests are welcome

I see some ways of doing this without any changes, with varying degrees of accuracy and complexity

  1. use telemetry (FrSky or telem radios) to the transmitter (or GCS) so you can yaw to desired heading, reasonably accurate. You are using OpenTX right? Isnt everybody :slight_smile:
  2. set CIRCLE_RADIUS 0 (rotates on the spot) and CIRCLE_RATE 45 (45 degrees per second) and put Circle Mode on a switch - flip the switch for 4 seconds and copter should rotate near enough to 180deg
  3. set a switch and channel for scripting, run a LUA script
    https://ardupilot.org/copter/docs/common-lua-scripts.html
    Similar to this example (vertical circle)
    https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_Scripting/examples/copter-fly-vertical-circle.lua

EDIT: that scripting example only works in 4.1 where there are more bindings