code stringlengths 1 1.05M | repo_name stringlengths 6 83 | path stringlengths 3 242 | language stringclasses 222
values | license stringclasses 20
values | size int64 1 1.05M |
|---|---|---|---|---|---|
class DataUnreadableError(Exception):
pass
| 2301_81045437/openpilot | tools/lib/exceptions.py | Python | mit | 45 |
import os
import socket
from urllib.parse import urlparse
from openpilot.tools.lib.url_file import URLFile
DATA_ENDPOINT = os.getenv("DATA_ENDPOINT", "http://data-raw.comma.internal/")
def internal_source_available():
try:
hostname = urlparse(DATA_ENDPOINT).hostname
port = urlparse(DATA_ENDPOINT).port or ... | 2301_81045437/openpilot | tools/lib/filereader.py | Python | mit | 955 |
import json
import os
import pickle
import struct
import subprocess
import threading
from enum import IntEnum
from functools import wraps
import numpy as np
from lru import LRU
import _io
from openpilot.tools.lib.cache import cache_path_for_file_path, DEFAULT_CACHE_DIR
from openpilot.tools.lib.exceptions import DataU... | 2301_81045437/openpilot | tools/lib/framereader.py | Python | mit | 14,860 |
import bz2
# regex patterns
class RE:
DONGLE_ID = r'(?P<dongle_id>[a-f0-9]{16})'
TIMESTAMP = r'(?P<timestamp>[0-9]{4}-[0-9]{2}-[0-9]{2}--[0-9]{2}-[0-9]{2}-[0-9]{2})'
LOG_ID_V2 = r'(?P<count>[a-f0-9]{8})--(?P<uid>[a-z0-9]{10})'
LOG_ID = fr'(?P<log_id>(?:{TIMESTAMP}|{LOG_ID_V2}))'
ROUTE_NAME = fr'(?P<route_na... | 2301_81045437/openpilot | tools/lib/helpers.py | Python | mit | 989 |
#!/usr/bin/env python
import sys
import termios
import atexit
from select import select
STDIN_FD = sys.stdin.fileno()
class KBHit:
def __init__(self) -> None:
''' Creates a KBHit object that you can call to do various keyboard things.
'''
self.set_kbhit_terminal()
def set_kbhit_terminal(self) -> Non... | 2301_81045437/openpilot | tools/lib/kbhit.py | Python | mit | 1,873 |
import os
from cereal import log as capnp_log, messaging
from cereal.services import SERVICE_LIST
from openpilot.tools.lib.logreader import LogIterable, RawLogIterable
ALL_SERVICES = list(SERVICE_LIST.keys())
def raw_live_logreader(services: list[str] = ALL_SERVICES, addr: str = '127.0.0.1') -> RawLogIterable:
if... | 2301_81045437/openpilot | tools/lib/live_logreader.py | Python | mit | 830 |
#!/usr/bin/env python3
import bz2
from functools import partial
import multiprocessing
import capnp
import enum
import os
import pathlib
import sys
import tqdm
import urllib.parse
import warnings
from collections.abc import Callable, Iterable, Iterator
from urllib.parse import parse_qs, urlparse
from cereal import lo... | 2301_81045437/openpilot | tools/lib/logreader.py | Python | mit | 9,865 |
from openpilot.tools.lib.openpilotcontainers import OpenpilotCIContainer
def get_url(*args, **kwargs):
return OpenpilotCIContainer.get_url(*args, **kwargs)
def upload_file(*args, **kwargs):
return OpenpilotCIContainer.upload_file(*args, **kwargs)
def upload_bytes(*args, **kwargs):
return OpenpilotCIContainer.u... | 2301_81045437/openpilot | tools/lib/openpilotci.py | Python | mit | 391 |
#!/usr/bin/env python3
from openpilot.tools.lib.azure_container import AzureContainer
OpenpilotCIContainer = AzureContainer("commadataci", "openpilotci")
DataCIContainer = AzureContainer("commadataci", "commadataci")
DataProdContainer = AzureContainer("commadata2", "commadata2")
| 2301_81045437/openpilot | tools/lib/openpilotcontainers.py | Python | mit | 281 |
import os
import re
from functools import cache
from urllib.parse import urlparse
from collections import defaultdict
from itertools import chain
from openpilot.tools.lib.auth_config import get_token
from openpilot.tools.lib.api import CommaApi
from openpilot.tools.lib.helpers import RE
QLOG_FILENAMES = ['qlog', 'qlo... | 2301_81045437/openpilot | tools/lib/route.py | Python | mit | 10,899 |
# Utilities for sanitizing routes of only essential data for testing car ports and doing validation.
from openpilot.tools.lib.logreader import LogIterable, LogMessage
def sanitize_vin(vin: str):
# (last 6 digits of vin are serial number https://en.wikipedia.org/wiki/Vehicle_identification_number)
VIN_SENSITIVE =... | 2301_81045437/openpilot | tools/lib/sanitizer.py | Python | mit | 848 |
import logging
import os
import socket
import time
from hashlib import sha256
from urllib3 import PoolManager, Retry
from urllib3.response import BaseHTTPResponse
from urllib3.util import Timeout
from openpilot.common.file_helpers import atomic_write_in_dir
from openpilot.system.hardware.hw import Paths
# Cache chunk... | 2301_81045437/openpilot | tools/lib/url_file.py | Python | mit | 5,619 |
#!/usr/bin/env python3
import argparse
import os
import struct
from enum import IntEnum
from openpilot.tools.lib.filereader import FileReader
DEBUG = int(os.getenv("DEBUG", "0"))
# compare to ffmpeg parsing
# ffmpeg -i <input.hevc> -c copy -bsf:v trace_headers -f null - 2>&1 | grep -B4 -A32 '] 0 '
# H.265 specifica... | 2301_81045437/openpilot | tools/lib/vidindex.py | Python | mit | 11,840 |
#!/usr/bin/env bash
set -e
if [ -z "$SKIP_PROMPT" ]; then
echo "--------------- macOS support ---------------"
echo "Running openpilot natively on macOS is not officially supported."
echo "It might build, some parts of it might work, but it's not fully tested, so there might be some issues."
echo
echo ... | 2301_81045437/openpilot | tools/mac_setup.sh | Shell | mit | 3,432 |
#!/usr/bin/env python3
import os
import sys
import platform
import shutil
import subprocess
import tarfile
import tempfile
import requests
import argparse
from functools import partial
from openpilot.common.basedir import BASEDIR
from openpilot.selfdrive.car.fingerprints import MIGRATION
from openpilot.tools.lib.helpe... | 2301_81045437/openpilot | tools/plotjuggler/juggle.py | Python | mit | 4,827 |
#!/usr/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd $DIR
if [ ! -d "$DIR/clpeak" ]; then
git clone https://github.com/krrishnarraj/clpeak.git
cd clpeak
git fetch
git checkout ec2d3e70e1abc7738b81f9277c7af79d89b2133b
git reset --hard origin/master
git submodule updat... | 2301_81045437/openpilot | tools/profiling/clpeak/build.sh | Shell | mit | 457 |
#!/usr/bin/bash
set -e
cd /sys/kernel/tracing
echo 1 > tracing_on
echo boot > trace_clock
echo 1000 > buffer_size_kb
# /sys/kernel/tracing/available_events
echo 1 > events/irq/enable
echo 1 > events/sched/enable
echo 1 > events/kgsl/enable
echo 1 > events/camera/enable
echo 1 > events/workqueue/enable
echo > trace
... | 2301_81045437/openpilot | tools/profiling/ftrace.sh | Shell | mit | 409 |
#!/bin/bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd $DIR
if [ ! -d palanteer ]; then
git clone https://github.com/dfeneyrou/palanteer
pip install wheel
sudo apt install libunwind-dev libdw-dev
fi
cd palanteer
git pull
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Re... | 2301_81045437/openpilot | tools/profiling/palanteer/setup.sh | Shell | mit | 430 |
#!/usr/bin/bash
if [ ! -d perfetto ]; then
git clone https://android.googlesource.com/platform/external/perfetto/
fi
cd perfetto
tools/install-build-deps --linux-arm
tools/gn gen --args='is_debug=false target_os="linux" target_cpu="arm64"' out/linux
tools/ninja -C out/linux tracebox traced traced_probes perfetto
| 2301_81045437/openpilot | tools/profiling/perfetto/build.sh | Shell | mit | 319 |
#!/usr/bin/bash
DEST=tici:/data/openpilot/selfdrive/debug/profiling/perfetto
scp -r perfetto/out/linux/tracebox $DEST
scp -r perfetto/test/configs $DEST
| 2301_81045437/openpilot | tools/profiling/perfetto/copy.sh | Shell | mit | 155 |
#!/usr/bin/bash
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd $DIR
OUT=trace_
sudo ./tracebox -o $OUT --txt -c configs/scheduling.cfg
sudo chown $USER:$USER $OUT
| 2301_81045437/openpilot | tools/profiling/perfetto/record.sh | Shell | mit | 184 |
#!/usr/bin/bash
curl -LO https://get.perfetto.dev/trace_processor
chmod +x ./trace_processor
./trace_processor --httpd
| 2301_81045437/openpilot | tools/profiling/perfetto/server.sh | Shell | mit | 121 |
#!/usr/bin/bash
DEST=tici:/data/openpilot/selfdrive/debug/profiling/perfetto
scp tici:/data/openpilot/selfdrive/debug/profiling/perfetto/trace_* .
| 2301_81045437/openpilot | tools/profiling/perfetto/traces.sh | Shell | mit | 149 |
#!/usr/bin/env bash
set -e
cd "$(dirname "$0")"
# find process with name passed in (excluding this process)
for PID in $(pgrep -f $1); do
if [ "$PID" != "$$" ]; then
ps -p $PID -o args
TRACE_PID=$PID
break
fi
done
if [ -z "$TRACE_PID" ]; then
echo "could not find PID for $1"
exit 1
fi
sudo env P... | 2301_81045437/openpilot | tools/profiling/py-spy/profile.sh | Shell | mit | 431 |
#!/bin/bash
# TODO: there's probably a better way to do this
cd SnapdragonProfiler/service
mv android real_android
ln -s agl/ android
| 2301_81045437/openpilot | tools/profiling/snapdragon/setup-agnos.sh | Shell | mit | 136 |
#!/bin/bash
# install depends
sudo apt update
sudo apt-get install libc++1 libc++abi1 default-jre android-tools-adb gtk-sharp2
# setup mono
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
sudo apt install apt-transport-https ca-certificates
echo "deb htt... | 2301_81045437/openpilot | tools/profiling/snapdragon/setup-profiler.sh | Shell | mit | 610 |
#!/usr/bin/bash
set -e
RUBYOPT="-W0" irqtop -d1 -R
| 2301_81045437/openpilot | tools/profiling/watch-irqs.sh | Shell | mit | 52 |
Import('env', 'qt_env', 'arch', 'common', 'messaging', 'visionipc', 'cereal')
base_frameworks = qt_env['FRAMEWORKS']
base_libs = [common, messaging, cereal, visionipc, 'zmq',
'capnp', 'kj', 'm', 'ssl', 'crypto', 'pthread', 'qt_util'] + qt_env["LIBS"]
if arch == "Darwin":
base_frameworks.append('OpenCL'... | 2301_81045437/openpilot | tools/replay/SConscript | Python | mit | 947 |
#include "tools/replay/camera.h"
#include <capnp/dynamic.h>
#include <cassert>
#include "third_party/linux/include/msm_media_info.h"
#include "tools/replay/util.h"
const int BUFFER_COUNT = 40;
std::tuple<size_t, size_t, size_t> get_nv12_info(int width, int height) {
int nv12_width = VENUS_Y_STRIDE(COLOR_FMT_NV12,... | 2301_81045437/openpilot | tools/replay/camera.cc | C++ | mit | 3,855 |
#pragma once
#include <memory>
#include <set>
#include <tuple>
#include <utility>
#include "cereal/visionipc/visionipc_server.h"
#include "common/queue.h"
#include "tools/replay/framereader.h"
#include "tools/replay/logreader.h"
std::tuple<size_t, size_t, size_t> get_nv12_info(int width, int height);
class CameraSe... | 2301_81045437/openpilot | tools/replay/camera.h | C++ | mit | 1,238 |
#!/usr/bin/env python3
import argparse
import os
import time
import usb1
import threading
os.environ['FILEREADER_CACHE'] = '1'
from openpilot.common.realtime import config_realtime_process, Ratekeeper, DT_CTRL
from openpilot.selfdrive.boardd.boardd import can_capnp_to_can_list
from openpilot.tools.lib.logreader impor... | 2301_81045437/openpilot | tools/replay/can_replay.py | Python | mit | 3,214 |
#include "tools/replay/consoleui.h"
#include <initializer_list>
#include <string>
#include <tuple>
#include <utility>
#include <QApplication>
#include "common/util.h"
#include "common/version.h"
namespace {
const int BORDER_SIZE = 3;
const std::initializer_list<std::pair<std::string, std::string>> keyboard_shortc... | 2301_81045437/openpilot | tools/replay/consoleui.cc | C++ | mit | 12,114 |
#pragma once
#include <array>
#include <QBasicTimer>
#include <QObject>
#include <QSocketNotifier>
#include <QTimer>
#include <QTimerEvent>
#include "tools/replay/replay.h"
#include <ncurses.h>
class ConsoleUI : public QObject {
Q_OBJECT
public:
ConsoleUI(Replay *replay, QObject *parent = 0);
~ConsoleUI();
... | 2301_81045437/openpilot | tools/replay/consoleui.h | C++ | mit | 1,352 |
#include "tools/replay/filereader.h"
#include <fstream>
#include "common/util.h"
#include "system/hardware/hw.h"
#include "tools/replay/util.h"
std::string cacheFilePath(const std::string &url) {
static std::string cache_path = [] {
const std::string comma_cache = Path::download_cache_root();
util::create_... | 2301_81045437/openpilot | tools/replay/filereader.cc | C++ | mit | 1,478 |
#pragma once
#include <atomic>
#include <string>
class FileReader {
public:
FileReader(bool cache_to_local, size_t chunk_size = 0, int retries = 3)
: cache_to_local_(cache_to_local), chunk_size_(chunk_size), max_retries_(retries) {}
virtual ~FileReader() {}
std::string read(const std::string &file, std::a... | 2301_81045437/openpilot | tools/replay/filereader.h | C++ | mit | 556 |
#include "tools/replay/framereader.h"
#include <map>
#include <memory>
#include <tuple>
#include <utility>
#include "common/util.h"
#include "third_party/libyuv/include/libyuv.h"
#include "tools/replay/util.h"
#ifdef __APPLE__
#define HW_DEVICE_TYPE AV_HWDEVICE_TYPE_VIDEOTOOLBOX
#define HW_PIX_FMT AV_PIX_FMT_VIDEOTO... | 2301_81045437/openpilot | tools/replay/framereader.cc | C++ | mit | 7,237 |
#pragma once
#include <string>
#include <vector>
#include "cereal/visionipc/visionbuf.h"
#include "system/camerad/cameras/camera_common.h"
#include "tools/replay/filereader.h"
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
}
class VideoDecoder;
class FrameReader {
public:
FrameRea... | 2301_81045437/openpilot | tools/replay/framereader.h | C++ | mit | 1,533 |
import itertools
from typing import Any
import matplotlib.pyplot as plt
import numpy as np
import pygame
from matplotlib.backends.backend_agg import FigureCanvasAgg
from openpilot.common.transformations.camera import get_view_frame_from_calib_frame
from openpilot.selfdrive.controls.radard import RADAR_TO_CAMERA
RE... | 2301_81045437/openpilot | tools/replay/lib/ui_helpers.py | Python | mit | 7,331 |
#include "tools/replay/logreader.h"
#include <algorithm>
#include <utility>
#include "tools/replay/filereader.h"
#include "tools/replay/util.h"
bool LogReader::load(const std::string &url, std::atomic<bool> *abort, bool local_cache, int chunk_size, int retries) {
std::string data = FileReader(local_cache, chunk_siz... | 2301_81045437/openpilot | tools/replay/logreader.cc | C++ | mit | 2,480 |
#pragma once
#include <string>
#include <vector>
#include "cereal/gen/cpp/log.capnp.h"
#include "system/camerad/cameras/camera_common.h"
#include "tools/replay/util.h"
const CameraType ALL_CAMERAS[] = {RoadCam, DriverCam, WideRoadCam};
const int MAX_CAMERAS = std::size(ALL_CAMERAS);
class Event {
public:
Event(ce... | 2301_81045437/openpilot | tools/replay/logreader.h | C++ | mit | 1,244 |
#include <QApplication>
#include <QCommandLineParser>
#include "common/prefix.h"
#include "tools/replay/consoleui.h"
#include "tools/replay/replay.h"
int main(int argc, char *argv[]) {
#ifdef __APPLE__
// With all sockets opened, we might hit the default limit of 256 on macOS
util::set_file_descriptor_limit(1024)... | 2301_81045437/openpilot | tools/replay/main.cc | C++ | mit | 3,465 |
#include "tools/replay/replay.h"
#include <QDebug>
#include <QtConcurrent>
#include <capnp/dynamic.h>
#include <csignal>
#include "cereal/services.h"
#include "common/params.h"
#include "common/timing.h"
#include "tools/replay/util.h"
static void interrupt_sleep_handler(int signal) {}
Replay::Replay(QString route, Q... | 2301_81045437/openpilot | tools/replay/replay.cc | C++ | mit | 18,050 |
#pragma once
#include <algorithm>
#include <map>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#include <utility>
#include <QThread>
#include "tools/replay/camera.h"
#include "tools/replay/route.h"
const QString DEMO_ROUTE = "a2a0ccea32023010|2023-07-27--1... | 2301_81045437/openpilot | tools/replay/replay.h | C++ | mit | 5,638 |
#include "tools/replay/route.h"
#include <QDir>
#include <QEventLoop>
#include <QJsonArray>
#include <QJsonDocument>
#include <QRegularExpression>
#include <QtConcurrent>
#include <array>
#include "selfdrive/ui/qt/api.h"
#include "system/hardware/hw.h"
#include "tools/replay/replay.h"
#include "tools/replay/util.h"
... | 2301_81045437/openpilot | tools/replay/route.cc | C++ | mit | 6,149 |
#pragma once
#include <map>
#include <memory>
#include <string>
#include <vector>
#include <QDateTime>
#include <QFutureSynchronizer>
#include "tools/replay/framereader.h"
#include "tools/replay/logreader.h"
#include "tools/replay/util.h"
struct RouteIdentifier {
QString dongle_id;
QString timestamp;
int begi... | 2301_81045437/openpilot | tools/replay/route.h | C++ | mit | 1,991 |
#include <chrono>
#include <thread>
#include <QEventLoop>
#include "catch2/catch.hpp"
#include "common/util.h"
#include "tools/replay/replay.h"
#include "tools/replay/util.h"
const std::string TEST_RLOG_URL = "https://commadataci.blob.core.windows.net/openpilotci/0c94aa1e1296d7c6/2021-05-05--19-48-37/0/rlog.bz2";
co... | 2301_81045437/openpilot | tools/replay/tests/test_replay.cc | C++ | mit | 5,517 |
#define CATCH_CONFIG_RUNNER
#include "catch2/catch.hpp"
#include <QCoreApplication>
int main(int argc, char **argv) {
// unit tests for Qt
QCoreApplication app(argc, argv);
const int res = Catch::Session().run(argc, argv);
return (res < 0xff ? res : 0xff);
}
| 2301_81045437/openpilot | tools/replay/tests/test_runner.cc | C++ | mit | 268 |
#!/usr/bin/env python3
import argparse
import os
import sys
import cv2
import numpy as np
import pygame
import cereal.messaging as messaging
from openpilot.common.numpy_fast import clip
from openpilot.common.basedir import BASEDIR
from openpilot.common.transformations.camera import DEVICE_CAMERAS
from openpilot.tools... | 2301_81045437/openpilot | tools/replay/ui.py | Python | mit | 9,396 |
#!/usr/bin/env python3
import argparse
import bisect
import select
import sys
import termios
import time
import tty
from collections import defaultdict
import cereal.messaging as messaging
from openpilot.tools.lib.framereader import FrameReader
from openpilot.tools.lib.logreader import LogReader
from openpilot.tools.... | 2301_81045437/openpilot | tools/replay/unlog_ci_segment.py | Python | mit | 2,921 |
#include "tools/replay/util.h"
#include <bzlib.h>
#include <curl/curl.h>
#include <openssl/sha.h>
#include <cassert>
#include <algorithm>
#include <cmath>
#include <cstdarg>
#include <cstring>
#include <fstream>
#include <iostream>
#include <map>
#include <mutex>
#include <numeric>
#include <utility>
#include "commo... | 2301_81045437/openpilot | tools/replay/util.cc | C++ | mit | 11,155 |
#pragma once
#include <atomic>
#include <deque>
#include <functional>
#include <string>
enum class ReplyMsgType {
Info,
Debug,
Warning,
Critical
};
typedef std::function<void(ReplyMsgType type, const std::string msg)> ReplayMessageHandler;
void installMessageHandler(ReplayMessageHandler);
void logMessage(Rep... | 2301_81045437/openpilot | tools/replay/util.h | C++ | mit | 1,936 |
#!/usr/bin/env python3
import sys
import argparse
import multiprocessing
import rerun as rr
import rerun.blueprint as rrb
from functools import partial
from openpilot.tools.lib.logreader import LogReader
from cereal.services import SERVICE_LIST
NUM_CPUS = multiprocessing.cpu_count()
DEMO_ROUTE = "a2a0ccea32023010|20... | 2301_81045437/openpilot | tools/rerun/run.py | Python | mit | 3,200 |
#!/usr/bin/env python3
import sys
if len(sys.argv) < 4:
print(f"{sys.argv[0]} <route> <segment> <frame number> [front|wide|driver]")
print('example: ./fetch_image_from_route.py "02c45f73a2e5c6e9|2020-06-01--18-03-08" 3 500 driver')
exit(0)
cameras = {
"front": "cameras",
"wide": "ecameras",
"driver": "dca... | 2301_81045437/openpilot | tools/scripts/fetch_image_from_route.py | Python | mit | 1,302 |
#!/usr/bin/env python
import argparse
import os
import sys
from openpilot.common.basedir import BASEDIR
from openpilot.tools.lib.logreader import LogReader
os.environ['BASEDIR'] = BASEDIR
def get_arg_parser():
parser = argparse.ArgumentParser(
description="Unlogging and save to file",
formatter_class=a... | 2301_81045437/openpilot | tools/scripts/save_ubloxraw_stream.py | Python | mit | 1,177 |
#!/usr/bin/env python3
import requests
from openpilot.common.params import Params
import sys
if __name__ == "__main__":
if len(sys.argv) < 2:
print(f"{sys.argv[0]} <github username>")
exit(1)
username = sys.argv[1]
keys = requests.get(f"https://github.com/{username}.keys", timeout=10)
if keys.statu... | 2301_81045437/openpilot | tools/scripts/setup_ssh_keys.py | Python | mit | 583 |
#!/bin/bash
while true; do
if ls /dev/serial/by-id/usb-FTDI_FT230X* 2> /dev/null; then
sudo screen /dev/serial/by-id/usb-FTDI_FT230X* 115200
fi
sleep 0.005
done
| 2301_81045437/openpilot | tools/serial/connect.sh | Shell | mit | 172 |
import signal
import threading
import functools
from collections import namedtuple
from enum import Enum
from multiprocessing import Process, Queue, Value
from abc import ABC, abstractmethod
from openpilot.common.params import Params
from openpilot.common.numpy_fast import clip
from openpilot.common.realtime import R... | 2301_81045437/openpilot | tools/sim/bridge/common.py | Python | mit | 7,036 |
import math
from multiprocessing import Queue
from metadrive.component.sensors.base_camera import _cuda_enable
from metadrive.component.map.pg_map import MapGenerateMethod
from openpilot.tools.sim.bridge.common import SimulatorBridge
from openpilot.tools.sim.bridge.metadrive.metadrive_common import RGBCameraRoad, RGB... | 2301_81045437/openpilot | tools/sim/bridge/metadrive/metadrive_bridge.py | Python | mit | 2,474 |
import numpy as np
from metadrive.component.sensors.rgb_camera import RGBCamera
from panda3d.core import Texture, GraphicsOutput
class CopyRamRGBCamera(RGBCamera):
"""Camera which copies its content into RAM during the render process, for faster image grabbing."""
def __init__(self, *args, **kwargs):
super()... | 2301_81045437/openpilot | tools/sim/bridge/metadrive/metadrive_common.py | Python | mit | 1,179 |
import math
import time
import numpy as np
from collections import namedtuple
from panda3d.core import Vec3
from multiprocessing.connection import Connection
from metadrive.engine.core.engine_core import EngineCore
from metadrive.engine.core.image_buffer import ImageBuffer
from metadrive.envs.metadrive_env import Met... | 2301_81045437/openpilot | tools/sim/bridge/metadrive/metadrive_process.py | Python | mit | 5,406 |
import ctypes
import functools
import multiprocessing
import numpy as np
import time
from multiprocessing import Pipe, Array
from openpilot.tools.sim.bridge.common import QueueMessage, QueueMessageType
from openpilot.tools.sim.bridge.metadrive.metadrive_process import (metadrive_process, metadrive_simulation_state,
... | 2301_81045437/openpilot | tools/sim/bridge/metadrive/metadrive_world.py | Python | mit | 5,199 |
#!/bin/bash
export PASSIVE="0"
export NOBOARD="1"
export SIMULATION="1"
export SKIP_FW_QUERY="1"
export FINGERPRINT="HONDA_CIVIC_2022"
export BLOCK="${BLOCK},camerad,loggerd,encoderd,micd,logmessaged"
if [[ "$CI" ]]; then
# TODO: offscreen UI should work
export BLOCK="${BLOCK},ui"
fi
python -c "from openpilot.se... | 2301_81045437/openpilot | tools/sim/launch_openpilot.sh | Shell | mit | 573 |
import numpy as np
import os
import pyopencl as cl
import pyopencl.array as cl_array
from cereal.visionipc import VisionIpcServer, VisionStreamType
from cereal import messaging
from openpilot.common.basedir import BASEDIR
from openpilot.tools.sim.lib.common import W, H
class Camerad:
"""Simulates the camerad daemo... | 2301_81045437/openpilot | tools/sim/lib/camerad.py | Python | mit | 2,547 |
import math
import multiprocessing
import numpy as np
from abc import ABC, abstractmethod
from collections import namedtuple
W, H = 1928, 1208
vec3 = namedtuple("vec3", ["x", "y", "z"])
class GPSState:
def __init__(self):
self.latitude = 0
self.longitude = 0
self.altitude = 0
def from_xy(self, xy)... | 2301_81045437/openpilot | tools/sim/lib/common.py | Python | mit | 2,156 |
import sys
import termios
import time
from multiprocessing import Queue
from termios import (BRKINT, CS8, CSIZE, ECHO, ICANON, ICRNL, IEXTEN, INPCK,
ISTRIP, IXON, PARENB, VMIN, VTIME)
from typing import NoReturn
from openpilot.tools.sim.bridge.common import QueueMessage, control_cmd_gen
# Indexe... | 2301_81045437/openpilot | tools/sim/lib/keyboard_ctrl.py | Python | mit | 2,639 |
#!/usr/bin/env python3
# set up wheel
import array
import os
import struct
from fcntl import ioctl
from typing import NoReturn
from openpilot.tools.sim.bridge.common import control_cmd_gen
# Iterate over the joystick devices.
print('Available devices:')
for fn in os.listdir('/dev/input'):
if fn.startswith('js'):
... | 2301_81045437/openpilot | tools/sim/lib/manual_ctrl.py | Python | mit | 4,726 |
import cereal.messaging as messaging
from opendbc.can.packer import CANPacker
from opendbc.can.parser import CANParser
from openpilot.common.params import Params
from openpilot.selfdrive.boardd.boardd_api_impl import can_list_to_can_capnp
from openpilot.tools.sim.lib.common import SimulatorState
from panda.python impo... | 2301_81045437/openpilot | tools/sim/lib/simulated_car.py | Python | mit | 4,566 |
import time
from cereal import log
import cereal.messaging as messaging
from openpilot.common.realtime import DT_DMON
from openpilot.tools.sim.lib.camerad import Camerad
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from openpilot.tools.sim.lib.common import World, SimulatorState
class SimulatedSensors:
"... | 2301_81045437/openpilot | tools/sim/lib/simulated_sensors.py | Python | mit | 4,441 |
#define RGB_TO_Y(r, g, b) ((((mul24(b, 13) + mul24(g, 65) + mul24(r, 33)) + 64) >> 7) + 16)
#define RGB_TO_U(r, g, b) ((mul24(b, 56) - mul24(g, 37) - mul24(r, 19) + 0x8080) >> 8)
#define RGB_TO_V(r, g, b) ((mul24(r, 56) - mul24(g, 47) - mul24(b, 9) + 0x8080) >> 8)
#define AVERAGE(x, y, z, w) ((convert_ushort(x) + conve... | 2301_81045437/openpilot | tools/sim/rgb_to_nv12.cl | OpenCL | mit | 5,378 |
#!/usr/bin/env python
import argparse
from typing import Any
from multiprocessing import Queue
from openpilot.tools.sim.bridge.metadrive.metadrive_bridge import MetaDriveBridge
def create_bridge(dual_camera, high_quality):
queue: Any = Queue()
simulator_bridge = MetaDriveBridge(dual_camera, high_quality)
simu... | 2301_81045437/openpilot | tools/sim/run_bridge.py | Python | mit | 1,371 |
#!/bin/bash
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd $DIR
OPENPILOT_DIR="/tmp/openpilot"
if ! [[ -z "$MOUNT_OPENPILOT" ]]; then
OPENPILOT_DIR="$(dirname $(dirname $DIR))"
EXTRA_ARGS="-v $OPENPILOT_DIR:$OPENPILOT_DIR -e PYTHONPATH=$OPENPILOT_DIR:$PYTHONPATH"
fi
if [[ "$CI" ]]; then
CMD=... | 2301_81045437/openpilot | tools/sim/start_openpilot_docker.sh | Shell | mit | 958 |
import pytest
def pytest_addoption(parser):
parser.addoption("--test_duration", action="store", default=60, type=int, help="Seconds to run metadrive drive")
@pytest.fixture
def test_duration(request):
return request.config.getoption("--test_duration")
| 2301_81045437/openpilot | tools/sim/tests/conftest.py | Python | mit | 258 |
#!/usr/bin/env python3
# type: ignore
import os
import time
import argparse
import signal
from collections import defaultdict
import cereal.messaging as messaging
from openpilot.tools.lib.logreader import LogReader
def sigint_handler(signal, frame):
exit(0)
signal.signal(signal.SIGINT, sigint_handler)
class Steer... | 2301_81045437/openpilot | tools/tuning/measure_steering_accuracy.py | Python | mit | 6,706 |
#!/usr/bin/env bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
# NOTE: this is used in a docker build, so do not run any scripts here.
$DIR/install_ubuntu_dependencies.sh
$DIR/install_python_dependencies.sh
echo
echo "---- OPENPILOT SETUP DONE ----"
echo "Open a new shell or conf... | 2301_81045437/openpilot | tools/ubuntu_setup.sh | Shell | mit | 385 |
import cv2 as cv
import numpy as np
class Camera:
def __init__(self, cam_type_state, stream_type, camera_id):
try:
camera_id = int(camera_id)
except ValueError: # allow strings, ex: /dev/video0
pass
self.cam_type_state = cam_type_state
self.stream_type = stream_type
self.cur_frame_id ... | 2301_81045437/openpilot | tools/webcam/camera.py | Python | mit | 945 |
#!/usr/bin/env python3
import threading
import os
from collections import namedtuple
from cereal.visionipc import VisionIpcServer, VisionStreamType
from cereal import messaging
from openpilot.tools.webcam.camera import Camera
from openpilot.common.realtime import Ratekeeper
DUAL_CAM = os.getenv("DUAL_CAMERA")
Camera... | 2301_81045437/openpilot | tools/webcam/camerad.py | Python | mit | 2,212 |
#!/bin/bash
# export the block below when call manager.py
export BLOCK="${BLOCK},camerad"
export USE_WEBCAM="1"
# Change camera index according to your setting
export CAMERA_ROAD_ID="0"
export CAMERA_DRIVER_ID="1"
export DUAL_CAMERA="2" # camera index for wide road camera
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )... | 2301_81045437/openpilot | tools/webcam/start_camerad.sh | Shell | mit | 360 |
<!DOCTYPE html>
<html lang="ch">
<head>
<meta charset="UTF-8">
<title>IKUN Studio</title>
<style>
*{
box-sizing: border-box;
}
/*无法解释*/
sty{
}
body{
... | 2301_81414198/IKUN | main.html | HTML | unknown | 5,308 |
import streamlit as st
import pandas as pd
# 设置页面标题
st.set_page_config(page_title="公司信息查询系统", layout="wide")
st.title("公司信息查询系统")
# 读取Excel文件
@st.cache_data
def load_data():
df = pd.read_excel("output.xlsx")
return df
# 加载数据
df = load_data()
# 创建搜索框
search_term = st.text_input("请输入公司简称进行搜索:")
# 搜索功能
if sea... | 2301_81200836/classmateCode | app.py | Python | unknown | 884 |
package com.example.a20231015;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on a... | 2301_77966824/learning-android-studio | 2024/09/20231015/app/src/androidTest/java/com/example/a20231015/ExampleInstrumentedTest.java | Java | unknown | 756 |
package com.example.a20231015;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_... | 2301_77966824/learning-android-studio | 2024/09/20231015/app/src/main/java/com/example/a20231015/MainActivity.java | Java | unknown | 334 |
package com.example.themyno1;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an... | 2301_77966824/learning-android-studio | 2024/09/no1/app/src/androidTest/java/com/example/themyno1/ExampleInstrumentedTest.java | Java | unknown | 754 |
package com.example.themyno1;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
private Button btn1;
private... | 2301_77966824/learning-android-studio | 2024/09/no1/app/src/main/java/com/example/themyno1/MainActivity.java | Java | unknown | 1,001 |
package com.example.themyno1;
import androidx.appcompat.app.AppCompatActivity;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
public class login ext... | 2301_77966824/learning-android-studio | 2024/09/no1/app/src/main/java/com/example/themyno1/login.java | Java | unknown | 2,074 |
package com.example.a10_30_01;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on a... | 2301_77966824/learning-android-studio | 2024/10/10_30_01/app/src/androidTest/java/com/example/a10_30_01/ExampleInstrumentedTest.java | Java | unknown | 756 |
package com.example.a10_30_01;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_... | 2301_77966824/learning-android-studio | 2024/10/10_30_01/app/src/main/java/com/example/a10_30_01/MainActivity.java | Java | unknown | 334 |
package com.example.a10_30_01.;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
//... | 2301_77966824/learning-android-studio | 2024/10/10_30_01/app/src/main/java/com/example/a10_30_01/login.java | Java | unknown | 3,420 |
package com.example.a2024_10_15_01;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute... | 2301_77966824/learning-android-studio | 2024/10/2024_10_15_01/app/src/androidTest/java/com/example/a2024_10_15_01/ExampleInstrumentedTest.java | Java | unknown | 766 |
package com.example.a2024_10_15_01;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.acti... | 2301_77966824/learning-android-studio | 2024/10/2024_10_15_01/app/src/main/java/com/example/a2024_10_15_01/MainActivity.java | Java | unknown | 339 |
package com.example.food;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an And... | 2301_77966824/learning-android-studio | 2024/10/Food/app/src/androidTest/java/com/example/food/ExampleInstrumentedTest.java | Java | unknown | 746 |
package com.example.food;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.view.Window;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Toast;
import androidx.appcompat.app.AppC... | 2301_77966824/learning-android-studio | 2024/10/Food/app/src/main/java/com/example/food/MainActivity.java | Java | unknown | 4,661 |
package com.example.my10_30;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an ... | 2301_77966824/learning-android-studio | 2024/10/My10_30/app/src/androidTest/java/com/example/my10_30/ExampleInstrumentedTest.java | Java | unknown | 752 |
package com.example.my10_30;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ma... | 2301_77966824/learning-android-studio | 2024/10/My10_30/app/src/main/java/com/example/my10_30/MainActivity.java | Java | unknown | 332 |
package com.example.myapplication;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute ... | 2301_77966824/learning-android-studio | 2024/10/MyApplication/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.java | Java | unknown | 764 |
package com.example.myapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activ... | 2301_77966824/learning-android-studio | 2024/10/MyApplication/app/src/main/java/com/example/myapplication/MainActivity.java | Java | unknown | 338 |
package com.example.themyno1;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an... | 2301_77966824/learning-android-studio | 2024/10/themyno1/app/src/androidTest/java/com/example/themyno1/ExampleInstrumentedTest.java | Java | unknown | 754 |
package com.example.themyno1;
import androidx.appcompat.app.AppCompatActivity;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
public class MainActiv... | 2301_77966824/learning-android-studio | 2024/10/themyno1/app/src/main/java/com/example/themyno1/MainActivity.java | Java | unknown | 2,102 |
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
export default [
{ ignores: ['dist'] },
{
files: ['**/*.{js,jsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,... | 2301_81295389/student-java-web-frontend | eslint.config.js | JavaScript | unknown | 844 |
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="学生信息管理系统" />
<title>学生信息管理系统</title>
<link rel="icon" href="./public/logo.jpg" type="image/x-icon" />
</head>
<body>
<div id="root">... | 2301_81295389/student-java-web-frontend | index.html | HTML | unknown | 426 |
import React from 'react';
import {BrowserRouter as Router, Route, Routes, Navigate} from 'react-router-dom';
import Login from './pages/login/Login.jsx';
import NavigationLayout from "./pages/layouts/NavigationLayout.jsx";
import HomePage from "./pages/homePage/HomePage.jsx";
import StudentPage from "./pages/studentPa... | 2301_81295389/student-java-web-frontend | src/App.jsx | JavaScript | unknown | 1,565 |