Skip to content

Commit

Permalink
mavproxy.py: add 'click show' to print current click position
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker authored and tridge committed Sep 28, 2023
1 parent 4a0fe54 commit 17899c2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion MAVProxy/mavproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,11 +522,18 @@ def cmd_reset(args):

def cmd_click(args):
'''synthesise click at lat/lon; no arguments is "unclick"'''
usage = "click <show|LAT_EXPRESSION LNG_EXPRESSION>"
if len(args) == 0:
mpstate.click(None)
return
if len(args) < 1:
print(usage)
return
if args[0] == "show":
print("%f %f" % mpstate.click_location)
return
if len(args) < 2:
print("click LAT_EXPRESSION LNG_EXPRESSION")
print(usage)
return
lat = mavutil.evaluate_expression(args[0], mpstate.master().messages)
lng = mavutil.evaluate_expression(args[1], mpstate.master().messages)
Expand Down

0 comments on commit 17899c2

Please sign in to comment.