mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-30 11:23:49 +08:00
ddb0d7c1a5
* fix not resetting safety mode when op goes offroad * hmm can do this but not needed * revert * rm check * fix loopback * ugh * might have to do this * Revert "might have to do this" This reverts commit abd8a7ed74ca11874de1360f9630dc67bc4d02ee. * fix * also works but ehhh * actually this is better, we already get IsOnroad at 10Hz * top looks better * fix
28 lines
632 B
C++
28 lines
632 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "common/params.h"
|
|
#include "selfdrive/pandad/panda.h"
|
|
|
|
void pandad_main_thread(std::vector<std::string> serials);
|
|
|
|
class PandaSafety {
|
|
public:
|
|
PandaSafety(const std::vector<Panda *> &pandas) : pandas_(pandas) {}
|
|
void configureSafetyMode(bool is_onroad);
|
|
|
|
private:
|
|
void updateMultiplexingMode();
|
|
std::string fetchCarParams();
|
|
void setSafetyMode(const std::string ¶ms_string);
|
|
|
|
bool initialized_ = false;
|
|
bool log_once_ = false;
|
|
bool safety_configured_ = false;
|
|
bool prev_obd_multiplexing_ = false;
|
|
std::vector<Panda *> pandas_;
|
|
Params params_;
|
|
};
|