Package: leads
LEADS: Lightweight Embedded Assisted Driving SystemLEADS is a lightweight embedded assisted driving system. It is designed to simplify the development of the
instrumentation system for electric vehicles. It is written in well-organized Python and C/C++ with impressive
performance. It is not only plug-and-play (theVeC 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 moduleleads_vecandleads_vec_rcsimply
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.Before you start, please note that LEADS only supports rear drive and two drive-wheel configurations: single rear
wheel (SRW) mode and dual rear wheel (DRW) mode.Key FeaturesA basic instrumentation systemA basic communication systemA basic control systemA data recording system with the following componentsA speed recording systemA G force recording systemA GPS recording systemA battery voltage recording systemA control system with the following componentsDTCS (Dynamic Traction Control System)ABS (Anti-lock Braking System)EBI (Emergency Braking Intervention)ATBS (Automatic Trail Braking System)To High School StudentsThe codes are never designed for average high school students to understand. You may find it hard to read the codes if you do not satisfy the following requirements of skills and knowledge.Advanced Python knowledge (you should be familiar with everything and even programming philosophy in Python)Solid knowledge of Physics (you should understand how a car moves in reality)Basic embedded development experience (C/C++, Raspberry Pi, Arduino, serial communication, PWM)Rich experience in Web development (React, Next.js, FastAPI, TCP/IP, sockets)Basic machine learning knowledge (linear regression, polynomial regression)InstallationPythonNote that LEADS requiresPython >= 3.12.pipinstallPillowcustomtkinterkeyboardpyserialleadsnumpywill be automatically installed withleads.Pillow,customtkinter,keyboard, andpyserialare optional.If you only want the framework, run the following.pipinstallleadsVerifypython-mleads_vecinfoArduinoYou can installLEADS-Arduinofrom Arduino Library Manager. Note that it is named "LEADS", not "LEADS-Arduino", in the index.LEADS FrameworkSeeRead the Docs(TBC) for the documentation of how to customize and make use of the framework in your project.Quick StartMainpython-mleads_vecrunOptional ArgumentsRun the following to get a list of all the supported arguments.python-mleads_vec-hSpecify a Configuration Filepython-mleads_vec-cpath/to/the/config/file.jsonrunIf not specified, all configurations will be default values.To learn about the configuration file, readConfigurations.Generate a Configuration Filepython-mleads_vec-rconfigrunThis will generate a default "config.json" file under the current directory.Register as a Systemd Servicepython-mleads_vec-rsystemdrunThis will register a system service to start the program.To enable auto-start at boot, run the following.systemctldaemon-reload
systemctlenableleads_vecRemote Controllerpython-mleads_vec_rcGo to the online dashboardhttps://leads-vec-rc.projectneura.org.Register as a Systemd Servicepython-mleads_vec_rc-rsystemdThis will register a system service to start the program.To enable auto-start at boot, run the following.systemctldaemon-reload
systemctlenableleads_vec_rcEnvironment SetupThis section helps you set up the exact environment we have for the VeC project. A more detailed guide of reproduction is available onhttps://leads.projectneura.org, but first of all, we run an Ubuntu 22.04 LTS on a Raspberry Pi 4 Model B 8GB. After the OS is set up, clone the repository or download the scripts fromreleases(only stable releases provide scripts).You can simply run "setup.sh" and it will install everything for you. If anything goes wrong, you can also manually install everything.If you install Python using the scripts, you will not findpython ...,python3 ...,pip ..., orpip3 ...working
because you have to specify the Python version such thatpython3.12 ...andpython3.12 -m pip ....ConfigurationsThe configuration is a JSON file that has the following columns. You can have an empty configuration file like the following as all the columns are optional.{}Note that a purely empty file could cause an error.TypeUsageUsed ByDefaultdebug_levelstr"DEBUG","INFO","WARN","ERROR"Main, Remote"DEBUG"srw_modeboolTrue: single rear wheel;False: dual rear wheelMain, RemoteTruewidthintWindow widthMain720heightintWindow heightMain480fullscreenboolTrue: auto maximize;False: window modeMainFalseno_title_barboolTrue: no title bar;False: default title barMainFalsemanual_modeboolTrue: hide control system;False: show control systemMainFalserefresh_rateintGUI frame per secondMain30font_size_smallintSmall font sizeMain8font_size_mediumintMedium font sizeMain16font_size_largeintLarge font sizeMain32font_size_x_largeintExtra large font sizeMain48comm_addrstrCommunication server addressRemote"127.0.0.1"comm_portintThe port on which the communication system runs onMain, Remote16900data_dirstrThe directory for the data recording systemRemote"./data"enable_data_persistenceboolTrue: enable data persistence;False: disable data persistenceRemoteTrueSubmodulesLEADS-Arduinoleads-docsleads-vec-rc(Private)Periodic ReportSeereports.ArchitectureMainPin ConfigurationRemote ControllerCollaborationsCommunityIssuesOur team management completely relies on GitHub. Tasks are published and assigned asissues. 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.bugreports a bugcode reviewdiscusses a code review or commentdocumentationsuggests a documentation enhancementduplicatemarks that a similar issue has been raisedenhancementproposes a new feature or requesthelp wantedmeans that extra attention is needed to this issueinvalidmarks that the issue is in a valid formatquestionrequests further informationreportstates that it is discussed in the meetingtodocreates a new taskwontfixmarks that the issue is ignoredLabel your issue with at least one of the labels above before you submit.ProjectsYou can have a look at the whole schedule of each project in a timeline using theprojectsfeature.Code ContributionsSeeCONTRIBUTING.md.