Skip to content

Commit 124ebed

Browse files
IamPete1peterbarker
authored andcommitted
AP_Scripting: fix language check issues
1 parent ca79133 commit 124ebed

4 files changed

Lines changed: 11 additions & 2 deletions

File tree

libraries/AP_Scripting/applets/net-ntrip.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ local function process_rtcm_buffer()
9999
if send_debug_msg_count then
100100
local message_type = (rtcm_buffer:byte(4) << 4) | (rtcm_buffer:byte(5) >> 4)
101101
msg_count[message_type] = (msg_count[message_type] or 0) + 1
102-
gcs:send_named_float(message_type, msg_count[message_type])
102+
gcs:send_named_float(tostring(message_type), msg_count[message_type])
103103
end
104104

105105
local complete_message = rtcm_buffer:sub(1, total_length)

libraries/AP_Scripting/applets/quadplane_terrain_avoid.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,11 @@ while (distance > 0) {
960960
-------------------------------------------------------------------------------
961961
-- Lookahead functions - replaces the c++ functions in AP_Terrain
962962
-------------------------------------------------------------------------------
963+
---@param start_location Location_ud
964+
---@param search_bearing number
965+
---@param search_distance number
966+
---@param search_ratio number
967+
---@return Location_ud|nil
963968
function Terrain_Lookahead(start_location, search_bearing, search_distance, search_ratio)
964969
local highest_location = nil
965970
local climb = 0.0

libraries/AP_Scripting/examples/plane-wind-fs.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ value = param:get('RTL_RADIUS')
6464
if value then
6565
value = math.abs(value)
6666
if value > 0 then
67-
home_reached_rad = math.abs(value) * 2
67+
home_reached_rad = value * 2
6868
else
6969
value = param:get('WP_LOITER_RAD')
7070
if value then

libraries/AP_Scripting/examples/rover-motor-driver.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ function update()
2929
if throttle < 0 then
3030
steering = -steering
3131
end
32+
33+
-- Language checker thinks steering could be nil, reassure it that it cannot
34+
---@cast steering number
35+
3236
SRV_Channels:set_output_norm(K_SCRIPTING1, steering)
3337
SRV_Channels:set_output_norm(K_SCRIPTING3, throttle)
3438
end

0 commit comments

Comments
 (0)