Skip to content

Commit

Permalink
Sub: Do not report altitude in GLOBAL_POSITION_INT if there is no depth
Browse files Browse the repository at this point in the history
sensor connected

Fix bluerobotics/ardusub#145
  • Loading branch information
jaxxzer committed Apr 19, 2018
1 parent 0878f50 commit c76ff32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ArduSub/GCS_Mavlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ void NOINLINE Sub::send_location(mavlink_channel_t chan)
now,
current_loc.lat, // in 1E7 degrees
current_loc.lng, // in 1E7 degrees
(ahrs.get_home().alt + current_loc.alt) * 10UL, // millimeters above sea level
current_loc.alt * 10, // millimeters above ground
ap.depth_sensor_present ? (ahrs.get_home().alt + current_loc.alt) * 10UL : 0, // millimeters above sea level
ap.depth_sensor_present ? current_loc.alt * 10 : 0, // millimeters above ground
vel.x * 100, // X speed cm/s (+ve North)
vel.y * 100, // Y speed cm/s (+ve East)
vel.z * 100, // Z speed cm/s (+ve Down)
Expand Down

0 comments on commit c76ff32

Please sign in to comment.