And of course we needed to do that a bit lower
The blip at the end we understand, and will be fixed as the navigation improvesā¦
And of course we needed to do that a bit lower
The blip at the end we understand, and will be fixed as the navigation improvesā¦
Environment, Edit Airport, In the properties info you will find 'Panoramic Image Facing (deg).
Ah, thatās where I had seen it before. Iām trying to rotate the runway in a 3D airport to match the heading of the one at my field, but canāt find a way to do that.
I did my first autotune on the AcroMaster today and tested my OpenTX setup for separate manual mode trims and expo (donāt want to bail to manual with 100% throw and no expo on this plane!). But no aerobatic scripts since my FC now refuses to boot with master or the new PR.
Workaround: force IOMCU reflash by booting with safety button pressed
Thanks @tridge - here is a single roll rolling circle with the new altitude + speed controller, as well as defined number of rolls (here one) + roll and circle direction
oh goody goody GOODY!
looking promising.
just out of curiosity, what will happen on a loop that has the throttle setting too low causing the plane to stall on the way up?
Currently there are no sanity checks, performance checks or how is the maneuver progressing type checks. Manual mode is your friend in this situation. But of course it is early days with this developmentā¦ Stall recognition and recover are all possible I guess - and would be useful well outside the aerobatic scope
roger on all that, andy. i was just wondering what would happen in the current mode.
Currently, if the model is stable and āmushesā, it will hold full up elevator trying to achieve a demanded pitch rate until the script times out - then will (may) hopefully recover to continue the mission. If the model stalls and happens to then hit a positive deck angle (unlikely), it may think the loop is finished, and continue on the mission. But more than likely things are going to end badly unless you change to manual modeā¦ Once the plane stalls, there is no recovery except manual modeā¦
The possibility to control flight maneuvers via LUA Script fascinates me among other things because of the various possibilities. Thanks to @tridge , @andyp and the others who helped make this brilliant idea a reality.
After the yaw rate controller for the ACRO mode was implemented and Tridge presented the Lua script, it was also time for me to dare with a real airplane.
The aircraft used is a Durafly Avios Grand Tundra, as it is both good-natured and sufficiently (knife-edge) aerobatic. The STOL characteristics are impressive by the way.
Hi Rolf
Thatās awesome! We are working on a better aerobatic implementationā¦ it will take some time, but exciting things to come!
Andrew
In the meantime I have extended the demonstration flight and condensed it a bit:
https://vimeo.com/726520355
(For the rolling circle, note that the input parameters arg1/2 mean the rotation rate at which the circle is flown through (arg1) and the roll rate (arg2), respectively, and not the circle radius or number of rolls.)
Slightly off topic, so Iāll keep this to a single post, but lest us Rover guys get left outā¦
I looked at the scripted aerobatics code for a loop, modified it for lateral nav, and put this quick little test together. For ease of triggering in SITL, I just poll for a switch to LOITER mode and then it does a counterclockwise circle before switching back to the previous mode. I could just as easily implement with NAV_SCRIPT_TIME but wanted an easy way to trigger on demand.
I think this guided mode capability can be leveraged for things like custom obstacle avoidance or complex path planning where straight line nav falls short. Thanks to all here who helped pioneer the bindings and examples!
local RUN_INTERVAL_MS = 100
local ROVER_MODE_GUIDED = 15
local ROVER_MODE_LOITER = 5
local circle_angle = 0
local circle_angle_increment = 1 -- increment the target angle by 1 deg every 0.1 sec (i.e. 10deg/sec)
local circle_speed = 1 -- velocity is always 1m/s
local last_mode = vehicle:get_mode()
function do_circle()
local mode = vehicle:get_mode()
if mode == ROVER_MODE_LOITER then
circle_angle = 0
vehicle:set_mode(ROVER_MODE_GUIDED)
end
if mode ~= ROVER_MODE_GUIDED then
if mode ~= ROVER_MODE_LOITER then
last_mode = mode
end
return do_circle, RUN_INTERVAL_MS
end
-- calculate velocity vector
circle_angle = circle_angle + circle_angle_increment
if (circle_angle >= 360) then
vehicle:set_mode(last_mode)
return do_circle, RUN_INTERVAL_MS
end
local target_vel = Vector3f()
target_vel:x(math.sin(math.rad(circle_angle)) * circle_speed)
target_vel:y(math.cos(math.rad(circle_angle)) * circle_speed)
target_vel:z(0)
-- send velocity request
if not (vehicle:set_target_velocity_NED(target_vel)) then
gcs:send_text(0, "failed to execute velocity command")
end
return do_circle, RUN_INTERVAL_MS
end
return do_circle()
weāve made a lot more progress, and can now put entire aerobatic schedules on a switch or in a mission
demo here:
some docs here:
https://github.com/ArduPilot/ardupilot/tree/master/libraries/AP_Scripting/examples/Aerobatics/Trajectory
I flew the same schedule on a Flex Innovations Yak55 today:
Overall it did well, but didnāt maintain height in the rolling circle
Incredible and absolutely ingenious.
A thousand thanks to Tridge and all those involved. Even the non-trajectory version seemed to be a miracle of technology for some of my pilot friends at the airfield. One of them suspected during the rolling circle, when I held the transmitter aside, that he had become a Candid Camera victim and the actual pilot was hidden behind a bush.
Now I want to exchange the old aerobatic script in my tundra against this new one. The parameters of most maneuvers are clear to me. I want to take the radii from the logfiles of the previous flights.
But two understanding questions I have before planning a mission:
What is the difference between maneuver 15 = Immelman Turn and 6 = Immelmann (FastRoll) . I guess the roll at no.15 is flown slower ?
No.19, Stall turn. I suppose it is the maneuver also called Hammerhead Turn. āRadiusā and āHeightā make sense as to what it means. But what does the parameter 3 " direction" mean in this context.
Does an airspeed sensor make sense or not ?
Rolf
Hi Rolf
The trajectory stuff really is amazing!!
#15 - the exit roll rate is based on the manouver radius - the bigger the radius, the slower the roll rate - so scales for different aircraft. #6 always does a fast roll regardless of set radiusā¦
The stall turn is experimental - we are still working on how to achieve a stall turn, snap roll and spin. Also still working on a barrel roll. I would suggest not using the stall turn at the moment. This stuff is ābleeding edgeā
Test in SITL and enjoy! More pre-made schedules to come!
Andrew (with huge thanks to Tridge, Matthew Hampsey, Paul Riseborough and Henry Wurzburg)
Thatās an interesting idea. I have been thinking about the crossover with Object Avoidance too. Not sure what to do with it thought. Would it mean having to move OA into Lua out off c++? Interesting idea perhaps but also a lot of work ā¦
Alternatively - might there be some way for OA (in c++) to trigger Lua script navigation?
It doesnāt mean OA has to move strictly to Lua. A script could work in conjunction with existing OA.
I already have a prototype script that neatly circumvents geofences, which avoids some of the less desirable effects of the existing path planning algorithms (specifically, existing BR and Dijkstra end up skipping more of the preplanned path than is desirable when mowing with a Rover).
Iām not comfortable releasing that script to the masses just yet, as it takes very direct control that could result in bad behavior, and Iād like to mitigate the associated risk(s) a bit better before submitting it as an example or for use at large.
Which plotter is this for planned vs actual trajectory? Looks quite handy.