ros-drivers / rosserial

A ROS client library for small, embedded devices, such as Arduino. See: http://wiki.ros.org/rosserial
508 stars 527 forks source link

Lost Sync With Device #611

Open Hateley123 opened 1 year ago

Hateley123 commented 1 year ago

I am trying to use a Teensy 4.1 as a clock when connecting lidar, cameras and IMUs. However, whenever I tried to send an nmea message through my serial 1 port, it takes too long and as a result my system desyncs. my code is copied below

Definitions:

define GPSERIAL Serial1 // $GPRMC

Code: if (sendNMEA == true) { char time_now[7], date_now[7]; time_t t = nh.now().sec; sprintf(time_now, "%02i%02i%02i", hour(t), minute(t), second(t)); sprintf(date_now, "%02i%02i%02i", day(t), month(t), year(t) % 100); String nmea_string = F("GPRMC,") + String(time_now) + F(",A,4365.107,N,79347.702,E,022.4,084.4,") + String(date_now) + ",003.1,W"; String chk = checksum(nmea_string); nmea_string = "$" + nmea_string + "*" + chk + "\n"; GPSERIAL.print(nmea_string); sendNMEA = false; digitalWriteFast(PPS_PIN, LOW); // minimum pulse duration required by LiDAR is 10 us
//nh.loginfo(nmea_string.c_str()); }

The code works as I am able to obtain a nmea_string. I have tested this through outputting the string, but I am unable to pass through the lidar.

I am using: VLP-16 Puck Connecting the PPS to the GPS Sync Pulse and connecting GPSERIAL to GPS Serial Reciever (manual:https://velodynelidar.com/wp-content/uploads/2019/12/63-9243-Rev-E-VLP-16-User-Manual.pdf)

Any assistance would be appreciated.

Hateley123 commented 1 year ago

using noetic btw