get_first_RTK.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 ################################################################
4 # Copyright (C) 2019 Earth Rover Limited. All rights reserved. #
5 ################################################################
6 
7 from __future__ import print_function
8 import sys
9 import os
10 
11 import rospy
12 from sensor_msgs.msg import NavSatFix
13 
14 # init ros node
15 rospy.init_node('first_RTK')
16 
17 opath = sys.argv[1]
18 
19 # Subscribe once to RTK topic and get first msg
20 msg = rospy.wait_for_message('/piksi_receiver/navsatfix_best_fix', NavSatFix, timeout=None)
21 
22 # Write GPS corrdinates to yaml cfg file
23 text_file = open(opath+"/datum.yaml", "w")
24 text_file.write("datum: [" + str(msg.latitude) + ", " + str(msg.longitude) + ", 0]")
25 text_file.close()
26 
27 text_file = open(opath+"/local_xy_origins.yaml", "w")
28 text_file.write("local_xy_origins: [{name: swri, latitude: " + str(msg.latitude) + ", longitude: " + str(msg.longitude) + ", altitude: " + str(msg.altitude) + ", heading: 0}]")
29 text_file.close()


earth_rover_localization
Author(s):
autogenerated on Wed Apr 28 2021 02:15:34