Git Product home page Git Product logo

projectneura / leads Goto Github PK

View Code? Open in Web Editor NEW
204.0 31.0 44.0 5.17 MB

Build your race-ready electric car in 10 minutes with powerful electronic stability control and a modern dashboard.

Home Page: https://leads.projectneura.org

License: Apache License 2.0

Python 93.30% Shell 4.44% C++ 0.60% HTML 0.44% JavaScript 0.59% CSS 0.63%
uwaterloo assited-driving dashboard evcar car-dashboard car-control control-system ecu vehicle-control car-instrumentation

leads's Introduction

LEADS: Lightweight Embedded Assisted Driving System

GitHub code size in bytes PyPI PyPI - Downloads GitHub Release GitHub Release Date - Published_At

LEADS is a lightweight embedded assisted driving system. It is designed to simplify the development of the instrumentation and control system for electric vehicles. It is written in well-organized Python and C/C++ with impressive performance. It is not only plug-and-play (the VeC Project) but also fully customizable. It provides multiple abstract layers that allow users to pull out the components and rearrange them into a new project. You can either configure the existing executable module leads_vec and leads_vec_rc simply through a JSON file or write your own codes based on the framework as easily as building a LEGO.

The hardware components chosen for this project are geared towards amateur developers. It uses neither a CAN bus nor any dedicated circuit board, but generic development kits such as Raspberry Pi and Arduino instead. However, as it is a high-level system running on a host computer, the software framework has the ability to adapt to any type of hardware component if you are willing to write some codes.

This document will guide you through LEADS VeC. You will find a detailed version here.

LEADS VeC Demo

demo

LEADS VeC Demo (Manual Mode)

demo

๐Ÿ”— Docs

๐Ÿ”— Remote Analyst Online Dashboard

Key Features

  • Modern UI design
  • Auto dark mode support
  • Fancy widgets
  • TCP communication system
  • Remote analyst
  • Replaying recorded data
  • Data recording system with the following components
    • A speed recording system
    • A G force recording system
    • A GPS recording system
    • A battery voltage recording system
  • ESC with the following components
    • DTCS (Dynamic Traction Control System)
    • ABS (Anti-lock Braking System)
    • EBI (Emergency Braking Intervention)
    • ATBS (Automatic Trail Braking System)

Installation

Python

Note that LEADS requires Python >= 3.12. To set up the environment on a Raspberry Pi by only a single line of command, see Environment Setup.

pip install Pillow PySDL2 customtkinter gpiozero lgpio pynmea2 pynput pysdl2-dll pyserial leads

numpy and pandas will be automatically installed with leads.

Pillow, PySDL2, customtkinter, gpiozero, lgpio, pynmea2, pynput, pysdl2-dll, and pyserial are optional.

If your platform does not support GPIO, just exclude lgpio.

pip install Pillow PySDL2 customtkinter gpiozero pynmea2 pynput pysdl2-dll pyserial leads

If you only want the framework, run the following.

pip install leads

Verify

python -m leads_vec info

Arduino

You can install LEADS Arduino from Arduino Library Manager. Note that it is named "LEADS", not "LEADS-Arduino", in the index.

LEADS Framework

See Read the Docs for the documentation of how to customize and make use of the framework in your project.

Quick Start

Main

python -m leads_vec run

Optional Arguments

Run the following to get a list of all the supported arguments.

python -m leads_vec -h
Specify a Configuration File
python -m leads_vec -c path/to/the/config/file.json run

If not specified, all configurations will be default values.

To learn about the configuration file, read Configurations.

Specify a Devices Module
python -m leads_vec -d path/to/the/devices.py run

To learn about the devices module, read Devices Module.

Specify a Main Module
python -m leads_vec -m path/to/the/main.py run

Function main() must exist in the main module, otherwise an ImportError will be raised.

It needs to have the identical signature as the following.

def main() -> int:
  """
  :return: 0: success; 1: error
  """
  ...
Generate a Configuration File
python -m leads_vec -r config run

This will generate a default "config.json" file under the current directory.

Register a Systemd Service
python -m leads_vec -r systemd run

This will register a user Systemd service to start the program.

To enable auto-start at boot, run the following.

systemctl --user daemon-reload
systemctl --user enable leads-vec

You will have to stop the service by this command otherwise it will automatically restart when it exits.

systemctl --user stop leads-vec

Use the following to disable the service.

systemctl --user disable leads-vec
Use Reverse Proxy
python -m leads_vec -r reverse_proxy run

This will start the corresponding reverse proxy program as a subprocess in the background.

Specify a Theme
python -m leads_vec -t path/to/the/theme.json run

To learn about themes, read Color and Themes.

Magnify Font Sizes
python -m leads_vec -mfs 1.5 run

This will magnify all font sizes by 1.5.

Use Emulation
python -m leads_vec --emu run

This will force the program to use emulation even if the environment is available.

Automatically Magnify Font Sizes
python -m leads_vec --auto-mfs run

Similar to Magnify Font Sizes, but instead of manually deciding the factor, the program will automatically calculate the best factor to keep the original proportion as designed.

Remote Analyst

python -m leads_vec_rc

Go to the online dashboard at https://leads-vec-rc.projectneura.org.

Optional Arguments

Run the following to get a list of all the supported arguments.

python -m leads_vec_rc -h
Server Port
python -m leads_vec_rc -p 80

If not specified, the port is 8000 by default.

Specify a Configuration File
python -m leads_vec_rc -c path/to/the/config/file.json

If not specified, all configurations will be default values.

To learn about the configuration file, read Configurations.

Environment Setup

This section helps you set up the identical environment we have for the VeC project. A more detailed guide of reproduction is available here, but first of all, we run an Ubuntu on a Raspberry Pi 4 Model B 8GB. After the OS is set up, just run the one-line commands listed below. You may also choose to clone the repository or download the scripts from releases (only stable releases provide scripts).

These scripts currently only support apt as the package manager.

If you install Python using the scripts, you will not find python ..., python3 ..., pip ..., or pip3 ... working because you have to specify the Python interpreter such that python-leads ... and pip-leads ....

LEADS

You can simply run "setup.sh" and it will install everything including Python 3.12 all the optional dependencies of LEADS for you.

bash "setup.sh$(wget -O setup.sh https://raw.githubusercontent.com/ProjectNeura/LEADS/main/scripts/setup.sh)" && rm setup.sh || rm setup.sh

This will create a shortcut to save you from typing python-leads -m leads_vec ..., instead, you will just need to call leads-vec ....

Python

python-install.sh will only install Python 3.12 and Tcl/Tk.

bash "python-install.sh$(wget -O python-install.sh https://raw.githubusercontent.com/ProjectNeura/LEADS/main/scripts/python-install.sh)" && rm python-install.sh || rm python-install.sh

FRP

Install

We use FRP for reverse proxy. This is optional if you do not need public connections. If you want, install it through "frp-install.sh".

bash "frp-install.sh$(wget -O frp-install.sh https://raw.githubusercontent.com/ProjectNeura/LEADS/main/scripts/frp-install.sh)" && rm frp-install.sh || rm frp-install.sh

Configure

To configure FRP, use "frp-config.sh".

bash "frp-config.sh$(wget -O frp-config.sh https://raw.githubusercontent.com/ProjectNeura/LEADS/main/scripts/frp-config.sh)" && rm frp-config.sh || rm frp-config.sh

There are 4 arguments for this script, of which the first 2 are required.

bash "frp-config.sh$(...)" {frp_server_ip} {frp_token} {frp_port} {comm_port} && rm frp-config.sh || rm frp-config.sh

GStreamer

Install

bash "gstreamer-install.sh$(wget -O gstreamer-install.sh https://raw.githubusercontent.com/ProjectNeura/LEADS/main/scripts/gstreamer-install.sh)" && rm gstreamer-install.sh || rm gstreamer-install.sh

Run

bash "gstreamer-run.sh$(wget -O gstreamer-run.sh https://raw.githubusercontent.com/ProjectNeura/LEADS/main/scripts/gstreamer-run.sh)" && rm gstreamer-run.sh || rm gstreamer-run.sh

There are 4 arguments for this script, of which the first one is required.

bash "gstreamer-run.sh$(...)" {youtube_stream_key} {left_camera} {middle_camera} {right_camera} && rm gstreamer-run.sh || rm gstreamer-run.sh

Uninstall

To uninstall LEADS, we provide an easy solution as well. However, it uninstalls a component only if it is installed through the way listed in Environment Setup. GStreamer will not be uninstalled anyway.

bash "uninstall.sh$(wget -O uninstall.sh https://raw.githubusercontent.com/ProjectNeura/LEADS/main/scripts/uninstall.sh)" && rm uninstall.sh || rm uninstall.sh

Configurations

The configuration is a JSON file that has the following settings. You can have an empty configuration file like the following as all the settings are optional.

{}

Note that a purely empty file could cause an error.

Index Type Usage Used By Default
w_debug_level str "DEBUG", "INFO", "WARN", "ERROR" Main, Remote "DEBUG"
data_seq_size int Buffer size of history data Main 100
data_dir str The directory for the data recording system Main, Remote "data"
width int Window width Main 720
height int Window height Main 480
fullscreen bool True: auto maximize; False: window mode Main False
no_title_bar bool True: no title bar; False: default title bar Main False
theme_mode bool "system", "light", "dark" Main False
manual_mode bool True: hide control system; False: show control system Main False
refresh_rate int GUI frame per second Main 30
m_ratio float Meter widget size ratio Main 0.7
font_size_small int Small font size Main 14
font_size_medium int Medium font size Main 28
font_size_large int Large font size Main 42
font_size_x_large int Extra large font size Main 56
comm_addr str Communication server address Remote "127.0.0.1"
comm_port int The port on which the communication system runs on Main, Remote 16900
save_data bool True: save data; False: discard data Remote False

Devices Module

Example

from leads import controller, MAIN_CONTROLLER
from leads_emulation import RandomController


@controller(MAIN_CONTROLLER)
class MainController(RandomController):
    pass

The devices module will be executed after configuration registration. Register your devices in this module using AOP paradigm. A more detailed explanation can be found here.

Architecture

Main

Pin Configuration

pin-config

Remote Analyst

comm-flowchart

Collaborations

Community

Issues

Our team management completely relies on GitHub. Tasks are published and assigned as issues. You will be notified if you are assigned to certain tasks. However, you may also join other discussions for which you are not responsible.

There are a few labels that classify the issues.

  • bug reports a bug
  • code review discusses a code review or comment
  • documentation suggests a documentation enhancement
  • duplicate marks that a similar issue has been raised
  • enhancement proposes a new feature or request
  • help wanted means that extra attention is needed to this issue
  • invalid marks that the issue is in a valid format
  • question requests further information
  • report states that it is discussed in the meeting
  • todo creates a new task
  • wontfix marks that the issue is ignored

Label your issue with at least one of the labels above before you submit.

Projects

You can have a look at the whole schedule of each project in a timeline using the projects feature.

Code Contributions

See CONTRIBUTING.md.

leads's People

Contributors

atatc avatar fz20181223luogu avatar qmascarenhas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

leads's Issues

LEADS BoM

Bill of Materials for realizing LEADS

Systemd Service Fails to Start

ร— leads.service - LEADS
     Loaded: loaded (/etc/systemd/system/leads.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2023-12-30 15:57:41 EST; 7s ago
    Process: 4007 ExecStart=/usr/local/lib/python3.11/dist-packages/leads_vec/_bootloader/leads.service.sh (code=exited, status=203/EXEC)
   Main PID: 4007 (code=exited, status=203/EXEC)
        CPU: 3ms

Dec 30 15:57:41 rp-4b1 systemd[4007]: leads.service: Failed at step EXEC spawning /usr/local/lib/python3.11/dist-packages/leads_vec/_bootloader/leads.service.sh: Permission denied
Dec 30 15:57:41 rp-4b1 systemd[1]: Started LEADS.
Dec 30 15:57:41 rp-4b1 systemd[1]: leads.service: Main process exited, code=exited, status=203/EXEC
Dec 30 15:57:41 rp-4b1 systemd[1]: leads.service: Failed with result 'exit-code'.

[Bug] Window does not successfully finalize on Ubuntu 22.04 LTS Raspberry Pi 4

REFERENCE [Bug] Window does not successfully finalize on Ubuntu 22.04 LTS Raspberry Pi 4

Type of Issue

BUG

Operating System

Ubuntu 22.04 LTS for Raspberry Pi

PySimpleGUI Port

Tkinter

Versions

Python version: 3.11.7 (main, Dec 8 2023, 18:56:58) [GCC 11.4.0]
port: tkinter
tkinter version: 8.6.12
PySimpleGUI version: 4.60.5

Python version (sg.sys.version)

3.11.7

PySimpleGUI Version (sg.__version__)

4.60.5

GUI Version (tkinter (sg.tclversion_detailed), PySide2, WxPython, Remi)

8.6.12

Troubleshooting

These items may solve your problem. Please check those you've done by changing - [ ] to - [X]

  • Searched main docs for your problem www.PySimpleGUI.org
  • Looked for Demo Programs that are similar to your goal. It is recommend you use the Demo Browser! Demos.PySimpleGUI.org
  • None of your GUI code was generated by an AI algorithm like GPT
  • If not tkinter - looked for Demo Programs for specific port
  • For non tkinter - Looked at readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
  • Run your program outside of your debugger (from a command line)
  • Searched through Issues (open and closed) to see if already reported Issues.PySimpleGUI.org
  • Have upgraded to the latest release of PySimpleGUI on PyPI (lastest official version)
  • Tried using the PySimpleGUI.py file on GitHub. Your problem may have already been fixed but not released

Detailed Description

Window does not successfully finalize on Ubuntu 22.04 LTS Raspberry Pi 4

/usr/local/lib/python3.11/dist-packages/PySimpleGUI/PySimpleGUI.py:1711: UserWarning: You cannot Update element with key = None until the window.read() is called or finalized=True when creating window
  warnings.warn('You cannot Update element with key = {} until the window.read() is called or finalized=True when creating window'.format(self.Key), UserWarning)
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/local/lib/python3.11/dist-packages/leads_vec/__main__.py", line 27, in <module>
    _exit(_main(_Controller("main"), config))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/leads_vec/cli.py", line 136, in main
    uim.show()
  File "/usr/local/lib/python3.11/dist-packages/leads_dashboard/prototype.py", line 140, in show
    self._window.show()
  File "/usr/local/lib/python3.11/dist-packages/leads_dashboard/prototype.py", line 83, in show
    self._root.finalize()
  File "/usr/local/lib/python3.11/dist-packages/PySimpleGUI/PySimpleGUI.py", line 10304, in finalize
    self.Read(timeout=1)
  File "/usr/local/lib/python3.11/dist-packages/PySimpleGUI/PySimpleGUI.py", line 10079, in read
    results = self._read(timeout=timeout, timeout_key=timeout_key)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/PySimpleGUI/PySimpleGUI.py", line 10150, in _read
    self._Show()
  File "/usr/local/lib/python3.11/dist-packages/PySimpleGUI/PySimpleGUI.py", line 9890, in _Show
    StartupTK(self)
  File "/usr/local/lib/python3.11/dist-packages/PySimpleGUI/PySimpleGUI.py", line 16859, in StartupTK
    root.attributes("-toolwindow", 1)
  File "/usr/lib/python3.11/tkinter/__init__.py", line 2032, in wm_attributes
    return self.tk.call(args)
           ^^^^^^^^^^^^^^^^^^
_tkinter.TclError: bad attribute "-toolwindow": must be -alpha, -topmost, -zoomed, -fullscreen, or -type

Code To Duplicate

root = sg.Window(title, size=(None if width < 0 else width, None if height < 0 else height), text_justification="center", no_titlebar=True, disable_minimize=True)
...
root.finalize()

ValueError: 'INFO' is not a valid Level

Traceback (most recent call last):
  File "F:\Projects\PythonProjects\LEADS\leads_vec\__main__.py", line 49, in <module>
    _register_config(_load_config(args.config, _Config) if args.config else None)
  File "F:\Projects\PythonProjects\LEADS\leads\config\registry.py", line 25, in register_config
    L.debug_level(Level(config.debug_level.upper()))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ProgramData\anaconda3\envs\LEADS\Lib\enum.py", line 744, in __call__
    return cls.__new__(cls, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ProgramData\anaconda3\envs\LEADS\Lib\enum.py", line 1158, in __new__
    raise ve_exc
ValueError: 'INFO' is not a valid Level

_tkinter.TclError: no display name and no $DISPLAY environment variable

 leads.service - LEADS
     Loaded: loaded (/etc/systemd/system/leads.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2023-12-30 21:06:07 EST; 5s ago
    Process: 2497 ExecStart=/bin/bash /usr/local/lib/python3.11/dist-packages/leads_vec/_bootloader/leads.service.sh  (code=exited, status=1/FAILURE)
   Main PID: 2497 (code=exited, status=1/FAILURE)
        CPU: 491ms

Dec 30 21:06:07 rp-4b1 bash[2498]:            ^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 30 21:06:07 rp-4b1 bash[2498]:   File "/usr/local/lib/python3.11/dist-packages/PySimpleGUI/PySimpleGUI.py", line 16708, in _get_hidden_master_root
Dec 30 21:06:07 rp-4b1 bash[2498]:     Window.hidden_master_root = tk.Tk()
Dec 30 21:06:07 rp-4b1 bash[2498]:                                 ^^^^^^^
Dec 30 21:06:07 rp-4b1 bash[2498]:   File "/usr/lib/python3.11/tkinter/__init__.py", line 2326, in __init__
Dec 30 21:06:07 rp-4b1 bash[2498]:     self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
Dec 30 21:06:07 rp-4b1 bash[2498]:               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 30 21:06:07 rp-4b1 bash[2498]: _tkinter.TclError: no display name and no $DISPLAY environment variable
Dec 30 21:06:07 rp-4b1 systemd[1]: leads.service: Main process exited, code=exited, status=1/FAILURE
Dec 30 21:06:07 rp-4b1 systemd[1]: leads.service: Failed with result 'exit-code'.

Originally posted by @ATATC in #19 (comment)

2023-11-20

This issue discusses the progress report on Nov 11st, 2023.

@ProjectNeura/vec

`leads_vec`: error reading configuration file

Bug found.

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/site-packages/leads_vec/__main__.py", line 23, in <module>
    config = _load_config(cfg_arg) if cfg_arg else _DEFAULT_CONFIG
             ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/site-packages/leads_vec/config.py", line 37, in load_config
    return Config(_load(open(file, "r")) if isinstance(file, str) else _load(file)).load()
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/json/__init__.py", line 293, in load
    return loads(fp.read(),
           ^^^^^^^^^^^^^^^^
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 13 (char 14)

Originally posted by @ATATC in #12 (comment)

Implementing Collections in C++

As Arduino does not have a standard library, we are going to implement the standard collections ourselves. For the device tree system, we will need ArrayList and HashMap (or other type of maps).

ASSIGNED to @fz20181223luogu

The Bounce Time of the Wheel Speed Sensors

Assume the maximum speed is 260 km/h = 72.2222 m/s, and the wheel radius is 19 inches. The diameter is 96.25 cm = 0.9625m. The number of turns per second is 75.0361. The minimum time it takes to complete each full rotation is 13.3269 ms. Therefore, the bounce time of the wheel speed sensors is for now set to 13 ms.

Program Fails to Start on macOS

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/site-packages/leads_vec/__main__.py", line 53, in <module>
    _exit(main(_Controller("main"), config))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/site-packages/leads_vec/cli.py", line 153, in main
    uim.show()
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/site-packages/leads_dashboard/prototype.py", line 152, in show
    self._window.show()
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/site-packages/leads_dashboard/prototype.py", line 86, in show
    self._root.finalize()
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/site-packages/PySimpleGUI/PySimpleGUI.py", line 10304, in finalize
    self.Read(timeout=1)
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/site-packages/PySimpleGUI/PySimpleGUI.py", line 10079, in read
    results = self._read(timeout=timeout, timeout_key=timeout_key)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/site-packages/PySimpleGUI/PySimpleGUI.py", line 10150, in _read
    self._Show()
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/site-packages/PySimpleGUI/PySimpleGUI.py", line 9890, in _Show
    StartupTK(self)
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/site-packages/PySimpleGUI/PySimpleGUI.py", line 16873, in StartupTK
    _convert_window_to_tk(window)
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/site-packages/PySimpleGUI/PySimpleGUI.py", line 16757, in _convert_window_to_tk
    PackFormIntoFrame(window, master, window)
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/site-packages/PySimpleGUI/PySimpleGUI.py", line 14850, in PackFormIntoFrame
    PackFormIntoFrame(element, element.TKColFrame, toplevel_form)
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/site-packages/PySimpleGUI/PySimpleGUI.py", line 15197, in PackFormIntoFrame
    if height > 1:
       ^^^^^^^^^^
TypeError: '>' not supported between instances of 'NoneType' and 'int'

Error compiling codes: undefined reference

This issue is also posted on https://forum.arduino.cc/t/error-compiling-codes-undefined-reference/1216788/1.

AppData\Local\Temp\ccsbCXFP.ltrans0.ltrans.o: In function `global constructors keyed to 65535_0_ArrayList.cpp.o.2153':
<artificial>:(.text.startup+0x46): undefined reference to `ArrayList<int>::ArrayList(int)'
<artificial>:(.text.startup+0x50): undefined reference to `ArrayList<int>::ArrayList(int)'
<artificial>:(.text.startup+0x60): undefined reference to `Device<float>::Device(ArrayList<int>)'
collect2.exe: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 1

Odometer Error

MODULE leads_vec
REF leads_vec.remote.integrate_speed2displacement()

Introduced in commit f3178b2.
The odometer is adding up faster than expected.

Full Data Persistence Record on Remote

MODULE leads_vec

Use a list to store the full data and dump it into a file continuously.
The list should have a length threshold that once reached the list will be downsampled to reduce memory overhead.

documentation: README.md

@ATATC In README.md and supporting project doc we should add to

  • A data recording system with the following components
  • A speed recording system
  • A G force recording system
  • A GPS recording system
  • A Battery Voltage recording system

The detailed project document will need to be updated accordingly. It should be possible to get a USB GPS module and I'm suspecting we can sample the BATT Voltage via one of the GPIO pins?

Docs Update

Documentation for the new configuration system.

Documentation Feedback

@ATATC docs/assets/pin-config.png needs to be updated with labels for the raspberry pi and arduino boards for clarity.

Error compiling codes: error: redefinition of ...

F:\Projects\PythonProjects\LEADS\arduino\leads_vec\Device.cpp:4:1: error: prototype for 'Device<T>::Device(ArrayList<int>)' does not match any in class 'Device<T>'
In file included from F:\Projects\PythonProjects\LEADS\arduino\leads_vec\Device.cpp:1:0:
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\Device.h:15:5: error: candidate is: Device<T>::Device(int*)
     Device(int *const pins) : _pins(pins) {}
     ^~~~~~
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\Device.cpp:6:6: error: redefinition of 'void Device<T>::tag(String)'
In file included from F:\Projects\PythonProjects\LEADS\arduino\leads_vec\Device.cpp:1:0:
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\Device.h:19:10: note: 'void Device<T>::tag(String)' previously declared here
     void tag(String tag) {
          ^~~
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\Device.cpp:10:8: error: redefinition of 'String Device<T>::tag()'
In file included from F:\Projects\PythonProjects\LEADS\arduino\leads_vec\Device.cpp:1:0:
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\Device.h:22:12: note: 'String Device<T>::tag()' previously declared here
     String tag() {
            ^~~
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\Device.cpp:14:6: error: redefinition of 'void Device<T>::parentTags(ArrayList<String>)'
In file included from F:\Projects\PythonProjects\LEADS\arduino\leads_vec\Device.cpp:1:0:
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\Device.h:25:10: note: 'void Device<T>::parentTags(ArrayList<String>)' previously declared here
     void parentTags(ArrayList<String> parentTags) {
          ^~~~~~~~~~
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\Device.cpp:18:19: error: redefinition of 'ArrayList<String> Device<T>::parentTags()'
In file included from F:\Projects\PythonProjects\LEADS\arduino\leads_vec\Device.cpp:1:0:
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\Device.h:28:23: note: 'ArrayList<String> Device<T>::parentTags()' previously declared here
     ArrayList<String> parentTags() {
                       ^~~~~~~~~~
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\Device.cpp:22:6: error: redefinition of 'void Device<T>::pinsCheck(int)'
In file included from F:\Projects\PythonProjects\LEADS\arduino\leads_vec\Device.cpp:1:0:
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\Device.h:31:10: note: 'void Device<T>::pinsCheck(int)' previously declared here
     void pinsCheck(int requiredNum) {
          ^~~~~~~~~
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:5:1: error: prototype for 'ArrayList<E>::ArrayList(int)' does not match any in class 'ArrayList<E>'
In file included from F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:1:0:
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.h:30:5: error: candidates are: ArrayList<E>::ArrayList(E*)
     ArrayList(E *const initialArray) : _size(0), _array(initialArray) {}
     ^~~~~~~~~
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.h:29:5: error:                 ArrayList<E>::ArrayList(size_t)
     ArrayList(size_t initialCapacity = 10) : _size(0), _array(new E[initialCapacity]) {}
     ^~~~~~~~~
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:9:1: error: redefinition of 'ArrayList<E>::ArrayList(E*)'
In file included from F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:1:0:
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.h:30:5: note: 'ArrayList<E>::ArrayList(E*)' previously declared here
     ArrayList(E *const initialArray) : _size(0), _array(initialArray) {}
     ^~~~~~~~~
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:13:5: error: redefinition of 'int ArrayList<E>::size()'
In file included from F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:1:0:
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.h:34:9: note: 'int ArrayList<E>::size()' previously declared here
     int size() {
         ^~~~
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:17:11: error: redefinition of 'E* const& ArrayList<E>::toArray()'
In file included from F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:1:0:
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.h:37:15: note: 'E* const& ArrayList<E>::toArray()' previously declared here
     E *const &toArray() {
               ^~~~~~~
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:21:3: error: redefinition of 'E ArrayList<E>::get(int)'
In file included from F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:1:0:
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.h:40:7: note: 'E ArrayList<E>::get(int)' previously declared here
     E get(int index) {
       ^~~
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:25:6: error: prototype for 'void ArrayList<E>::grow(int)' does not match any in class 'ArrayList<E>'
In file included from F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:1:0:
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.h:12:10: error: candidate is: void ArrayList<E>::grow(size_t)
     void grow(size_t minCapacity) {
          ^~~~
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:34:6: error: prototype for 'void ArrayList<E>::ensureExplicitCapacity(int)' does not match any in class 'ArrayList<E>'
In file included from F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:1:0:
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.h:20:10: error: candidate is: void ArrayList<E>::ensureExplicitCapacity(size_t)
     void ensureExplicitCapacity(size_t minCapacity) {
          ^~~~~~~~~~~~~~~~~~~~~~
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:38:6: error: prototype for 'void ArrayList<E>::ensureCapacityInternal(int)' does not match any in class 'ArrayList<E>'
In file included from F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:1:0:
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.h:23:10: error: candidate is: void ArrayList<E>::ensureCapacityInternal(size_t)
     void ensureCapacityInternal(size_t minCapacity) {
          ^~~~~~~~~~~~~~~~~~~~~~
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:43:6: error: redefinition of 'void ArrayList<E>::add(E)'
In file included from F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:1:0:
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.h:43:10: note: 'void ArrayList<E>::add(E)' previously declared here
     void add(E element) {
          ^~~
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:48:6: error: redefinition of 'bool ArrayList<E>::contains(E)'
In file included from F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:1:0:
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.h:48:10: note: 'bool ArrayList<E>::contains(E)' previously declared here
     bool contains(E element) {
          ^~~~~~~~
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:52:5: error: redefinition of 'int ArrayList<E>::indexOfInRange(E, int, int)'
In file included from F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:1:0:
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.h:51:9: note: 'int ArrayList<E>::indexOfInRange(E, int, int)' previously declared here
     int indexOfInRange(E element, int start, int stop) {
         ^~~~~~~~~~~~~~
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:57:5: error: redefinition of 'int ArrayList<E>::indexOf(E)'
In file included from F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:1:0:
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.h:55:9: note: 'int ArrayList<E>::indexOf(E)' previously declared here
     int indexOf(E element) {
         ^~~~~~~
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:61:5: error: redefinition of 'int ArrayList<E>::lastIndexOfInRange(E, int, int)'
In file included from F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:1:0:
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.h:58:9: note: 'int ArrayList<E>::lastIndexOfInRange(E, int, int)' previously declared here
     int lastIndexOfInRange(E element, int start, int stop) {
         ^~~~~~~~~~~~~~~~~~
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:66:5: error: redefinition of 'int ArrayList<E>::lastIndexOf(E)'
In file included from F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.cpp:1:0:
F:\Projects\PythonProjects\LEADS\arduino\leads_vec\ArrayList.h:62:9: note: 'int ArrayList<E>::lastIndexOf(E)' previously declared here
     int lastIndexOf(E element) {
         ^~~~~~~~~~~

exit status 1

Compilation error: candidate is: Device<T>::Device(int*)

`leads_dashboard`: font data is not included in the published package

Description

The following error is triggered when executing leads_vec.

Exception: Error: [1000] Message: 	Font file could not be found

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/site-packages/leads_vec/__main__.py", line 13, in <module>
    from leads_vec.cli import main as _main
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/site-packages/leads_vec/cli.py", line 9, in <module>
    from leads_dashboard import *
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/site-packages/leads_dashboard/__init__.py", line 13, in <module>
    H1 = load_font(size=100)
         ^^^^^^^^^^^^^^^^^^^
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/site-packages/leads_dashboard/fonts.py", line 10, in load_font
    return _dpg.add_font(file, size)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/*****/opt/anaconda3/envs/TEMP/lib/python3.11/site-packages/dearpygui/dearpygui.py", line 4339, in add_font
    return internal_dpg.add_font(file, size, label=label, user_data=user_data, use_internal_label=use_internal_label, tag=tag, pixel_snapH=pixel_snapH, parent=parent, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <built-in function add_font> returned a result with an exception set

Cause

The folder leads_dashboard/_font is not correctly uploaded, resulting in the file-not-found error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.