|
|
@ -474,6 +474,7 @@ void pigeon_thread() { |
|
|
|
|
|
|
|
|
|
|
|
// ubloxRaw = 8042
|
|
|
|
// ubloxRaw = 8042
|
|
|
|
PubMaster pm({"ubloxRaw"}); |
|
|
|
PubMaster pm({"ubloxRaw"}); |
|
|
|
|
|
|
|
bool ignition_last = false; |
|
|
|
|
|
|
|
|
|
|
|
#ifdef QCOM2 |
|
|
|
#ifdef QCOM2 |
|
|
|
Pigeon * pigeon = Pigeon::connect("/dev/ttyHS0"); |
|
|
|
Pigeon * pigeon = Pigeon::connect("/dev/ttyHS0"); |
|
|
@ -481,19 +482,27 @@ void pigeon_thread() { |
|
|
|
Pigeon * pigeon = Pigeon::connect(panda); |
|
|
|
Pigeon * pigeon = Pigeon::connect(panda); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
pigeon->init(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (!do_exit && panda->connected) { |
|
|
|
while (!do_exit && panda->connected) { |
|
|
|
std::string recv = pigeon->receive(); |
|
|
|
std::string recv = pigeon->receive(); |
|
|
|
if (recv.length() > 0) { |
|
|
|
if (recv.length() > 0) { |
|
|
|
if (recv[0] == (char)0x00){ |
|
|
|
if (recv[0] == (char)0x00){ |
|
|
|
LOGW("received invalid ublox message, resetting panda GPS"); |
|
|
|
if (ignition) { |
|
|
|
pigeon->init(); |
|
|
|
LOGW("received invalid ublox message while onroad, resetting panda GPS"); |
|
|
|
|
|
|
|
pigeon->init(); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
pigeon_publish_raw(pm, recv); |
|
|
|
pigeon_publish_raw(pm, recv); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// init pigeon on rising ignition edge
|
|
|
|
|
|
|
|
// since it was turned off in low power mode
|
|
|
|
|
|
|
|
if(ignition && !ignition_last) { |
|
|
|
|
|
|
|
pigeon->init(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ignition_last = ignition; |
|
|
|
|
|
|
|
|
|
|
|
// 10ms - 100 Hz
|
|
|
|
// 10ms - 100 Hz
|
|
|
|
usleep(10*1000); |
|
|
|
usleep(10*1000); |
|
|
|
} |
|
|
|
} |
|
|
|