vietanhdev / open-adas

An open source advanced driver assistance system (ADAS) that uses Jetson Nano as the hardware. Features: Traffic sign detection, Forward collision warning, Lane departure warning.
MIT License
420 stars 123 forks source link

GPS data reads as 0 #18

Closed nrajasiddharthan closed 3 years ago

nrajasiddharthan commented 3 years ago

Hi,

Thanks for the awesome repo first of all.

I have attached a USB GPS to the nano. I don't get any speed values updated on the UI. It always remains at 0.

I can see the output using cpgs command on the terminal and also see the socket NMEA string using echo '?WATCH={"enable":true,"json":true};' | nc 127.0.0.1 2947 .

I have made changes to car_gps_reader.cpp

this->;socket_port = 50000; this->;socket_server = "192.168.1.244"; to replace my socket port and IP

On /src/configs/config.h

#define DISABLE_GPS_READER  commented this line out. 

#define USE_CAN_BUS_FOR_SIMULATION_DATA true changed true to false

Still I receive 0 for all values when I print these variables.

signal_status = kSignalNormal; longitude = gps->fix.longitude; latitude = gps->fix.latitude; car_speed = gps->fix.speed;

What am I missing?

TIA.

nrajasiddharthan commented 3 years ago

I used this program

https://github.com/itemir/rpi_boat_utils/blob/master/gpsd2nmea/gpsd2nmea

to get a good TCP socket for the GPS coordinates.

/src/sensors/test_car_gps_reader.cpp gives prints the speed and lat, long

But the car_gps_reader throws an error even though both call the same function.

vietanhdev commented 3 years ago

I haven't touch GPS reader for a long time. Can you fix fit and contribute back to this repository? Thank you very much!