This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pypilot on Micropython?
#2
I'm very interested in not using a board with an OS because of the time it takes to boot.  If the PyPilot we have today loses power, it's around 40 seconds before the autopilot is back on line.  That's a loooong time if you're on your boat and hell's breaking loose, and you really need the autopilot to take the helm now.

I've looked into the possibility of a MicroPython port.  I see six main obstacles:

  1. Multiprocessing / multithreading.  As currently written, PyPilot spawns Linux processes, and uses the Python multiprogramming library.  Neither of these is supported by MicroPython.  MicroPython programs should be written to use async/await, and/or use the _threading library, although support for the latter is still experimental.  Rewriting to use these would result in code that would be too different to keep in one codebase, although code written to use async/await may work In CPython and MicroPython.

  2. PyPilot as written uses TCP sockets, unix domain sockets, and does I/O by doing reads/writes on Linux character device files.  The way MicroPython programs do networking, interprocess communication, and device I/O is quite different.  See above re divergent codebases.

  3. Some of the autopilot algorithms use the TensorFlow AI library.  Not a dealbreaker as the main algorithm doesn't.

  4. PyPilot as written uses the RTIMULib2 IMU library.  This library would either need to be ported to an MCU, or replaced with something else.

  5. PyPilot as written calls SciPy to do IMU calibration (least squares calculation, and Orthogonal Distance Regression).  SciPy is never going to run on an MCU.  This code would need to be replaced with something else.

  6. Sean may give his blessing for such a port, and may not.  Who would work on a port if Sean did not?

I would be very interested to hear what others think.
Reply


Messages In This Thread
Pypilot on Micropython? - by dave42w - 2024-04-09, 03:41 AM
RE: Pypilot on Micropython? - by CapnKernel - 2024-04-09, 12:13 PM
RE: Pypilot on Micropython? - by seandepagnier - 2024-04-12, 05:41 AM
RE: Pypilot on Micropython? - by dave42w - 2024-04-12, 02:36 PM
RE: Pypilot on Micropython? - by dave42w - 2024-04-09, 03:57 PM
RE: Pypilot on Micropython? - by seandepagnier - 2024-04-12, 03:39 PM
RE: Pypilot on Micropython? - by dave42w - 2024-04-13, 01:00 PM
RE: Pypilot on Micropython? - by mgrouch - 2024-04-12, 03:53 PM
RE: Pypilot on Micropython? - by seandepagnier - 2024-04-13, 03:34 PM
RE: Pypilot on Micropython? - by dave42w - 2024-04-13, 06:18 PM
RE: Pypilot on Micropython? - by seandepagnier - 2024-04-14, 11:19 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)