Hi,
I am just starting with Lua scripts, and I wonder whether there is a way of displaying some info on OSD screen through some Lua command? I was not able to find an answer.
I am looking for something like print at X,Y, textZ.
For instance, in the following script, instead of sending message to GCS, I would like to display the message on OSD, is there a way of doing it?
In OSD, there is “MESSAGE” field, but I believe it does not reflect the message sent to GCS, or I amm wrong?
function update ()
local roll=ahrs:get_roll()
local rolldeg=math.deg (roll)
local ch12=rc:get_pwm(12)
local ch11=rc:get_pwm(11)
ch12L=0
if (ch12<1400)
then
ch12L=-1
end
if (ch12>1600)
then
ch12L=1
end
Pk=0
if (prevch12L~=ch12L)
then
Pk=ch12L
gcs:send_text(2, Pk)
local Roll_P= param:get('ATC_RAT_RLL_P')
Roll_P=Roll_P+Pk*0.01
gcs:send_text(2, Roll_P)
param:set_and_save ('ATC_RAT_RLL_P',Roll_P)
end
prevch12L=ch12L
return update, 10
end
return update()