AP_Mount: fix scripting backend#32382
Conversation
|
Robert and I discussed this at length on a call. Hope to discuss this at DevCallEU. |
801cd83 to
ceb7523
Compare
|
I have reworked this slightly from my previous method. Before, I was using I've also made scripting backends default to I've also added an autotest. |
If a backend gets the target mode converted to angle, get_angle_target will return the converted angles. This fixes scripting backends that relied on get_angle_target
ceb7523 to
37036b3
Compare
|
@peterbarker will review this one |
I've provided an alternative to this in a branch to @robertlong13 - where we don't have to munge the library structure to satisfy scripting.... |
|
We've merged PR #32626 so I think it's OK to close this one. Thanks very much for addressing this 4.7 issue! |
Summary
This fixes a 4.7 regression. Scripting backend gimbals don't respond to anything but angle commands.
Testing (more checks increases chance of being merged)
Description
Scripting backends, like mount-djirs2-driver.lua, differ from the others in that they can't have their target angles pushed to them. They rely on hitting up
get_angle_targetto know what to do, andget_angle_targetreturns nil unless we're in angle mode. The fix is to haveget_angle_targetwork if we are either in angle mode, or we have converted to an angle target for a gimbal; either case means there's a valid angle target that we can return.The only other caller of this getter is logging, and I think this is an improvement there too.
Tested against my RealFlight gimbal backend #27752