Ricbot GNSS
From Rsewiki
Back to Ricbot
GNSS
Satellite positioning is implemented using a NEO-M9V receiver. The receiver is connected to the navigation Raspberry Pi.
Additional installation
sudo apt install gpsd gpsd-clients libgps-dev
Support added to teensy_interface (not fully tested) - part of Robobot software.
Raspberry Pi issue
Starting gpsd as a service fails, but manually starting it works fine:
sudo gpsd -n -N -D3 /dev/ttyACM1
Starting the service fails, like:
local@Saturn:~ $ systemctl status gpsd
○ gpsd.service - GPS (Global Positioning System) Daemon
Loaded: loaded (/usr/lib/systemd/system/gpsd.service; enabled; preset: enabled)
Active: inactive (dead)
TriggeredBy: × gpsd.socket
Docs: man:gpsd
Apr 26 13:02:52 Saturn systemd[1]: Dependency failed for gpsd.service - GPS (Global Positioning System) Daemon.
Apr 26 13:02:52 Saturn systemd[1]: gpsd.service: Job gpsd.service/start failed with result 'dependency'.
After a long search by Ecosia, I found a fix.
The /lib/systemd/system/gpsd.socket looked like this:
[Unit] Description=GPS (Global Positioning System) Daemon Sockets [Socket] ListenStream=/run/gpsd.sock ListenStream=[::1]:2947 ListenStream=127.0.0.1:2947 # To allow gpsd remote access, start gpsd with the -G option and # uncomment the next two lines: ListenStream=[::]:2947 ListenStream=0.0.0.0:2947 SocketMode=0600 #BindIPv6Only=yes BindIPv6Only=both [Install] WantedBy=sockets.target
Then uncommented most of these dependencies to listen to only 127.0.0.1:2947:
[Unit] Description=GPS (Global Positioning System) Daemon Sockets [Socket] ListenStream=/run/gpsd.sock #ListenStream=[::1]:2947 ListenStream=127.0.0.1:2947 # To allow gpsd remote access, start gpsd with the -G option and # uncomment the next two lines: #ListenStream=[::]:2947 #ListenStream=0.0.0.0:2947 SocketMode=0600 #BindIPv6Only=yes #BindIPv6Only=both [Install] WantedBy=sockets.target
Then I could do
systemctl start gpsd
and verify with
cgps
Decode and publish
Using the 'gpsd' publisher. This should be easily interfaced to ROS.
see: https://kickstartembedded.com/2022/07/23/a-beginners-guide-to-using-gpsd-in-linux/