Merge common/ and selfdrive/common (#24556)

* Merge common/ and selfdrive/common

* fix that

* fix version

* fix unit tests
old-commit-hash: cb8885cffb
taco
Adeeb Shihadeh 3 years ago committed by GitHub
parent eea872ae98
commit f4675fc260
  1. 4
      .github/workflows/selfdrive_tests.yaml
  2. 13
      SConstruct
  3. 39
      common/SConscript
  4. 4
      common/clutil.cc
  5. 0
      common/clutil.h
  6. 4
      common/gpio.cc
  7. 0
      common/gpio.h
  8. 8
      common/i2c.cc
  9. 0
      common/i2c.h
  10. 0
      common/mat.h
  11. 2
      common/modeldata.h
  12. 6
      common/params.cc
  13. 0
      common/params.h
  14. 2
      common/params_pyx.pyx
  15. 0
      common/queue.h
  16. 4
      common/statlog.cc
  17. 0
      common/statlog.h
  18. 6
      common/swaglog.cc
  19. 2
      common/swaglog.h
  20. 2
      common/tests/.gitignore
  21. 6
      common/tests/test_swaglog.cc
  22. 2
      common/tests/test_util.cc
  23. 0
      common/timing.h
  24. 2
      common/util.cc
  25. 0
      common/util.h
  26. 0
      common/version.h
  27. 2
      common/visionimg.cc
  28. 0
      common/visionimg.h
  29. 6
      common/watchdog.cc
  30. 0
      common/watchdog.h
  31. 2
      docs/c_docs.rst
  32. 2
      release/build_devel.sh
  33. 4
      release/build_release.sh
  34. 56
      release/files_common
  35. 2
      scripts/waste.c
  36. 8
      selfdrive/boardd/boardd.cc
  37. 4
      selfdrive/boardd/main.cc
  38. 6
      selfdrive/boardd/panda.cc
  39. 6
      selfdrive/boardd/pigeon.cc
  40. 4
      selfdrive/boardd/tests/test_boardd
  41. 8
      selfdrive/camerad/cameras/camera_common.cc
  42. 8
      selfdrive/camerad/cameras/camera_common.h
  43. 2
      selfdrive/camerad/cameras/camera_qcom2.cc
  44. 2
      selfdrive/camerad/cameras/camera_qcom2.h
  45. 4
      selfdrive/camerad/cameras/camera_replay.cc
  46. 8
      selfdrive/camerad/cameras/camera_webcam.cc
  47. 2
      selfdrive/camerad/imgproc/utils.h
  48. 4
      selfdrive/camerad/main.cc
  49. 2
      selfdrive/camerad/test/ae_gray_test.cc
  50. 2
      selfdrive/camerad/transforms/rgb_to_yuv.h
  51. 2
      selfdrive/camerad/transforms/rgb_to_yuv_test.cc
  52. 4
      selfdrive/clocksd/clocksd.cc
  53. 35
      selfdrive/common/SConscript
  54. 2
      selfdrive/hardware/hw.h
  55. 4
      selfdrive/hardware/tici/hardware.h
  56. 8
      selfdrive/locationd/locationd.h
  57. 2
      selfdrive/locationd/ublox_msg.cc
  58. 2
      selfdrive/locationd/ublox_msg.h
  59. 4
      selfdrive/locationd/ubloxd.cc
  60. 4
      selfdrive/logcatd/logcatd_systemd.cc
  61. 2
      selfdrive/loggerd/bootlog.cc
  62. 2
      selfdrive/loggerd/encoder/encoder.h
  63. 4
      selfdrive/loggerd/encoder/ffmpeg_encoder.cc
  64. 4
      selfdrive/loggerd/encoder/v4l_encoder.cc
  65. 2
      selfdrive/loggerd/encoder/v4l_encoder.h
  66. 6
      selfdrive/loggerd/logger.cc
  67. 4
      selfdrive/loggerd/logger.h
  68. 8
      selfdrive/loggerd/loggerd.h
  69. 2
      selfdrive/loggerd/tests/test_logger.cc
  70. 4
      selfdrive/loggerd/video_writer.cc
  71. 4
      selfdrive/modeld/dmonitoringmodeld.cc
  72. 8
      selfdrive/modeld/modeld.cc
  73. 6
      selfdrive/modeld/models/commonmodel.cc
  74. 2
      selfdrive/modeld/models/commonmodel.h
  75. 8
      selfdrive/modeld/models/dmonitoring.cc
  76. 2
      selfdrive/modeld/models/dmonitoring.h
  77. 8
      selfdrive/modeld/models/driving.cc
  78. 6
      selfdrive/modeld/models/driving.h
  79. 4
      selfdrive/modeld/runners/onnxmodel.cc
  80. 4
      selfdrive/modeld/runners/snpemodel.cc
  81. 4
      selfdrive/modeld/thneed/optimizer.cc
  82. 4
      selfdrive/modeld/thneed/serialize.cc
  83. 4
      selfdrive/modeld/thneed/thneed.cc
  84. 2
      selfdrive/modeld/transforms/loadyuv.h
  85. 2
      selfdrive/modeld/transforms/transform.cc
  86. 2
      selfdrive/modeld/transforms/transform.h
  87. 2
      selfdrive/proclogd/main.cc
  88. 4
      selfdrive/proclogd/proclog.cc
  89. 2
      selfdrive/proclogd/tests/test_proclog.cc
  90. 4
      selfdrive/sensord/sensors/bmx055_accel.cc
  91. 2
      selfdrive/sensord/sensors/bmx055_gyro.cc
  92. 4
      selfdrive/sensord/sensors/bmx055_magn.cc
  93. 4
      selfdrive/sensord/sensors/bmx055_temp.cc
  94. 2
      selfdrive/sensord/sensors/i2c_sensor.h
  95. 2
      selfdrive/sensord/sensors/light_sensor.cc
  96. 4
      selfdrive/sensord/sensors/lsm6ds3_accel.cc
  97. 4
      selfdrive/sensord/sensors/lsm6ds3_gyro.cc
  98. 4
      selfdrive/sensord/sensors/lsm6ds3_temp.cc
  99. 4
      selfdrive/sensord/sensors/mmc5603nj_magn.cc
  100. 8
      selfdrive/sensord/sensors_qcom2.cc
  101. Some files were not shown because too many files have changed in this diff Show More

@ -291,9 +291,9 @@ jobs:
$UNIT_TEST selfdrive/hardware/tici && \ $UNIT_TEST selfdrive/hardware/tici && \
$UNIT_TEST selfdrive/modeld && \ $UNIT_TEST selfdrive/modeld && \
$UNIT_TEST tools/lib/tests && \ $UNIT_TEST tools/lib/tests && \
./common/tests/test_util && \
./common/tests/test_swaglog && \
./selfdrive/boardd/tests/test_boardd_usbprotocol && \ ./selfdrive/boardd/tests/test_boardd_usbprotocol && \
./selfdrive/common/tests/test_util && \
./selfdrive/common/tests/test_swaglog && \
./selfdrive/loggerd/tests/test_logger &&\ ./selfdrive/loggerd/tests/test_logger &&\
./selfdrive/proclogd/tests/test_proclog && \ ./selfdrive/proclogd/tests/test_proclog && \
./selfdrive/ui/replay/tests/test_replay && \ ./selfdrive/ui/replay/tests/test_replay && \

@ -130,7 +130,7 @@ else:
"#third_party/libyuv/x64/lib", "#third_party/libyuv/x64/lib",
"#third_party/mapbox-gl-native-qt/x86_64", "#third_party/mapbox-gl-native-qt/x86_64",
"#cereal", "#cereal",
"#selfdrive/common", "#common",
"/usr/lib", "/usr/lib",
"/usr/local/lib", "/usr/local/lib",
] ]
@ -138,7 +138,7 @@ else:
rpath += [ rpath += [
Dir("#third_party/snpe/x86_64-linux-clang").abspath, Dir("#third_party/snpe/x86_64-linux-clang").abspath,
Dir("#cereal").abspath, Dir("#cereal").abspath,
Dir("#selfdrive/common").abspath Dir("#common").abspath
] ]
if GetOption('asan'): if GetOption('asan'):
@ -156,8 +156,8 @@ if arch != "Darwin":
ldflags += ["-Wl,--as-needed", "-Wl,--no-undefined"] ldflags += ["-Wl,--as-needed", "-Wl,--no-undefined"]
# Enable swaglog include in submodules # Enable swaglog include in submodules
cflags += ['-DSWAGLOG="\\"selfdrive/common/swaglog.h\\""'] cflags += ['-DSWAGLOG="\\"common/swaglog.h\\""']
cxxflags += ['-DSWAGLOG="\\"selfdrive/common/swaglog.h\\""'] cxxflags += ['-DSWAGLOG="\\"common/swaglog.h\\""']
env = Environment( env = Environment(
ENV=lenv, ENV=lenv,
@ -212,7 +212,7 @@ env = Environment(
"#third_party", "#third_party",
"#opendbc/can", "#opendbc/can",
"#selfdrive/boardd", "#selfdrive/boardd",
"#selfdrive/common", "#common",
], ],
CYTHONCFILESUFFIX=".cpp", CYTHONCFILESUFFIX=".cpp",
COMPILATIONDB_USE_ABSPATH=True, COMPILATIONDB_USE_ABSPATH=True,
@ -330,7 +330,7 @@ if GetOption("clazy"):
Export('env', 'qt_env', 'arch', 'real_arch', 'SHARED', 'USE_WEBCAM') Export('env', 'qt_env', 'arch', 'real_arch', 'SHARED', 'USE_WEBCAM')
SConscript(['selfdrive/common/SConscript']) SConscript(['common/SConscript'])
Import('_common', '_gpucommon', '_gpu_libs') Import('_common', '_gpucommon', '_gpu_libs')
if SHARED: if SHARED:
@ -384,7 +384,6 @@ SConscript(['opendbc/can/SConscript'])
SConscript(['third_party/SConscript']) SConscript(['third_party/SConscript'])
SConscript(['common/SConscript'])
SConscript(['common/kalman/SConscript']) SConscript(['common/kalman/SConscript'])
SConscript(['common/transformations/SConscript']) SConscript(['common/transformations/SConscript'])

@ -1,4 +1,39 @@
Import('envCython', 'common') Import('env', 'envCython', 'arch', 'SHARED')
if SHARED:
fxn = env.SharedLibrary
else:
fxn = env.Library
common_libs = [
'params.cc',
'statlog.cc',
'swaglog.cc',
'util.cc',
'gpio.cc',
'i2c.cc',
'watchdog.cc',
]
_common = fxn('common', common_libs, LIBS="json11")
files = [
'clutil.cc',
'visionimg.cc',
]
if arch == "larch64":
_gpu_libs = ["GLESv2"]
else:
_gpu_libs = ["GL"]
_gpucommon = fxn('gpucommon', files, LIBS=_gpu_libs)
Export('_common', '_gpucommon', '_gpu_libs')
if GetOption('test'):
env.Program('tests/test_util', ['tests/test_util.cc'], LIBS=[_common])
env.Program('tests/test_swaglog', ['tests/test_swaglog.cc'], LIBS=[_common, 'json11', 'zmq', 'pthread'])
# Cython
envCython.Program('clock.so', 'clock.pyx') envCython.Program('clock.so', 'clock.pyx')
envCython.Program('params_pyx.so', 'params_pyx.pyx', LIBS=envCython['LIBS'] + [common, 'zmq']) envCython.Program('params_pyx.so', 'params_pyx.pyx', LIBS=envCython['LIBS'] + [_common, 'zmq', 'json11'])

@ -1,10 +1,10 @@
#include "selfdrive/common/clutil.h" #include "common/clutil.h"
#include <cassert> #include <cassert>
#include <iostream> #include <iostream>
#include <memory> #include <memory>
#include "selfdrive/common/util.h" #include "common/util.h"
namespace { // helper functions namespace { // helper functions

@ -1,11 +1,11 @@
#include "selfdrive/common/gpio.h" #include "common/gpio.h"
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <cstring> #include <cstring>
#include "selfdrive/common/util.h" #include "common/util.h"
// We assume that all pins have already been exported on boot, // We assume that all pins have already been exported on boot,
// and that we have permission to write to them. // and that we have permission to write to them.

@ -1,4 +1,4 @@
#include "selfdrive/common/i2c.h" #include "common/i2c.h"
#include <fcntl.h> #include <fcntl.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
@ -8,9 +8,9 @@
#include <cstdio> #include <cstdio>
#include <stdexcept> #include <stdexcept>
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#define UNUSED(x) (void)(x) #define UNUSED(x) (void)(x)

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <array> #include <array>
#include "selfdrive/common/mat.h" #include "common/mat.h"
#include "selfdrive/hardware/hw.h" #include "selfdrive/hardware/hw.h"
const int TRAJECTORY_SIZE = 33; const int TRAJECTORY_SIZE = 33;

@ -1,4 +1,4 @@
#include "selfdrive/common/params.h" #include "common/params.h"
#include <dirent.h> #include <dirent.h>
#include <sys/file.h> #include <sys/file.h>
@ -6,8 +6,8 @@
#include <csignal> #include <csignal>
#include <unordered_map> #include <unordered_map>
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/hardware/hw.h" #include "selfdrive/hardware/hw.h"
namespace { namespace {

@ -4,7 +4,7 @@ from libcpp cimport bool
from libcpp.string cimport string from libcpp.string cimport string
import threading import threading
cdef extern from "selfdrive/common/params.h": cdef extern from "common/params.h":
cpdef enum ParamKeyType: cpdef enum ParamKeyType:
PERSISTENT PERSISTENT
CLEAR_ON_MANAGER_START CLEAR_ON_MANAGER_START

@ -2,8 +2,8 @@
#define _GNU_SOURCE #define _GNU_SOURCE
#endif #endif
#include "selfdrive/common/statlog.h" #include "common/statlog.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include <stdio.h> #include <stdio.h>
#include <mutex> #include <mutex>

@ -2,7 +2,7 @@
#define _GNU_SOURCE #define _GNU_SOURCE
#endif #endif
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include <cassert> #include <cassert>
#include <cstring> #include <cstring>
@ -13,8 +13,8 @@
#include <zmq.h> #include <zmq.h>
#include "json11.hpp" #include "json11.hpp"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/common/version.h" #include "common/version.h"
#include "selfdrive/hardware/hw.h" #include "selfdrive/hardware/hw.h"
class SwaglogState : public LogState { class SwaglogState : public LogState {

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "selfdrive/common/timing.h" #include "common/timing.h"
#define CLOUDLOG_DEBUG 10 #define CLOUDLOG_DEBUG 10
#define CLOUDLOG_INFO 20 #define CLOUDLOG_INFO 20

@ -0,0 +1,2 @@
test_util
test_swaglog

@ -4,9 +4,9 @@
#include "catch2/catch.hpp" #include "catch2/catch.hpp"
#include "json11.hpp" #include "json11.hpp"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/common/version.h" #include "common/version.h"
#include "selfdrive/hardware/hw.h" #include "selfdrive/hardware/hw.h"
const char *SWAGLOG_ADDR = "ipc:///tmp/logmessage"; const char *SWAGLOG_ADDR = "ipc:///tmp/logmessage";

@ -10,7 +10,7 @@
#define CATCH_CONFIG_MAIN #define CATCH_CONFIG_MAIN
#include "catch2/catch.hpp" #include "catch2/catch.hpp"
#include "selfdrive/common/util.h" #include "common/util.h"
std::string random_bytes(int size) { std::string random_bytes(int size) {
std::random_device rd; std::random_device rd;

@ -1,4 +1,4 @@
#include "selfdrive/common/util.h" #include "common/util.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <dirent.h> #include <dirent.h>

@ -1,4 +1,4 @@
#include "selfdrive/common/visionimg.h" #include "common/visionimg.h"
#include <cassert> #include <cassert>

@ -1,6 +1,6 @@
#include "selfdrive/common/watchdog.h" #include "common/watchdog.h"
#include "selfdrive/common/timing.h" #include "common/timing.h"
#include "selfdrive/common/util.h" #include "common/util.h"
const std::string watchdog_fn_prefix = "/dev/shm/wd_"; // + <pid> const std::string watchdog_fn_prefix = "/dev/shm/wd_"; // + <pid>

@ -86,7 +86,7 @@ modeld
common common
^^^^^^ ^^^^^^
.. autodoxygenindex:: .. autodoxygenindex::
:project: selfdrive_common :project: common
sensorsd sensorsd
^^^^^^^^ ^^^^^^^^

@ -58,7 +58,7 @@ rm -f panda/board/obj/panda.bin.signed
# include source commit hash and build date in commit # include source commit hash and build date in commit
GIT_HASH=$(git --git-dir=$SOURCE_DIR/.git rev-parse HEAD) GIT_HASH=$(git --git-dir=$SOURCE_DIR/.git rev-parse HEAD)
DATETIME=$(date '+%Y-%m-%dT%H:%M:%S') DATETIME=$(date '+%Y-%m-%dT%H:%M:%S')
VERSION=$(cat $SOURCE_DIR/selfdrive/common/version.h | awk -F\" '{print $2}') VERSION=$(cat $SOURCE_DIR/common/version.h | awk -F\" '{print $2}')
echo "[-] committing version $VERSION T=$SECONDS" echo "[-] committing version $VERSION T=$SECONDS"
git add -f . git add -f .

@ -41,8 +41,8 @@ cd $BUILD_DIR
rm -f panda/board/obj/panda.bin.signed rm -f panda/board/obj/panda.bin.signed
VERSION=$(cat selfdrive/common/version.h | awk -F[\"-] '{print $2}') VERSION=$(cat common/version.h | awk -F[\"-] '{print $2}')
echo "#define COMMA_VERSION \"$VERSION-release\"" > selfdrive/common/version.h echo "#define COMMA_VERSION \"$VERSION-release\"" > common/version.h
echo "[-] committing version $VERSION T=$SECONDS" echo "[-] committing version $VERSION T=$SECONDS"
git add -f . git add -f .

@ -125,34 +125,34 @@ selfdrive/clocksd/clocksd.cc
selfdrive/debug/*.py selfdrive/debug/*.py
selfdrive/common/SConscript common/SConscript
selfdrive/common/version.h common/version.h
selfdrive/common/swaglog.h common/swaglog.h
selfdrive/common/swaglog.cc common/swaglog.cc
selfdrive/common/statlog.h common/statlog.h
selfdrive/common/statlog.cc common/statlog.cc
selfdrive/common/util.cc common/util.cc
selfdrive/common/util.h common/util.h
selfdrive/common/queue.h common/queue.h
selfdrive/common/clutil.cc common/clutil.cc
selfdrive/common/clutil.h common/clutil.h
selfdrive/common/params.h common/params.h
selfdrive/common/params.cc common/params.cc
selfdrive/common/watchdog.cc common/watchdog.cc
selfdrive/common/watchdog.h common/watchdog.h
selfdrive/common/modeldata.h common/modeldata.h
selfdrive/common/mat.h common/mat.h
selfdrive/common/timing.h common/timing.h
selfdrive/common/visionimg.cc common/visionimg.cc
selfdrive/common/visionimg.h common/visionimg.h
selfdrive/common/gpio.cc common/gpio.cc
selfdrive/common/gpio.h common/gpio.h
selfdrive/common/i2c.cc common/i2c.cc
selfdrive/common/i2c.h common/i2c.h
selfdrive/controls/__init__.py selfdrive/controls/__init__.py

@ -11,7 +11,7 @@
#include <pthread.h> #include <pthread.h>
#include <arm_neon.h> #include <arm_neon.h>
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
#include "../selfdrive/common/timing.h" #include "../common/timing.h"
int get_nprocs(void); int get_nprocs(void);
double *ttime, *oout; double *ttime, *oout;

@ -23,10 +23,10 @@
#include "cereal/gen/cpp/car.capnp.h" #include "cereal/gen/cpp/car.capnp.h"
#include "cereal/messaging/messaging.h" #include "cereal/messaging/messaging.h"
#include "selfdrive/common/params.h" #include "common/params.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/timing.h" #include "common/timing.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/hardware/hw.h" #include "selfdrive/hardware/hw.h"
#include "selfdrive/boardd/pigeon.h" #include "selfdrive/boardd/pigeon.h"

@ -1,8 +1,8 @@
#include <cassert> #include <cassert>
#include "selfdrive/boardd/boardd.h" #include "selfdrive/boardd/boardd.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/hardware/hw.h" #include "selfdrive/hardware/hw.h"
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {

@ -8,9 +8,9 @@
#include "cereal/messaging/messaging.h" #include "cereal/messaging/messaging.h"
#include "panda/board/dlc_to_len.h" #include "panda/board/dlc_to_len.h"
#include "selfdrive/common/gpio.h" #include "common/gpio.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/util.h" #include "common/util.h"
static int init_usb_ctx(libusb_context **context) { static int init_usb_ctx(libusb_context **context) {
assert(context != nullptr); assert(context != nullptr);

@ -8,9 +8,9 @@
#include <cerrno> #include <cerrno>
#include <optional> #include <optional>
#include "selfdrive/common/gpio.h" #include "common/gpio.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/locationd/ublox_msg.h" #include "selfdrive/locationd/ublox_msg.h"
// Termios on macos doesn't define all baud rate constants // Termios on macos doesn't define all baud rate constants

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:b5c0b301b3fc7c0f4718409ed68033eb870f127489e9d834aa9dbd23ed7eb91b oid sha256:94b727526c3de262610943263cafe99a32658ffbade853854a699c991c3337b7
size 13919544 size 13919474

@ -11,10 +11,10 @@
#include <jpeglib.h> #include <jpeglib.h>
#include "selfdrive/camerad/imgproc/utils.h" #include "selfdrive/camerad/imgproc/utils.h"
#include "selfdrive/common/clutil.h" #include "common/clutil.h"
#include "selfdrive/common/modeldata.h" #include "common/modeldata.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/hardware/hw.h" #include "selfdrive/hardware/hw.h"
#if QCOM2 #if QCOM2

@ -10,10 +10,10 @@
#include "cereal/visionipc/visionipc.h" #include "cereal/visionipc/visionipc.h"
#include "cereal/visionipc/visionipc_server.h" #include "cereal/visionipc/visionipc_server.h"
#include "selfdrive/camerad/transforms/rgb_to_yuv.h" #include "selfdrive/camerad/transforms/rgb_to_yuv.h"
#include "selfdrive/common/mat.h" #include "common/mat.h"
#include "selfdrive/common/queue.h" #include "common/queue.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/visionimg.h" #include "common/visionimg.h"
#include "selfdrive/hardware/hw.h" #include "selfdrive/hardware/hw.h"
#define CAMERA_ID_IMX298 0 #define CAMERA_ID_IMX298 0

@ -19,7 +19,7 @@
#include "media/cam_sensor.h" #include "media/cam_sensor.h"
#include "media/cam_sensor_cmn_header.h" #include "media/cam_sensor_cmn_header.h"
#include "media/cam_sync.h" #include "media/cam_sync.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/camerad/cameras/sensor2_i2c.h" #include "selfdrive/camerad/cameras/sensor2_i2c.h"
// For debugging: // For debugging:

@ -7,7 +7,7 @@
#include <media/cam_req_mgr.h> #include <media/cam_req_mgr.h>
#include "selfdrive/camerad/cameras/camera_common.h" #include "selfdrive/camerad/cameras/camera_common.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#define FRAME_BUF_COUNT 4 #define FRAME_BUF_COUNT 4

@ -3,8 +3,8 @@
#include <cassert> #include <cassert>
#include <thread> #include <thread>
#include "selfdrive/common/clutil.h" #include "common/clutil.h"
#include "selfdrive/common/util.h" #include "common/util.h"
extern ExitHandler do_exit; extern ExitHandler do_exit;

@ -13,10 +13,10 @@
#include <opencv2/videoio.hpp> #include <opencv2/videoio.hpp>
#pragma clang diagnostic pop #pragma clang diagnostic pop
#include "selfdrive/common/clutil.h" #include "common/clutil.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/timing.h" #include "common/timing.h"
#include "selfdrive/common/util.h" #include "common/util.h"
// id of the video capturing device // id of the video capturing device
const int ROAD_CAMERA_ID = util::getenv("ROADCAM_ID", 1); const int ROAD_CAMERA_ID = util::getenv("ROADCAM_ID", 1);

@ -4,7 +4,7 @@
#include <cstdint> #include <cstdint>
#include <vector> #include <vector>
#include "selfdrive/common/clutil.h" #include "common/clutil.h"
#define NUM_SEGMENTS_X 8 #define NUM_SEGMENTS_X 8
#define NUM_SEGMENTS_Y 6 #define NUM_SEGMENTS_Y 6

@ -2,8 +2,8 @@
#include <cassert> #include <cassert>
#include "selfdrive/common/params.h" #include "common/params.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/hardware/hw.h" #include "selfdrive/hardware/hw.h"
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {

@ -7,7 +7,7 @@
#include <cmath> #include <cmath>
#include <cstring> #include <cstring>
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/camerad/cameras/camera_common.h" #include "selfdrive/camerad/cameras/camera_common.h"
// needed by camera_common.cc // needed by camera_common.cc

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "selfdrive/common/clutil.h" #include "common/clutil.h"
class Rgb2Yuv { class Rgb2Yuv {
public: public:

@ -31,7 +31,7 @@
#include "libyuv.h" #include "libyuv.h"
#include "selfdrive/camerad/transforms/rgb_to_yuv.h" #include "selfdrive/camerad/transforms/rgb_to_yuv.h"
#include "selfdrive/common/clutil.h" #include "common/clutil.h"
static inline double millis_since_boot() { static inline double millis_since_boot() {
struct timespec t; struct timespec t;

@ -16,8 +16,8 @@
#include <chrono> #include <chrono>
#include "cereal/messaging/messaging.h" #include "cereal/messaging/messaging.h"
#include "selfdrive/common/timing.h" #include "common/timing.h"
#include "selfdrive/common/util.h" #include "common/util.h"
ExitHandler do_exit; ExitHandler do_exit;

@ -1,35 +0,0 @@
Import('env', 'arch', 'SHARED')
if SHARED:
fxn = env.SharedLibrary
else:
fxn = env.Library
common_libs = [
'params.cc',
'statlog.cc',
'swaglog.cc',
'util.cc',
'gpio.cc',
'i2c.cc',
'watchdog.cc',
]
_common = fxn('common', common_libs, LIBS="json11")
files = [
'clutil.cc',
'visionimg.cc',
]
if arch == "larch64":
_gpu_libs = ["GLESv2"]
else:
_gpu_libs = ["GL"]
_gpucommon = fxn('gpucommon', files, LIBS=_gpu_libs)
Export('_common', '_gpucommon', '_gpu_libs')
if GetOption('test'):
env.Program('tests/test_util', ['tests/test_util.cc'], LIBS=[_common])
env.Program('tests/test_swaglog', ['tests/test_swaglog.cc'], LIBS=[_common, 'json11', 'zmq', 'pthread'])

@ -1,7 +1,7 @@
#pragma once #pragma once
#include "selfdrive/hardware/base.h" #include "selfdrive/hardware/base.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#if QCOM2 #if QCOM2
#include "selfdrive/hardware/tici/hardware.h" #include "selfdrive/hardware/tici/hardware.h"

@ -3,8 +3,8 @@
#include <cstdlib> #include <cstdlib>
#include <fstream> #include <fstream>
#include "selfdrive/common/params.h" #include "common/params.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/hardware/base.h" #include "selfdrive/hardware/base.h"
class HardwareTici : public HardwareNone { class HardwareTici : public HardwareNone {

@ -8,10 +8,10 @@
#include "cereal/messaging/messaging.h" #include "cereal/messaging/messaging.h"
#include "common/transformations/coordinates.hpp" #include "common/transformations/coordinates.hpp"
#include "common/transformations/orientation.hpp" #include "common/transformations/orientation.hpp"
#include "selfdrive/common/params.h" #include "common/params.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/timing.h" #include "common/timing.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/sensord/sensors/constants.h" #include "selfdrive/sensord/sensors/constants.h"
#define VISION_DECIMATION 2 #define VISION_DECIMATION 2

@ -10,7 +10,7 @@
#include <ctime> #include <ctime>
#include <unordered_map> #include <unordered_map>
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
const double gpsPi = 3.1415926535898; const double gpsPi = 3.1415926535898;
#define UBLOX_MSG_SIZE(hdr) (*(uint16_t *)&hdr[4]) #define UBLOX_MSG_SIZE(hdr) (*(uint16_t *)&hdr[4])

@ -8,7 +8,7 @@
#include <ctime> #include <ctime>
#include "cereal/messaging/messaging.h" #include "cereal/messaging/messaging.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/locationd/generated/gps.h" #include "selfdrive/locationd/generated/gps.h"
#include "selfdrive/locationd/generated/ubx.h" #include "selfdrive/locationd/generated/ubx.h"

@ -3,8 +3,8 @@
#include <kaitai/kaitaistream.h> #include <kaitai/kaitaistream.h>
#include "cereal/messaging/messaging.h" #include "cereal/messaging/messaging.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/locationd/ublox_msg.h" #include "selfdrive/locationd/ublox_msg.h"
ExitHandler do_exit; ExitHandler do_exit;

@ -8,8 +8,8 @@
#include "json11.hpp" #include "json11.hpp"
#include "cereal/messaging/messaging.h" #include "cereal/messaging/messaging.h"
#include "selfdrive/common/timing.h" #include "common/timing.h"
#include "selfdrive/common/util.h" #include "common/util.h"
ExitHandler do_exit; ExitHandler do_exit;
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {

@ -2,7 +2,7 @@
#include <string> #include <string>
#include "cereal/messaging/messaging.h" #include "cereal/messaging/messaging.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/loggerd/logger.h" #include "selfdrive/loggerd/logger.h"

@ -6,7 +6,7 @@
#include "cereal/messaging/messaging.h" #include "cereal/messaging/messaging.h"
#include "cereal/visionipc/visionipc.h" #include "cereal/visionipc/visionipc.h"
#include "selfdrive/common/queue.h" #include "common/queue.h"
#include "selfdrive/loggerd/video_writer.h" #include "selfdrive/loggerd/video_writer.h"
#include "selfdrive/camerad/cameras/camera_common.h" #include "selfdrive/camerad/cameras/camera_common.h"

@ -19,8 +19,8 @@ extern "C" {
#include <libavutil/imgutils.h> #include <libavutil/imgutils.h>
} }
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/util.h" #include "common/util.h"
const int env_debug_encoder = (getenv("DEBUG_ENCODER") != NULL) ? atoi(getenv("DEBUG_ENCODER")) : 0; const int env_debug_encoder = (getenv("DEBUG_ENCODER") != NULL) ? atoi(getenv("DEBUG_ENCODER")) : 0;

@ -3,8 +3,8 @@
#include <poll.h> #include <poll.h>
#include "selfdrive/loggerd/encoder/v4l_encoder.h" #include "selfdrive/loggerd/encoder/v4l_encoder.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/common/timing.h" #include "common/timing.h"
#include "libyuv.h" #include "libyuv.h"
#include "msm_media_info.h" #include "msm_media_info.h"

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "selfdrive/common/queue.h" #include "common/queue.h"
#include "selfdrive/loggerd/encoder/encoder.h" #include "selfdrive/loggerd/encoder/encoder.h"
#define BUF_IN_COUNT 7 #define BUF_IN_COUNT 7

@ -15,9 +15,9 @@
#include <iostream> #include <iostream>
#include <streambuf> #include <streambuf>
#include "selfdrive/common/params.h" #include "common/params.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/version.h" #include "common/version.h"
// ***** logging helpers ***** // ***** logging helpers *****

@ -11,8 +11,8 @@
#include <kj/array.h> #include <kj/array.h>
#include "cereal/messaging/messaging.h" #include "cereal/messaging/messaging.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/hardware/hw.h" #include "selfdrive/hardware/hw.h"
const std::string LOG_ROOT = Path::log_root(); const std::string LOG_ROOT = Path::log_root();

@ -16,10 +16,10 @@
#include "cereal/visionipc/visionipc.h" #include "cereal/visionipc/visionipc.h"
#include "cereal/visionipc/visionipc_client.h" #include "cereal/visionipc/visionipc_client.h"
#include "selfdrive/camerad/cameras/camera_common.h" #include "selfdrive/camerad/cameras/camera_common.h"
#include "selfdrive/common/params.h" #include "common/params.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/timing.h" #include "common/timing.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/hardware/hw.h" #include "selfdrive/hardware/hw.h"
#include "selfdrive/loggerd/encoder/encoder.h" #include "selfdrive/loggerd/encoder/encoder.h"

@ -7,7 +7,7 @@
#include "catch2/catch.hpp" #include "catch2/catch.hpp"
#include "cereal/messaging/messaging.h" #include "cereal/messaging/messaging.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/loggerd/logger.h" #include "selfdrive/loggerd/logger.h"
#include "selfdrive/ui/replay/util.h" #include "selfdrive/ui/replay/util.h"

@ -2,8 +2,8 @@
#include <cstdlib> #include <cstdlib>
#include "selfdrive/loggerd/video_writer.h" #include "selfdrive/loggerd/video_writer.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/util.h" #include "common/util.h"
VideoWriter::VideoWriter(const char *path, const char *filename, bool remuxing, int width, int height, int fps, cereal::EncodeIndex::Type codec) VideoWriter::VideoWriter(const char *path, const char *filename, bool remuxing, int width, int height, int fps, cereal::EncodeIndex::Type codec)
: remuxing(remuxing) { : remuxing(remuxing) {

@ -5,8 +5,8 @@
#include <cstdlib> #include <cstdlib>
#include "cereal/visionipc/visionipc_client.h" #include "cereal/visionipc/visionipc_client.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/modeld/models/dmonitoring.h" #include "selfdrive/modeld/models/dmonitoring.h"
ExitHandler do_exit; ExitHandler do_exit;

@ -7,10 +7,10 @@
#include "cereal/messaging/messaging.h" #include "cereal/messaging/messaging.h"
#include "cereal/visionipc/visionipc_client.h" #include "cereal/visionipc/visionipc_client.h"
#include "selfdrive/common/clutil.h" #include "common/clutil.h"
#include "selfdrive/common/params.h" #include "common/params.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/hardware/hw.h" #include "selfdrive/hardware/hw.h"
#include "selfdrive/modeld/models/driving.h" #include "selfdrive/modeld/models/driving.h"

@ -5,9 +5,9 @@
#include <cmath> #include <cmath>
#include <cstring> #include <cstring>
#include "selfdrive/common/clutil.h" #include "common/clutil.h"
#include "selfdrive/common/mat.h" #include "common/mat.h"
#include "selfdrive/common/timing.h" #include "common/timing.h"
ModelFrame::ModelFrame(cl_device_id device_id, cl_context context) { ModelFrame::ModelFrame(cl_device_id device_id, cl_context context) {
input_frames = std::make_unique<float[]>(buf_size); input_frames = std::make_unique<float[]>(buf_size);

@ -12,7 +12,7 @@
#include <CL/cl.h> #include <CL/cl.h>
#endif #endif
#include "selfdrive/common/mat.h" #include "common/mat.h"
#include "selfdrive/modeld/transforms/loadyuv.h" #include "selfdrive/modeld/transforms/loadyuv.h"
#include "selfdrive/modeld/transforms/transform.h" #include "selfdrive/modeld/transforms/transform.h"

@ -2,10 +2,10 @@
#include "libyuv.h" #include "libyuv.h"
#include "selfdrive/common/mat.h" #include "common/mat.h"
#include "selfdrive/common/modeldata.h" #include "common/modeldata.h"
#include "selfdrive/common/params.h" #include "common/params.h"
#include "selfdrive/common/timing.h" #include "common/timing.h"
#include "selfdrive/hardware/hw.h" #include "selfdrive/hardware/hw.h"
#include "selfdrive/modeld/models/dmonitoring.h" #include "selfdrive/modeld/models/dmonitoring.h"

@ -3,7 +3,7 @@
#include <vector> #include <vector>
#include "cereal/messaging/messaging.h" #include "cereal/messaging/messaging.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/modeld/models/commonmodel.h" #include "selfdrive/modeld/models/commonmodel.h"
#include "selfdrive/modeld/runners/run.h" #include "selfdrive/modeld/runners/run.h"

@ -8,10 +8,10 @@
#include <eigen3/Eigen/Dense> #include <eigen3/Eigen/Dense>
#include "selfdrive/common/clutil.h" #include "common/clutil.h"
#include "selfdrive/common/params.h" #include "common/params.h"
#include "selfdrive/common/timing.h" #include "common/timing.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
constexpr float FCW_THRESHOLD_5MS2_HIGH = 0.15; constexpr float FCW_THRESHOLD_5MS2_HIGH = 0.15;
constexpr float FCW_THRESHOLD_5MS2_LOW = 0.05; constexpr float FCW_THRESHOLD_5MS2_LOW = 0.05;

@ -10,9 +10,9 @@
#include "cereal/messaging/messaging.h" #include "cereal/messaging/messaging.h"
#include "cereal/visionipc/visionipc_client.h" #include "cereal/visionipc/visionipc_client.h"
#include "selfdrive/common/mat.h" #include "common/mat.h"
#include "selfdrive/common/modeldata.h" #include "common/modeldata.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/modeld/models/commonmodel.h" #include "selfdrive/modeld/models/commonmodel.h"
#include "selfdrive/modeld/runners/run.h" #include "selfdrive/modeld/runners/run.h"

@ -11,8 +11,8 @@
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/util.h" #include "common/util.h"
ONNXModel::ONNXModel(const char *path, float *_output, size_t _output_size, int runtime, bool _use_extra) { ONNXModel::ONNXModel(const char *path, float *_output, size_t _output_size, int runtime, bool _use_extra) {
LOGD("loading model %s", path); LOGD("loading model %s", path);

@ -6,8 +6,8 @@
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/common/timing.h" #include "common/timing.h"
void PrintErrorStringAndExit() { void PrintErrorStringAndExit() {
std::cerr << zdl::DlSystem::getLastErrorString() << std::endl; std::cerr << zdl::DlSystem::getLastErrorString() << std::endl;

@ -4,8 +4,8 @@
#include <assert.h> #include <assert.h>
#include "thneed.h" #include "thneed.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/common/clutil.h" #include "common/clutil.h"
extern map<cl_program, string> g_program_source; extern map<cl_program, string> g_program_source;

@ -2,8 +2,8 @@
#include <set> #include <set>
#include "json11.hpp" #include "json11.hpp"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/common/clutil.h" #include "common/clutil.h"
#include "selfdrive/modeld/thneed/thneed.h" #include "selfdrive/modeld/thneed/thneed.h"
using namespace json11; using namespace json11;

@ -9,8 +9,8 @@
#include <map> #include <map>
#include <string> #include <string>
#include "selfdrive/common/clutil.h" #include "common/clutil.h"
#include "selfdrive/common/timing.h" #include "common/timing.h"
Thneed *g_thneed = NULL; Thneed *g_thneed = NULL;
int g_fd = -1; int g_fd = -1;

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "selfdrive/common/clutil.h" #include "common/clutil.h"
typedef struct { typedef struct {
int width, height; int width, height;

@ -3,7 +3,7 @@
#include <cassert> #include <cassert>
#include <cstring> #include <cstring>
#include "selfdrive/common/clutil.h" #include "common/clutil.h"
void transform_init(Transform* s, cl_context ctx, cl_device_id device_id) { void transform_init(Transform* s, cl_context ctx, cl_device_id device_id) {
memset(s, 0, sizeof(*s)); memset(s, 0, sizeof(*s));

@ -7,7 +7,7 @@
#include <CL/cl.h> #include <CL/cl.h>
#endif #endif
#include "selfdrive/common/mat.h" #include "common/mat.h"
typedef struct { typedef struct {
cl_kernel krnl; cl_kernel krnl;

@ -1,7 +1,7 @@
#include <sys/resource.h> #include <sys/resource.h>
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/proclogd/proclog.h" #include "selfdrive/proclogd/proclog.h"
ExitHandler do_exit; ExitHandler do_exit;

@ -7,8 +7,8 @@
#include <iterator> #include <iterator>
#include <sstream> #include <sstream>
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/util.h" #include "common/util.h"
namespace Parser { namespace Parser {

@ -1,6 +1,6 @@
#define CATCH_CONFIG_MAIN #define CATCH_CONFIG_MAIN
#include "catch2/catch.hpp" #include "catch2/catch.hpp"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/proclogd/proclog.h" #include "selfdrive/proclogd/proclog.h"
const std::string allowed_states = "RSDTZtWXxKWPI"; const std::string allowed_states = "RSDTZtWXxKWPI";

@ -2,8 +2,8 @@
#include <cassert> #include <cassert>
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/timing.h" #include "common/timing.h"
BMX055_Accel::BMX055_Accel(I2CBus *bus) : I2CSensor(bus) {} BMX055_Accel::BMX055_Accel(I2CBus *bus) : I2CSensor(bus) {}

@ -3,7 +3,7 @@
#include <cassert> #include <cassert>
#include <cmath> #include <cmath>
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#define DEG2RAD(x) ((x) * M_PI / 180.0) #define DEG2RAD(x) ((x) * M_PI / 180.0)

@ -6,8 +6,8 @@
#include <cassert> #include <cassert>
#include <cstdio> #include <cstdio>
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/util.h" #include "common/util.h"
static int16_t compensate_x(trim_data_t trim_data, int16_t mag_data_x, uint16_t data_rhall) { static int16_t compensate_x(trim_data_t trim_data, int16_t mag_data_x, uint16_t data_rhall) {
uint16_t process_comp_x0 = data_rhall; uint16_t process_comp_x0 = data_rhall;

@ -3,8 +3,8 @@
#include <cassert> #include <cassert>
#include "selfdrive/sensord/sensors/bmx055_accel.h" #include "selfdrive/sensord/sensors/bmx055_accel.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/timing.h" #include "common/timing.h"
BMX055_Temp::BMX055_Temp(I2CBus *bus) : I2CSensor(bus) {} BMX055_Temp::BMX055_Temp(I2CBus *bus) : I2CSensor(bus) {}

@ -3,7 +3,7 @@
#include <cstdint> #include <cstdint>
#include "cereal/gen/cpp/log.capnp.h" #include "cereal/gen/cpp/log.capnp.h"
#include "selfdrive/common/i2c.h" #include "common/i2c.h"
#include "selfdrive/sensord/sensors/constants.h" #include "selfdrive/sensord/sensors/constants.h"
#include "selfdrive/sensord/sensors/sensor.h" #include "selfdrive/sensord/sensors/sensor.h"

@ -2,7 +2,7 @@
#include <string> #include <string>
#include "selfdrive/common/timing.h" #include "common/timing.h"
#include "selfdrive/sensord/sensors/constants.h" #include "selfdrive/sensord/sensors/constants.h"
void LightSensor::get_event(cereal::SensorEventData::Builder &event) { void LightSensor::get_event(cereal::SensorEventData::Builder &event) {

@ -2,8 +2,8 @@
#include <cassert> #include <cassert>
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/timing.h" #include "common/timing.h"
LSM6DS3_Accel::LSM6DS3_Accel(I2CBus *bus) : I2CSensor(bus) {} LSM6DS3_Accel::LSM6DS3_Accel(I2CBus *bus) : I2CSensor(bus) {}

@ -3,8 +3,8 @@
#include <cassert> #include <cassert>
#include <cmath> #include <cmath>
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/timing.h" #include "common/timing.h"
#define DEG2RAD(x) ((x) * M_PI / 180.0) #define DEG2RAD(x) ((x) * M_PI / 180.0)

@ -2,8 +2,8 @@
#include <cassert> #include <cassert>
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/timing.h" #include "common/timing.h"
LSM6DS3_Temp::LSM6DS3_Temp(I2CBus *bus) : I2CSensor(bus) {} LSM6DS3_Temp::LSM6DS3_Temp(I2CBus *bus) : I2CSensor(bus) {}

@ -2,8 +2,8 @@
#include <cassert> #include <cassert>
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/timing.h" #include "common/timing.h"
MMC5603NJ_Magn::MMC5603NJ_Magn(I2CBus *bus) : I2CSensor(bus) {} MMC5603NJ_Magn::MMC5603NJ_Magn(I2CBus *bus) : I2CSensor(bus) {}

@ -5,10 +5,10 @@
#include <vector> #include <vector>
#include "cereal/messaging/messaging.h" #include "cereal/messaging/messaging.h"
#include "selfdrive/common/i2c.h" #include "common/i2c.h"
#include "selfdrive/common/swaglog.h" #include "common/swaglog.h"
#include "selfdrive/common/timing.h" #include "common/timing.h"
#include "selfdrive/common/util.h" #include "common/util.h"
#include "selfdrive/sensord/sensors/bmx055_accel.h" #include "selfdrive/sensord/sensors/bmx055_accel.h"
#include "selfdrive/sensord/sensors/bmx055_gyro.h" #include "selfdrive/sensord/sensors/bmx055_gyro.h"
#include "selfdrive/sensord/sensors/bmx055_magn.h" #include "selfdrive/sensord/sensors/bmx055_magn.h"

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save