-
I have two ZED-F9P's set up in a moving base configuration, I am now trying to interface with the rover programatically in order to perform long term logging. Everything seems to work fine and I am able to parse the NAV-RELPOSNED messages and extract, among others, the relPosHeading field which I am after. But the problem is that the relPosHeading field doesn't seem to change whenever the antennae are rotated relative to each other. I know I am not reading the same message over and over, as the angle does change but only by a few decimal points when the platform is actually rotated by 15-30°. If I monitor the heading in u-center it does update in the expected way. Here is a minimalist example of the code: import serial
import serial.tools.list_ports as list_ports
from pyubx2 import UBXReader
try:
stream = serial.Serial('COM7', 9600, timeout=3)
except serial.serialutil.SerialException:
ports = list_ports.comports()
for port, desc, hwid in sorted(ports):
print("{}: {} [{}]".format(port, desc, hwid))
ubr = UBXReader(stream)
for angle in list_of_angles:
data = []
rotate_platform() # This line would rotate the antennae relative to eachother
while True:
(raw_data, parsed_data) = ubr.read()
if parsed_data.identity == 'NAV-RELPOSNED':
data.append(parsed_data.relPosHeading)
break
log_data(data) Any ideas on where I might be going wrong? Does the receiver need to be given any messages in order to properly update the NAV-RELPOSNED message? Regards, Oscar |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @omuhr Firstly, are you connecting to your F9P via UART or USB? If UART you might want to check the baud rate is correct - the default F9P UART baud rate is 38400, not 9600. Your example code is fine as far as it goes, though one potential problem is your timeout value (which may be causing you to miss messages arriving more quickly than every 3 seconds) - see https://github.com/semuconsulting/pyubx2/blob/master/examples/ubxpoller.py for a more robust stream reader example. Once you have the streaming mechanism sorted, you can simply read the parsed NAV-RELPOSNED message and reference any attributes you want - in your case Could you provide the ACTUAL, COMPLETE Python script you are executing and an example of the output you're getting? Could you also send me a screen shot of the comparative results you're getting in u-center, which you believe to be correct? What values are you seeing for heading accuracy (e.g. Thanks. |
Beta Was this translation helpful? Give feedback.
-
By way of illustration, I measured my own roving F9P against two different base locations in quick succession and compared the NAV-RELPOSNED
The estimates won't be exact because the base stations' positions are only given to 2 decimal places, but you can see that the NAV-RELPOSNED message is correctly reporting the relative heading and distance (+/- 0.6%) in each case. |
Beta Was this translation helpful? Give feedback.
By way of illustration, I measured my own roving F9P against two different base locations in quick succession and compared the NAV-RELPOSNED
relPosHeading
andrelPosLength
readings with my own estimates of heading and distance (derived using thebearing()
andhaversine()
helper functions provided by pyubx2).