Skip to content

Commit

Permalink
send signal_quality via mavlink
Browse files Browse the repository at this point in the history
  • Loading branch information
Williangalvani committed Sep 21, 2023
1 parent 7bb1bb5 commit fa447d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dvl-a50/dvl.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def handle_velocity(self, data: Dict[str, Any]) -> None:
return

if self.rangefinder and alt > 0.05:
self.mav.send_rangefinder(alt)
self.mav.send_rangefinder(alt, confidence)

if self.should_send == MessageType.POSITION_DELTA:
dRoll, dPitch, dYaw = [
Expand Down
10 changes: 5 additions & 5 deletions dvl-a50/mavlink2resthelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def __init__(self, vehicle: int = 1, component: int = 1):
0.0,
0.0
],
"signal_quality": 0
"signal_quality": {1}
}}
}}
"""
Expand Down Expand Up @@ -352,12 +352,12 @@ def send_vision_position_estimate(
)
logger.info(post(MAVLINK2REST_URL + "/mavlink", data=data))

def send_rangefinder(self, distance: float):
def send_rangefinder(self, distance: float, quality: float):
"Sends message DISTANCE_SENSOR to flight controller"
if distance == -1:
return
data = self.rangefinder_template.format(int(distance * 100))

data = self.rangefinder_template.format(0, 0)
else:
data = self.rangefinder_template.format(int(distance * 100), int(quality))
post(MAVLINK2REST_URL + "/mavlink", data=data)

def set_gps_origin(self, lat, lon):
Expand Down

0 comments on commit fa447d9

Please sign in to comment.