mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-08-20 23:53:44 +08:00
Merge branch 'devel' of https://github.com/commaai/openpilot into testing
This commit is contained in:
@@ -56,7 +56,12 @@ void uno_set_gps_load_switch(bool enabled) {
|
||||
}
|
||||
|
||||
void uno_set_bootkick(bool enabled){
|
||||
set_gpio_output(GPIOB, 14, !enabled);
|
||||
if(enabled){
|
||||
set_gpio_output(GPIOB, 14, false);
|
||||
} else {
|
||||
// We want the pin to be floating, not forced high!
|
||||
set_gpio_mode(GPIOB, 14, MODE_INPUT);
|
||||
}
|
||||
}
|
||||
|
||||
void uno_bootkick(void) {
|
||||
|
||||
@@ -476,6 +476,7 @@ void pigeon_thread() {
|
||||
|
||||
// ubloxRaw = 8042
|
||||
PubMaster pm({"ubloxRaw"});
|
||||
bool ignition_last = false;
|
||||
|
||||
#ifdef QCOM2
|
||||
Pigeon * pigeon = Pigeon::connect("/dev/ttyHS0");
|
||||
@@ -483,7 +484,6 @@ void pigeon_thread() {
|
||||
Pigeon * pigeon = Pigeon::connect(panda);
|
||||
#endif
|
||||
|
||||
pigeon->init();
|
||||
// dp
|
||||
#ifdef DisableRelay
|
||||
panda->set_safety_model(cereal::CarParams::SafetyModel::TOYOTA);
|
||||
@@ -492,13 +492,23 @@ void pigeon_thread() {
|
||||
std::string recv = pigeon->receive();
|
||||
if (recv.length() > 0) {
|
||||
if (recv[0] == (char)0x00){
|
||||
LOGW("received invalid ublox message, resetting panda GPS");
|
||||
pigeon->init();
|
||||
if (ignition) {
|
||||
LOGW("received invalid ublox message while onroad, resetting panda GPS");
|
||||
pigeon->init();
|
||||
}
|
||||
} else {
|
||||
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
|
||||
usleep(10*1000);
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ void model_publish_v2(PubMaster &pm, uint32_t vipc_frame_id, uint32_t frame_id,
|
||||
float model_execution_time) {
|
||||
// make msg
|
||||
MessageBuilder msg;
|
||||
auto framed = msg.initEvent(frame_drop < MAX_FRAME_DROP).initModelV2();
|
||||
auto framed = msg.initEvent().initModelV2();
|
||||
uint32_t frame_age = (frame_id > vipc_frame_id) ? (frame_id - vipc_frame_id) : 0;
|
||||
framed.setFrameId(vipc_frame_id);
|
||||
framed.setFrameAge(frame_age);
|
||||
@@ -393,7 +393,7 @@ void model_publish(PubMaster &pm, uint32_t vipc_frame_id, uint32_t frame_id,
|
||||
|
||||
uint32_t frame_age = (frame_id > vipc_frame_id) ? (frame_id - vipc_frame_id) : 0;
|
||||
MessageBuilder msg;
|
||||
auto framed = msg.initEvent(frame_drop < MAX_FRAME_DROP).initModel();
|
||||
auto framed = msg.initEvent().initModel();
|
||||
framed.setFrameId(vipc_frame_id);
|
||||
framed.setFrameAge(frame_age);
|
||||
framed.setFrameDropPerc(frame_drop * 100);
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
#define POSE_SIZE 12
|
||||
|
||||
#define MODEL_FREQ 20
|
||||
#define MAX_FRAME_DROP 0.05
|
||||
|
||||
struct ModelDataRaw {
|
||||
float *plan;
|
||||
|
||||
Reference in New Issue
Block a user