Skip to content

Commit c2ead26

Browse files
committed
mission_item_protocol: fix 'move' on items we have not downloaded
rally clear <click on map> rally add rally move 1 Before this patch that fails to pack the mission_item_int message as we are inserting floating point values into the item_int message x and y fields.
1 parent 653dc94 commit c2ead26

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: MAVProxy/modules/lib/mission_item_protocol.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,12 @@ def cmd_move(self, args):
569569
alt2 = self.module('terrain').ElevationModel.GetElevation(wp.x, wp.y)
570570
if alt1 is not None and alt2 is not None:
571571
wp.z += alt1 - alt2
572-
wp.x = lat
573-
wp.y = lon
572+
if isinstance(wp, pymavlink.dialects.v20.ardupilotmega.MAVLink_mission_item_int_message):
573+
wp.x = int(lat * 1e7)
574+
wp.y = int(lon * 1e7)
575+
else:
576+
wp.x = lat
577+
wp.y = lon
574578

575579
wp.target_system = self.target_system
576580
wp.target_component = self.target_component

0 commit comments

Comments
 (0)