best way to simulate a GPS device from /nmea_sentence

asked 2017-04-27 09:01:40 -0600

kylerlaird gravatar image

I need to interface with a proprietary embedded computer which uses a GPS. Normally it gets GPS data from a dedicated receiver wired to its RS-232 port. But I use a USB receiver which I also need for navigation.

Fortunately the controller runs Linux and I have rooted it. I found the device that it uses for GPS, removed it, and replaced it with my own PTY using socat. That all seems to work. (I was able to simulate planting the sidewalks of Stockholm.) Now I want to hook it into ROS.

Here's my first attempt:

# rostopic echo -p /nmea_sentence/data | cut -d, -f2- | socat stdin PTY,link=/dev/ttyO2,crnl

That seems to work alright in my initial tests but it's a little ugly and I'm concerned about buffering. It is crucial that I get the GPS data with little latency. It will be difficult for me to notice the latency until I'm in the field.

Any suggestions?

Thank you.

--kyler

edit retag flag offensive close merge delete