Merge common/ and selfdrive/common (#24556)
* Merge common/ and selfdrive/common
* fix that
* fix version
* fix unit tests
old-commit-hash: cb8885cffb
This commit is contained in:
4
.github/workflows/selfdrive_tests.yaml
vendored
4
.github/workflows/selfdrive_tests.yaml
vendored
@@ -291,9 +291,9 @@ jobs:
|
||||
$UNIT_TEST selfdrive/hardware/tici && \
|
||||
$UNIT_TEST selfdrive/modeld && \
|
||||
$UNIT_TEST tools/lib/tests && \
|
||||
./common/tests/test_util && \
|
||||
./common/tests/test_swaglog && \
|
||||
./selfdrive/boardd/tests/test_boardd_usbprotocol && \
|
||||
./selfdrive/common/tests/test_util && \
|
||||
./selfdrive/common/tests/test_swaglog && \
|
||||
./selfdrive/loggerd/tests/test_logger &&\
|
||||
./selfdrive/proclogd/tests/test_proclog && \
|
||||
./selfdrive/ui/replay/tests/test_replay && \
|
||||
|
||||
13
SConstruct
13
SConstruct
@@ -130,7 +130,7 @@ else:
|
||||
"#third_party/libyuv/x64/lib",
|
||||
"#third_party/mapbox-gl-native-qt/x86_64",
|
||||
"#cereal",
|
||||
"#selfdrive/common",
|
||||
"#common",
|
||||
"/usr/lib",
|
||||
"/usr/local/lib",
|
||||
]
|
||||
@@ -138,7 +138,7 @@ else:
|
||||
rpath += [
|
||||
Dir("#third_party/snpe/x86_64-linux-clang").abspath,
|
||||
Dir("#cereal").abspath,
|
||||
Dir("#selfdrive/common").abspath
|
||||
Dir("#common").abspath
|
||||
]
|
||||
|
||||
if GetOption('asan'):
|
||||
@@ -156,8 +156,8 @@ if arch != "Darwin":
|
||||
ldflags += ["-Wl,--as-needed", "-Wl,--no-undefined"]
|
||||
|
||||
# Enable swaglog include in submodules
|
||||
cflags += ['-DSWAGLOG="\\"selfdrive/common/swaglog.h\\""']
|
||||
cxxflags += ['-DSWAGLOG="\\"selfdrive/common/swaglog.h\\""']
|
||||
cflags += ['-DSWAGLOG="\\"common/swaglog.h\\""']
|
||||
cxxflags += ['-DSWAGLOG="\\"common/swaglog.h\\""']
|
||||
|
||||
env = Environment(
|
||||
ENV=lenv,
|
||||
@@ -212,7 +212,7 @@ env = Environment(
|
||||
"#third_party",
|
||||
"#opendbc/can",
|
||||
"#selfdrive/boardd",
|
||||
"#selfdrive/common",
|
||||
"#common",
|
||||
],
|
||||
CYTHONCFILESUFFIX=".cpp",
|
||||
COMPILATIONDB_USE_ABSPATH=True,
|
||||
@@ -330,7 +330,7 @@ if GetOption("clazy"):
|
||||
|
||||
Export('env', 'qt_env', 'arch', 'real_arch', 'SHARED', 'USE_WEBCAM')
|
||||
|
||||
SConscript(['selfdrive/common/SConscript'])
|
||||
SConscript(['common/SConscript'])
|
||||
Import('_common', '_gpucommon', '_gpu_libs')
|
||||
|
||||
if SHARED:
|
||||
@@ -384,7 +384,6 @@ SConscript(['opendbc/can/SConscript'])
|
||||
|
||||
SConscript(['third_party/SConscript'])
|
||||
|
||||
SConscript(['common/SConscript'])
|
||||
SConscript(['common/kalman/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('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 <iostream>
|
||||
#include <memory>
|
||||
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/util.h"
|
||||
|
||||
namespace { // helper functions
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include "selfdrive/common/gpio.h"
|
||||
#include "common/gpio.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/util.h"
|
||||
|
||||
// We assume that all pins have already been exported on boot,
|
||||
// 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 <sys/ioctl.h>
|
||||
@@ -8,9 +8,9 @@
|
||||
#include <cstdio>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/util.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/util.h"
|
||||
|
||||
#define UNUSED(x) (void)(x)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include "selfdrive/common/mat.h"
|
||||
#include "common/mat.h"
|
||||
#include "selfdrive/hardware/hw.h"
|
||||
|
||||
const int TRAJECTORY_SIZE = 33;
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "selfdrive/common/params.h"
|
||||
#include "common/params.h"
|
||||
|
||||
#include <dirent.h>
|
||||
#include <sys/file.h>
|
||||
@@ -6,8 +6,8 @@
|
||||
#include <csignal>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/util.h"
|
||||
#include "selfdrive/hardware/hw.h"
|
||||
|
||||
namespace {
|
||||
@@ -4,7 +4,7 @@ from libcpp cimport bool
|
||||
from libcpp.string cimport string
|
||||
import threading
|
||||
|
||||
cdef extern from "selfdrive/common/params.h":
|
||||
cdef extern from "common/params.h":
|
||||
cpdef enum ParamKeyType:
|
||||
PERSISTENT
|
||||
CLEAR_ON_MANAGER_START
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
#include "selfdrive/common/statlog.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/statlog.h"
|
||||
#include "common/util.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <mutex>
|
||||
@@ -2,7 +2,7 @@
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "common/swaglog.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
@@ -13,8 +13,8 @@
|
||||
#include <zmq.h>
|
||||
#include "json11.hpp"
|
||||
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "selfdrive/common/version.h"
|
||||
#include "common/util.h"
|
||||
#include "common/version.h"
|
||||
#include "selfdrive/hardware/hw.h"
|
||||
|
||||
class SwaglogState : public LogState {
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "common/timing.h"
|
||||
|
||||
#define CLOUDLOG_DEBUG 10
|
||||
#define CLOUDLOG_INFO 20
|
||||
2
common/tests/.gitignore
vendored
Normal file
2
common/tests/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
test_util
|
||||
test_swaglog
|
||||
@@ -4,9 +4,9 @@
|
||||
#include "catch2/catch.hpp"
|
||||
|
||||
#include "json11.hpp"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "selfdrive/common/version.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/util.h"
|
||||
#include "common/version.h"
|
||||
#include "selfdrive/hardware/hw.h"
|
||||
|
||||
const char *SWAGLOG_ADDR = "ipc:///tmp/logmessage";
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#include "catch2/catch.hpp"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/util.h"
|
||||
|
||||
std::string random_bytes(int size) {
|
||||
std::random_device rd;
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/util.h"
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "selfdrive/common/visionimg.h"
|
||||
#include "common/visionimg.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "selfdrive/common/watchdog.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/watchdog.h"
|
||||
#include "common/timing.h"
|
||||
#include "common/util.h"
|
||||
|
||||
const std::string watchdog_fn_prefix = "/dev/shm/wd_"; // + <pid>
|
||||
|
||||
@@ -86,7 +86,7 @@ modeld
|
||||
common
|
||||
^^^^^^
|
||||
.. autodoxygenindex::
|
||||
:project: selfdrive_common
|
||||
:project: common
|
||||
|
||||
sensorsd
|
||||
^^^^^^^^
|
||||
|
||||
@@ -58,7 +58,7 @@ rm -f panda/board/obj/panda.bin.signed
|
||||
# include source commit hash and build date in commit
|
||||
GIT_HASH=$(git --git-dir=$SOURCE_DIR/.git rev-parse HEAD)
|
||||
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"
|
||||
git add -f .
|
||||
|
||||
@@ -41,8 +41,8 @@ cd $BUILD_DIR
|
||||
|
||||
rm -f panda/board/obj/panda.bin.signed
|
||||
|
||||
VERSION=$(cat selfdrive/common/version.h | awk -F[\"-] '{print $2}')
|
||||
echo "#define COMMA_VERSION \"$VERSION-release\"" > selfdrive/common/version.h
|
||||
VERSION=$(cat common/version.h | awk -F[\"-] '{print $2}')
|
||||
echo "#define COMMA_VERSION \"$VERSION-release\"" > common/version.h
|
||||
|
||||
echo "[-] committing version $VERSION T=$SECONDS"
|
||||
git add -f .
|
||||
|
||||
@@ -125,34 +125,34 @@ selfdrive/clocksd/clocksd.cc
|
||||
|
||||
selfdrive/debug/*.py
|
||||
|
||||
selfdrive/common/SConscript
|
||||
selfdrive/common/version.h
|
||||
common/SConscript
|
||||
common/version.h
|
||||
|
||||
selfdrive/common/swaglog.h
|
||||
selfdrive/common/swaglog.cc
|
||||
selfdrive/common/statlog.h
|
||||
selfdrive/common/statlog.cc
|
||||
selfdrive/common/util.cc
|
||||
selfdrive/common/util.h
|
||||
selfdrive/common/queue.h
|
||||
selfdrive/common/clutil.cc
|
||||
selfdrive/common/clutil.h
|
||||
selfdrive/common/params.h
|
||||
selfdrive/common/params.cc
|
||||
selfdrive/common/watchdog.cc
|
||||
selfdrive/common/watchdog.h
|
||||
common/swaglog.h
|
||||
common/swaglog.cc
|
||||
common/statlog.h
|
||||
common/statlog.cc
|
||||
common/util.cc
|
||||
common/util.h
|
||||
common/queue.h
|
||||
common/clutil.cc
|
||||
common/clutil.h
|
||||
common/params.h
|
||||
common/params.cc
|
||||
common/watchdog.cc
|
||||
common/watchdog.h
|
||||
|
||||
selfdrive/common/modeldata.h
|
||||
selfdrive/common/mat.h
|
||||
selfdrive/common/timing.h
|
||||
common/modeldata.h
|
||||
common/mat.h
|
||||
common/timing.h
|
||||
|
||||
selfdrive/common/visionimg.cc
|
||||
selfdrive/common/visionimg.h
|
||||
common/visionimg.cc
|
||||
common/visionimg.h
|
||||
|
||||
selfdrive/common/gpio.cc
|
||||
selfdrive/common/gpio.h
|
||||
selfdrive/common/i2c.cc
|
||||
selfdrive/common/i2c.h
|
||||
common/gpio.cc
|
||||
common/gpio.h
|
||||
common/i2c.cc
|
||||
common/i2c.h
|
||||
|
||||
|
||||
selfdrive/controls/__init__.py
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <pthread.h>
|
||||
#include <arm_neon.h>
|
||||
#include <sys/sysinfo.h>
|
||||
#include "../selfdrive/common/timing.h"
|
||||
#include "../common/timing.h"
|
||||
|
||||
int get_nprocs(void);
|
||||
double *ttime, *oout;
|
||||
|
||||
@@ -23,10 +23,10 @@
|
||||
|
||||
#include "cereal/gen/cpp/car.capnp.h"
|
||||
#include "cereal/messaging/messaging.h"
|
||||
#include "selfdrive/common/params.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/params.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/timing.h"
|
||||
#include "common/util.h"
|
||||
#include "selfdrive/hardware/hw.h"
|
||||
|
||||
#include "selfdrive/boardd/pigeon.h"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include <cassert>
|
||||
|
||||
#include "selfdrive/boardd/boardd.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/util.h"
|
||||
#include "selfdrive/hardware/hw.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
|
||||
#include "cereal/messaging/messaging.h"
|
||||
#include "panda/board/dlc_to_len.h"
|
||||
#include "selfdrive/common/gpio.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/gpio.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/util.h"
|
||||
|
||||
static int init_usb_ctx(libusb_context **context) {
|
||||
assert(context != nullptr);
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
#include <cerrno>
|
||||
#include <optional>
|
||||
|
||||
#include "selfdrive/common/gpio.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/gpio.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/util.h"
|
||||
#include "selfdrive/locationd/ublox_msg.h"
|
||||
|
||||
// Termios on macos doesn't define all baud rate constants
|
||||
|
||||
Binary file not shown.
@@ -11,10 +11,10 @@
|
||||
#include <jpeglib.h>
|
||||
|
||||
#include "selfdrive/camerad/imgproc/utils.h"
|
||||
#include "selfdrive/common/clutil.h"
|
||||
#include "selfdrive/common/modeldata.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/clutil.h"
|
||||
#include "common/modeldata.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/util.h"
|
||||
#include "selfdrive/hardware/hw.h"
|
||||
|
||||
#if QCOM2
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
#include "cereal/visionipc/visionipc.h"
|
||||
#include "cereal/visionipc/visionipc_server.h"
|
||||
#include "selfdrive/camerad/transforms/rgb_to_yuv.h"
|
||||
#include "selfdrive/common/mat.h"
|
||||
#include "selfdrive/common/queue.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/visionimg.h"
|
||||
#include "common/mat.h"
|
||||
#include "common/queue.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/visionimg.h"
|
||||
#include "selfdrive/hardware/hw.h"
|
||||
|
||||
#define CAMERA_ID_IMX298 0
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "media/cam_sensor.h"
|
||||
#include "media/cam_sensor_cmn_header.h"
|
||||
#include "media/cam_sync.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "selfdrive/camerad/cameras/sensor2_i2c.h"
|
||||
|
||||
// For debugging:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <media/cam_req_mgr.h>
|
||||
|
||||
#include "selfdrive/camerad/cameras/camera_common.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/util.h"
|
||||
|
||||
#define FRAME_BUF_COUNT 4
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#include <cassert>
|
||||
#include <thread>
|
||||
|
||||
#include "selfdrive/common/clutil.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/clutil.h"
|
||||
#include "common/util.h"
|
||||
|
||||
extern ExitHandler do_exit;
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
#include <opencv2/videoio.hpp>
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#include "selfdrive/common/clutil.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/clutil.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/timing.h"
|
||||
#include "common/util.h"
|
||||
|
||||
// id of the video capturing device
|
||||
const int ROAD_CAMERA_ID = util::getenv("ROADCAM_ID", 1);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
#include "selfdrive/common/clutil.h"
|
||||
#include "common/clutil.h"
|
||||
|
||||
#define NUM_SEGMENTS_X 8
|
||||
#define NUM_SEGMENTS_Y 6
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "selfdrive/common/params.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/params.h"
|
||||
#include "common/util.h"
|
||||
#include "selfdrive/hardware/hw.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/util.h"
|
||||
#include "selfdrive/camerad/cameras/camera_common.h"
|
||||
|
||||
// needed by camera_common.cc
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "selfdrive/common/clutil.h"
|
||||
#include "common/clutil.h"
|
||||
|
||||
class Rgb2Yuv {
|
||||
public:
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
#include "libyuv.h"
|
||||
#include "selfdrive/camerad/transforms/rgb_to_yuv.h"
|
||||
#include "selfdrive/common/clutil.h"
|
||||
#include "common/clutil.h"
|
||||
|
||||
static inline double millis_since_boot() {
|
||||
struct timespec t;
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
#include <chrono>
|
||||
|
||||
#include "cereal/messaging/messaging.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/timing.h"
|
||||
#include "common/util.h"
|
||||
|
||||
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
|
||||
|
||||
#include "selfdrive/hardware/base.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/util.h"
|
||||
|
||||
#if QCOM2
|
||||
#include "selfdrive/hardware/tici/hardware.h"
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#include <cstdlib>
|
||||
#include <fstream>
|
||||
|
||||
#include "selfdrive/common/params.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/params.h"
|
||||
#include "common/util.h"
|
||||
#include "selfdrive/hardware/base.h"
|
||||
|
||||
class HardwareTici : public HardwareNone {
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
#include "cereal/messaging/messaging.h"
|
||||
#include "common/transformations/coordinates.hpp"
|
||||
#include "common/transformations/orientation.hpp"
|
||||
#include "selfdrive/common/params.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/params.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/timing.h"
|
||||
#include "common/util.h"
|
||||
|
||||
#include "selfdrive/sensord/sensors/constants.h"
|
||||
#define VISION_DECIMATION 2
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <ctime>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "common/swaglog.h"
|
||||
|
||||
const double gpsPi = 3.1415926535898;
|
||||
#define UBLOX_MSG_SIZE(hdr) (*(uint16_t *)&hdr[4])
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <ctime>
|
||||
|
||||
#include "cereal/messaging/messaging.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/util.h"
|
||||
#include "selfdrive/locationd/generated/gps.h"
|
||||
#include "selfdrive/locationd/generated/ubx.h"
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#include <kaitai/kaitaistream.h>
|
||||
|
||||
#include "cereal/messaging/messaging.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/util.h"
|
||||
#include "selfdrive/locationd/ublox_msg.h"
|
||||
|
||||
ExitHandler do_exit;
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
#include "json11.hpp"
|
||||
|
||||
#include "cereal/messaging/messaging.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/timing.h"
|
||||
#include "common/util.h"
|
||||
|
||||
ExitHandler do_exit;
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "cereal/messaging/messaging.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "selfdrive/loggerd/logger.h"
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "cereal/messaging/messaging.h"
|
||||
#include "cereal/visionipc/visionipc.h"
|
||||
#include "selfdrive/common/queue.h"
|
||||
#include "common/queue.h"
|
||||
#include "selfdrive/loggerd/video_writer.h"
|
||||
#include "selfdrive/camerad/cameras/camera_common.h"
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ extern "C" {
|
||||
#include <libavutil/imgutils.h>
|
||||
}
|
||||
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/util.h"
|
||||
|
||||
const int env_debug_encoder = (getenv("DEBUG_ENCODER") != NULL) ? atoi(getenv("DEBUG_ENCODER")) : 0;
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#include <poll.h>
|
||||
|
||||
#include "selfdrive/loggerd/encoder/v4l_encoder.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "common/util.h"
|
||||
#include "common/timing.h"
|
||||
|
||||
#include "libyuv.h"
|
||||
#include "msm_media_info.h"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "selfdrive/common/queue.h"
|
||||
#include "common/queue.h"
|
||||
#include "selfdrive/loggerd/encoder/encoder.h"
|
||||
|
||||
#define BUF_IN_COUNT 7
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
#include <iostream>
|
||||
#include <streambuf>
|
||||
|
||||
#include "selfdrive/common/params.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/version.h"
|
||||
#include "common/params.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/version.h"
|
||||
|
||||
// ***** logging helpers *****
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
#include <kj/array.h>
|
||||
|
||||
#include "cereal/messaging/messaging.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "common/util.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "selfdrive/hardware/hw.h"
|
||||
|
||||
const std::string LOG_ROOT = Path::log_root();
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
#include "cereal/visionipc/visionipc.h"
|
||||
#include "cereal/visionipc/visionipc_client.h"
|
||||
#include "selfdrive/camerad/cameras/camera_common.h"
|
||||
#include "selfdrive/common/params.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/params.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/timing.h"
|
||||
#include "common/util.h"
|
||||
#include "selfdrive/hardware/hw.h"
|
||||
|
||||
#include "selfdrive/loggerd/encoder/encoder.h"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "catch2/catch.hpp"
|
||||
#include "cereal/messaging/messaging.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/util.h"
|
||||
#include "selfdrive/loggerd/logger.h"
|
||||
#include "selfdrive/ui/replay/util.h"
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#include <cstdlib>
|
||||
|
||||
#include "selfdrive/loggerd/video_writer.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/swaglog.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)
|
||||
: remuxing(remuxing) {
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
#include <cstdlib>
|
||||
|
||||
#include "cereal/visionipc/visionipc_client.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/util.h"
|
||||
#include "selfdrive/modeld/models/dmonitoring.h"
|
||||
|
||||
ExitHandler do_exit;
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
|
||||
#include "cereal/messaging/messaging.h"
|
||||
#include "cereal/visionipc/visionipc_client.h"
|
||||
#include "selfdrive/common/clutil.h"
|
||||
#include "selfdrive/common/params.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/clutil.h"
|
||||
#include "common/params.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/util.h"
|
||||
#include "selfdrive/hardware/hw.h"
|
||||
#include "selfdrive/modeld/models/driving.h"
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
|
||||
#include "selfdrive/common/clutil.h"
|
||||
#include "selfdrive/common/mat.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "common/clutil.h"
|
||||
#include "common/mat.h"
|
||||
#include "common/timing.h"
|
||||
|
||||
ModelFrame::ModelFrame(cl_device_id device_id, cl_context context) {
|
||||
input_frames = std::make_unique<float[]>(buf_size);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <CL/cl.h>
|
||||
#endif
|
||||
|
||||
#include "selfdrive/common/mat.h"
|
||||
#include "common/mat.h"
|
||||
#include "selfdrive/modeld/transforms/loadyuv.h"
|
||||
#include "selfdrive/modeld/transforms/transform.h"
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
#include "libyuv.h"
|
||||
|
||||
#include "selfdrive/common/mat.h"
|
||||
#include "selfdrive/common/modeldata.h"
|
||||
#include "selfdrive/common/params.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "common/mat.h"
|
||||
#include "common/modeldata.h"
|
||||
#include "common/params.h"
|
||||
#include "common/timing.h"
|
||||
#include "selfdrive/hardware/hw.h"
|
||||
|
||||
#include "selfdrive/modeld/models/dmonitoring.h"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "cereal/messaging/messaging.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/util.h"
|
||||
#include "selfdrive/modeld/models/commonmodel.h"
|
||||
#include "selfdrive/modeld/runners/run.h"
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
|
||||
#include <eigen3/Eigen/Dense>
|
||||
|
||||
#include "selfdrive/common/clutil.h"
|
||||
#include "selfdrive/common/params.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "common/clutil.h"
|
||||
#include "common/params.h"
|
||||
#include "common/timing.h"
|
||||
#include "common/swaglog.h"
|
||||
|
||||
constexpr float FCW_THRESHOLD_5MS2_HIGH = 0.15;
|
||||
constexpr float FCW_THRESHOLD_5MS2_LOW = 0.05;
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
|
||||
#include "cereal/messaging/messaging.h"
|
||||
#include "cereal/visionipc/visionipc_client.h"
|
||||
#include "selfdrive/common/mat.h"
|
||||
#include "selfdrive/common/modeldata.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/mat.h"
|
||||
#include "common/modeldata.h"
|
||||
#include "common/util.h"
|
||||
#include "selfdrive/modeld/models/commonmodel.h"
|
||||
#include "selfdrive/modeld/runners/run.h"
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/util.h"
|
||||
|
||||
ONNXModel::ONNXModel(const char *path, float *_output, size_t _output_size, int runtime, bool _use_extra) {
|
||||
LOGD("loading model %s", path);
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "common/util.h"
|
||||
#include "common/timing.h"
|
||||
|
||||
void PrintErrorStringAndExit() {
|
||||
std::cerr << zdl::DlSystem::getLastErrorString() << std::endl;
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#include <assert.h>
|
||||
#include "thneed.h"
|
||||
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "selfdrive/common/clutil.h"
|
||||
#include "common/util.h"
|
||||
#include "common/clutil.h"
|
||||
|
||||
extern map<cl_program, string> g_program_source;
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#include <set>
|
||||
|
||||
#include "json11.hpp"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "selfdrive/common/clutil.h"
|
||||
#include "common/util.h"
|
||||
#include "common/clutil.h"
|
||||
#include "selfdrive/modeld/thneed/thneed.h"
|
||||
using namespace json11;
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "selfdrive/common/clutil.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "common/clutil.h"
|
||||
#include "common/timing.h"
|
||||
|
||||
Thneed *g_thneed = NULL;
|
||||
int g_fd = -1;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "selfdrive/common/clutil.h"
|
||||
#include "common/clutil.h"
|
||||
|
||||
typedef struct {
|
||||
int width, height;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
|
||||
#include "selfdrive/common/clutil.h"
|
||||
#include "common/clutil.h"
|
||||
|
||||
void transform_init(Transform* s, cl_context ctx, cl_device_id device_id) {
|
||||
memset(s, 0, sizeof(*s));
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <CL/cl.h>
|
||||
#endif
|
||||
|
||||
#include "selfdrive/common/mat.h"
|
||||
#include "common/mat.h"
|
||||
|
||||
typedef struct {
|
||||
cl_kernel krnl;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
#include <sys/resource.h>
|
||||
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/util.h"
|
||||
#include "selfdrive/proclogd/proclog.h"
|
||||
|
||||
ExitHandler do_exit;
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
#include <iterator>
|
||||
#include <sstream>
|
||||
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/util.h"
|
||||
|
||||
namespace Parser {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#include "catch2/catch.hpp"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/util.h"
|
||||
#include "selfdrive/proclogd/proclog.h"
|
||||
|
||||
const std::string allowed_states = "RSDTZtWXxKWPI";
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/timing.h"
|
||||
|
||||
BMX055_Accel::BMX055_Accel(I2CBus *bus) : I2CSensor(bus) {}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "common/swaglog.h"
|
||||
|
||||
#define DEG2RAD(x) ((x) * M_PI / 180.0)
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#include <cassert>
|
||||
#include <cstdio>
|
||||
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/util.h"
|
||||
|
||||
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;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#include <cassert>
|
||||
|
||||
#include "selfdrive/sensord/sensors/bmx055_accel.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/timing.h"
|
||||
|
||||
BMX055_Temp::BMX055_Temp(I2CBus *bus) : I2CSensor(bus) {}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <cstdint>
|
||||
|
||||
#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/sensor.h"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "common/timing.h"
|
||||
#include "selfdrive/sensord/sensors/constants.h"
|
||||
|
||||
void LightSensor::get_event(cereal::SensorEventData::Builder &event) {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/timing.h"
|
||||
|
||||
LSM6DS3_Accel::LSM6DS3_Accel(I2CBus *bus) : I2CSensor(bus) {}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/timing.h"
|
||||
|
||||
#define DEG2RAD(x) ((x) * M_PI / 180.0)
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/timing.h"
|
||||
|
||||
LSM6DS3_Temp::LSM6DS3_Temp(I2CBus *bus) : I2CSensor(bus) {}
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/timing.h"
|
||||
|
||||
MMC5603NJ_Magn::MMC5603NJ_Magn(I2CBus *bus) : I2CSensor(bus) {}
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
#include <vector>
|
||||
|
||||
#include "cereal/messaging/messaging.h"
|
||||
#include "selfdrive/common/i2c.h"
|
||||
#include "selfdrive/common/swaglog.h"
|
||||
#include "selfdrive/common/timing.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "common/i2c.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/timing.h"
|
||||
#include "common/util.h"
|
||||
#include "selfdrive/sensord/sensors/bmx055_accel.h"
|
||||
#include "selfdrive/sensord/sensors/bmx055_gyro.h"
|
||||
#include "selfdrive/sensord/sensors/bmx055_magn.h"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user