Skip to content

Instantly share code, notes, and snippets.

View kierdavis's full-sized avatar

Kier Davis kierdavis

View GitHub Profile
#!/usr/bin/env python3.7
import sys
import tty
import termios
import subprocess
import re
from pathlib import Path, PurePath
def getch():
Testing SR v4 PowerBoard.
Waiting for start button...
DEBUG:j5.components.button:get_button_state(identifier=0) -> False
DEBUG:j5.components.led:set_led_state(identifier=0, state=True)
DEBUG:j5.components.button:get_button_state(identifier=0) -> False
DEBUG:j5.components.button:get_button_state(identifier=0) -> False
DEBUG:j5.components.button:get_button_state(identifier=0) -> False
DEBUG:j5.components.button:get_button_state(identifier=0) -> False
DEBUG:j5.components.button:get_button_state(identifier=0) -> False
DEBUG:j5.components.button:get_button_state(identifier=0) -> False
[kier@saelli:~]$ nix-shell -p python3Packages.pip
[nix-shell:~]$ pip install --verbose --target=/tmp/throwaway-installation-dir opencv-contrib-python-headless==4.1.0.25
Created temporary directory: /run/user/1001/pip-target-9x91gkx3
Created temporary directory: /run/user/1001/pip-ephem-wheel-cache-jscyy6fc
Created temporary directory: /run/user/1001/pip-req-tracker-w3sswxqk
Created requirements tracker '/run/user/1001/pip-req-tracker-w3sswxqk'
Created temporary directory: /run/user/1001/pip-install-16kd9m0l
Collecting opencv-contrib-python-headless==4.1.0.25
1 location(s) to search for versions of opencv-contrib-python-headless:
-----BEGIN CERTIFICATE-----
MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcNAQEL
BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc
BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMiBHMzAeFw0xMjAxMTIxODU5MzJaFw00
MjAxMTIxODU5MzJaMEgxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM
aW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDIgRzMwggIiMA0GCSqG
SIb3DQEBAQUAA4ICDwAwggIKAoICAQChriWyARjcV4g/Ruv5r+LrI3HimtFhZiFf
qq8nUeVuGxbULX1QsFN3vXg6YOJkApt8hpvWGo6t/x8Vf9WVHhLL5hSEBMHfNrMW
n4rjyduYNM7YMxcoRvynyfDStNVNCXJJ+fKH46nafaF9a7I6JaltUkSs+L5u+9ym
c5GQYaYDFCDy54ejiK2toIz/pgslUiXnFgHVy7g1gQyjO/Dh4fxaXc6AcW34Sas+
if __name__ == "__main__":
board = cast(PowerBoard, SRV4PowerBoardHardwareBackend.discover()[0])
b = cast(SRV4PowerBoardHardwareBackend, board._backend)
try:
b.get_button_state(board, 1)
except Exception as e:
print(str(e))
while True:
print(f"Serial number: {board.serial}")
print(f"Firmware version: {b.firmware_version}")
from abc import ABCMeta, abstractmethod
class Component(metaclass=ABCMeta):
"""
Represents a single element of the robot hardware that may be operated by the user logic.
Examples include:
- a motor
// Buffers for incoming and outgoing bytes respectively.
static RingBuffer recv_buffer;
static RingBuffer send_buffer;
// True when we've sent an XOFF and the peer has (hopefully) stopped sending data.
static bool recv_paused = false;
// True when the peer has sent an XOFF and we should stop sending data.
static bool send_paused = false;
Application Architecture IPC (in-order) IPC (out-of-order)
crc32 arm .37207400845431505980 .97955199956153432229
crc32 x86 .24456957484502649185 1.87414399799978104145
sha arm .39627907995376373499 2.85625675899401813169
sha x86 .34798035968094520557 1.72880407237775979080
Application,Architecture,IPC (1 layer),IPC (2 layers),IPC (3 layers)
crc32,arm,.37207400845431505980,.37207247218849673917,.37207004599251855888
crc32,x86,.24456957484502649185,.24456786206401686474,.24456478131541620667
sha,arm,.39627907995376373499,.39624501614677063739,.39616326285681414028
sha,x86,.34798035968094520557,.34795167265421835192,.34790049190617000551
Application Architecture L1D [kB] IPC (L1I=8kB) IPC (L1I=16kB) IPC (L1I=32kB)
crc32 arm 8 .36748536783619406404 .36752832267653294602 .36752858879498823430
crc32 arm 16 .37162961571734866440 .37165599709076517445 .37165617332080490819
crc32 arm 32 .37162972425097425049 .37165614412931438484 .37165638717564200091
crc32 arm 64 .37204743335887199712 .37207379195140604508 .37207400845431505980
crc32 x86 8 .24149315098947192748 .24149356681634364117 .24148247813550427214
crc32 x86 16 .24278819871540530945 .24278844217554801587 .24278893805242551291
crc32 x86 32 .24456884459475138251 .24456920477644927437 .24456954648571111852
crc32 x86 64 .24456893606302772620 .24456918700200181530 .24456957484502649185
sha arm 8 .38729880861074794571 .38737412129392143235 .38737921423219464804