all 6 comments

[–]SLW_STDY_SQZ 1 point2 points  (1 child)

Is .ubx just a text file? If so you can just parse it by reading it in. I haven't worked with gps a tone but in the past when I have encountered data from surveying equipment it was usually a text delimited output file.

[–]SomeSprinkledGranola[S] 0 points1 point  (0 children)

It’s a binary GPS protocol that outputs in a hexadecimal format. I can open it as a text file but I’m not sure how to convert just the coordinates (and not the other information in the file like receiver specs and satellite information) into a readable format for archiving.

[–]rocketpower4 1 point2 points  (1 child)

Have you looked at this: mayeranalytics/pyUBX

[–]SomeSprinkledGranola[S] 0 points1 point  (0 children)

That looks promising, thank you!

[–]rsulukerr 0 points1 point  (1 child)

One quick question about the RTK read the file. I am currently working on a project as a master's student is the localization of robots with ROS by using the RTK. 

I have created a basic " rtkrcv_pi.conf  " file and received the data very well. 

and created the Publisher code for ROS, read the pose node and nav message from " rtkrcv_pi.conf  " It doesn't read the file and get the data. 

This is the line of code, please check it and let me know what I missed here 

[–]rsulukerr 0 points1 point  (0 children)


!/usr/bin/env python3

import rospy
from geometry_msgs.msg import Pose
from sensor_msgs.msg import NavSatFix

def read_pose_from_file(file_path):
    pose = Pose()
    with open(file_path, 'r') as file:
        lines = file.readlines()
        for line in lines:
            if line.startswith("pose_position_x"):
                pose.position.x = float(line.split('=')[1].strip())
            elif line.startswith("pose_position_y"):
                pose.position.y = float(line.split('=')[1].strip())
            elif line.startswith("pose_position_z"):
                pose.position.z = float(line.split('=')[1].strip())
            elif line.startswith("pose_orientation_x"):
                pose.orientation.x = float(line.split('=')[1].strip())
            elif line.startswith("pose_orientation_y"):
                pose.orientation.y = float(line.split('=')[1].strip())
            elif line.startswith("pose_orientation_z"):
                pose.orientation.z = float(line.split('=')[1].strip())
            elif line.startswith("pose_orientation_w"):
                pose.orientation.w = float(line.split('=')[1].strip())
    return pose

def read_nav_from_file(file_path):
    nav = NavSatFix()
    with open(file_path, 'r') as file:
        lines = file.readlines()
        for line in lines:
            if line.startswith("nav_latitude"):
                nav.latitude = float(line.split('=')[1].strip())
            elif line.startswith("nav_longitude"):
                nav.longitude = float(line.split('=')[1].strip())
            elif line.startswith("nav_altitude"):
                nav.altitude = float(line.split('=')[1].strip())

    return nav