dragonpilot - 基於 openpilot 的開源駕駛輔助系統
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

23 lines
520 B

#include <iostream>
#include <string>
#include "common/timing.h"
#include "light_sensor.hpp"
#include "constants.hpp"
void LightSensor::get_event(cereal::SensorEventData::Builder &event){
uint64_t start_time = nanos_since_boot();
file.clear();
file.seekg(0);
int value;
file >> value;
event.setSource(cereal::SensorEventData::SensorSource::RPR0521);
event.setVersion(1);
event.setSensor(SENSOR_LIGHT);
event.setType(SENSOR_TYPE_LIGHT);
event.setTimestamp(start_time);
event.setLight(value);
}