Hi, good news is that I am able to use the mount:set_roi_target() and the gimbal points to the location accurately.
However, when the drone yaws, the gimbal also yaws along with the drone, and when the drone stops yawing, the gimbal again points to the roi. Basically, during the vehicle yaw, the gimbal cannot keep its focus on the roi coordinate.
here is the video of the same: Mount ROI Tests - Google Drive
And this is the test script I used in the above video:
local PARAM_TABLE_KEY = 82
assert(param:add_table(PARAM_TABLE_KEY, "GIMBAL_", 1), 'could not add param table')
assert(param:add_param(PARAM_TABLE_KEY, 1, "TARGET", 0), 'could not add the param')
function loop()
TARGET_POI = param:get('GIMBAL_TARGET')
if TARGET_POI == 1.0 then
gcs:send_text(7, string.format("Gimbal Target: %f", TARGET_POI))
target = ahrs:get_location()
target:lat(19.xxxxxxx*1e7)
target:lng(73.xxxxxxx*1e7)
target:alt(0)
mount:set_roi_target(0, target)
elseif TARGET_POI == 2.0 then
gcs:send_text(7, string.format("Gimbal Target: %f", TARGET_POI))
target = ahrs:get_location()
target:lat(19.xxxxxxx*1e7)
target:lng(73.xxxxxxx*1e7)
target:alt(0)
mount:set_roi_target(0, target)
end
return loop, 500
end
return loop()
Any suggestions on how to make the gimbal track the roi continuously even when the vehicle orientation changes.