Author Archives: paynterf

Porting LIDAR-based ‘Find Best Direction’ to Vision-Enhanced Robot

Posted 13 October 2026

While working on my new ‘vision-enhanced’ robot project, it became apparent the the OAK-D Lite camera was not the best tool for handling a ‘stuck’ condition where the robot has nosed into something and needs to find a better movement direction. The camera After some experimentation, I found that by moving the rear-facing VL53L1X LIDAR distance sensor to the front of the robot, I could turn the robot under manual (‘C’) control and watch the reported LIDAR distances change. Since I had already solved the ‘Find Best Direction’ problem on my older robot, I decided to port the code into the new vision-enhanced robot.

Looking back through my old code in C:\Users\Frank\Documents\Arduino\WallE3_Git\WallE3_Git\WallE3_Git.ino, I found a reference to this post. It wasn’t directly relevant as it discussed the problem of sorting multiple arrays in a synchronized fashion so as to arrive at a situation where all the distance and heading sensor arrays are sorted in lockstep with a ‘master’ array containing front distance readings. Then the ‘dependent’ array readings associated with the maximum front distance reading can be easily read off.

This isn’t really necessary for the vision-enhanced robot, as there are only two sensors of interest – the front distances and the associated headings. I believe I should be able to set up two small lists (say 10 elements; front distance readings and associated headings. As the robot rotates, each new distance reading is compared to the stored ones, and replaces the largest value that is smaller than it. The headings array value associated with the replaced heading value gets replaced by the heading value associated with the new distance value. At the end of the rotation, the distance array should contain the 10 highest distance readings, sorted in descending order, and the heading array should be synchronized to their associated distances. Then an ‘appropriate’ heading can be selected from the data (‘appropriate’ to be defined later).

It turns out UpdateIMUHdgValDeg() already manages a HEADING_HISTORY_ARRAY_SIZE array of heading values, where earlier values are bumped up (down in index) and the latest value is stored at gl_HdgHistoryArray[HEADING_HISTORY_ARRAY_SIZE – 1]. If I also have a HEADING_HISTORY_ARRAY_SIZE array of distance values that are handled in the same manner, that should be all I need. I’m pretty sure I already have that array, as that is what is used to calculate variances needed to detect ‘stuck’ conditions. Yep – its there but named ‘aRearDistCM’ instead of ‘aFrontDistCM’. I’ll let that ride until everything is working and then change ‘Rear’ to ‘Front’ everywhere. CalcBruteRearDistArrayVariance() is also there for stuck detection. bool IsStuckBehind() is missing so copied it from WallE3_Git.ino to VisionEnhancedRobot…’. ino (into MISCELLANEOUS section).

Looking back through the code and previous posts, I built up the ‘QuickSort’ algorithms to handle just this situation, so abandoning them for something simpler does not seem real smart; it’s already there, and it works.

Well, maybe not. Looking at WallE3_Git.ino, I see that the RunToDaylight() code does not appear to use QuickSort at all – it does the ‘simpler’ idea of rotating 10 deg at a time, recording both heading and distance. After the rotation I see:

which is pretty much exactly the ‘simpler’ idea I was thinking about.

Well, I may have spoken too soon. WallE3_Git.ino has *two* ‘RunToDaylight()’ functions, ‘RunToDaylight()’ and ‘RunToDaylightV2()’, and ‘RunToDaylight()’ is apparently never called and was replaced by ‘RunToDaylightV2()’ which incorporates the QuickSort algorithms. However, only RunToDaylightV2() Step5:

applies to this situation – all the other code is aimed at finding a trackable wall. Step5 is basically ‘RunToDaylight()’ with the distance and heading arrays presorted by decreasing distance with

I made the decision to port all the ‘RunToDaylightV2()’ and supporting code to the new ‘stuck-recovery’ branch, trimmed down to just the ‘Hdg’ and ‘FrontD’ arrays for now (may later want to add RearD, but not now). This is basically just the ‘Step5’ portion of ‘RunToDaylightV2()’, with the addition of all the supporting code for QuickSort operations.

I have the ‘stuck ahead’ detection running now. Here’s a sample output:

The next step is to use the ‘RunToDaylightV2()’ function and supporting QuickSort code to determine the best direction to travel *after* IsStuck() returns TRUE.

18 October 2026 Update:

After getting the stuck-recovery code working, I created a new C++ project on my PC to parse through the output generated by the 360 degree scans from ‘stuck-recovery’. Here’s the final code:

Including both 36-point (10 deg steps) and a 72-point (5 deg steps) datasets from the ‘stuck-recovery’ code. With the 72-point (5 deg steps) scan data active, the .cpp program produces the following output.

The above plot was generated using a small Python program generated by Grok, as shown below:

19 October 2026 Update:

Grok modified the ‘polar_scan.py’ script to pull the required ‘bestStart’ and ‘bestEnd’ values directly out of the raw data from the robot. With the following data

The polar_scan.py program produced the following plot:

This is a bit of an unrealistic scenario, as I deliberately started the robot scan with its front toward the open doorway, in order to excite the edge case where the ‘best direction’ lobe crosses over the +/- 0 deg boundary. In reality the ‘best direction scan will almost certainly start with the robot pointed away from the ‘best’ direction, as that condition is what triggers the ‘run to daylight’

It is also unrealistic in another way, in that this data was collected with my robot sitting on my bench, with the robot’s VL53L1X distance sensor about 90cm off the ground. In reality it will be more like 17cm off the floor in real operation.

Here is the scan from the robot sitting on the floor, starting with its nose just a few centimeters away from a simulated wall, with the open area behind it.

As the plot shows, there is a fairly wide of headings from about -135 to +135 deg, with the peak at about -170 or so. This corresponds very to the actual layout of my lab.

I attached my iPhone to the robot in the same place as the VL53L1X sensor and ran another 360 scan. The result was this video:

261019 360 deg scan in 5-deg steps, starting with the robot’s nose just a few cm from a simulated wall

The far doorway can be seen in the video at about the 8 second mark.

20 October 2026 Update:

The ‘Find Best Direction’ study is complete. the ‘polar_scan.py’ script takes the scan data from the robot and produces the polar plot shown below:

Now it’s time to integrate all this back into the mainline repo. I had a conversation with Grok about this, and I believe I am coming around to his/its way of thinking. Have the teensy handle initial ‘stuck’ detection using a variance threshold on the front-facing VL53L1X. If a stuck condition is detected, notify the Pi5. The Pi5 tells the teensy to back up 1 sec & perform a 360 deg scan and report distances and headings. The Pi5 will then run the above ‘polar_scan’ script to determine the best escape direction and tell the teensy to turn to that heading. After that the Pi5 uses the camera to validate the escape direction, and if it agrees, normal travel/navigation is resumed.

21 October 2026 Update:

I committed/pushed the ‘stuck-recovery’ branch from my PC – this is all the stuck-recovery scan code, but minus all the required integration code.

So, what to do about the big switch statement in CheckForUserInput? Right now it switches on the first character of the string. Some commands are truly single-character (C, H, U…) but some are single-alpha + numeric (Txx, Lxx, Rxx), where the ‘xx’ are arbitrary numeric characters. Now I want to add full-string commands like ‘STUCK_SCAN’, but this results in “Unknown top-level character”. I could add a ‘S’ case, but I might eventually run out of single-character commands. Maybe the way to handle this is with a ‘!’ (bang) prefix, which says “look at the full string”. A case statement like “case ‘!’: would handle all multi-alpha characters commands and would then use internal ‘if’ statements to accommodate an arbitrary number of commands

So, I started with “!STUCK_SCAN”. When this string is entered at the serial port, CheckForUserInput() runs this code:

It stops the motors and then calls RunToDaylightV2():

which repeatedly calls SpinTurn(true, 5) to scan 360 degrees.

This all works great – except – – – when RunToDaylightV2 is running a scan, it can’t be stopped – oops! The reason it can’t be stopped is because it isn’t calling CheckForUserInput() inside the ‘for’ loop. The obvious answer is to place a call to CheckForUserInput() inside the loop and then send a ‘C’ character to the teensy, which will stop the motors ….. except that it doesn’t; it stops the motors, but then the next call to SpinTurn() starts them up again – rats!

So, next we try using the bool return from CFUI() to guard the SpinTurn() calls, like so:

But, this doesn’t work either, because the call to CFUI here doesn’t have anything to do with the part of CFUID that called RunToDaylightV2 – completely separate. So, I finally decided that the only way to reliably handle this (and other similar) issues is to establish a global ‘status’ variable ‘gl_AnomalyCode’ that can be set in CFUID and read anywhere. I actually had this in my previous WallE3_git project, and even had a separate ‘enum.h’ file to house the anomaly codes and other enums. I copied just the AnomalyCode section from enum.h, as shown below:

Then I added the global variable ‘uint8_t gl_AnomalyCode = ANOMALY_NONE;’ to hold the current anomaly code, and set it to ‘ANOMALY_STUCK_AHEAD’ in the ‘!STUCK_AHEAD’ CFUI section, and back to ‘ANOMALY_NONE’ in the ‘C’ CFUI section. This fixed the problem entirely (but not necessarily elegantly). RunToDaylightV2 checks the value of gl_AnomalyCode each time through the scan loop, and terminates if it isn’t ANOMALY_STUCK_AHEAD.

After sleeping on this, I started thinking that what I really want instead of (or maybe in addition to ANOMALY_CODES is a SYSTEM_STATUS enum, with STATUS_MANUAL_CONTROL set system-wide whenever the user inputs ‘C’.

enum SystemStatus {   STATUS_MANUAL_CONTROL = 0,   STATUS_AUTO_NAV }; SystemStatus gl_SystemStatus = SystemStatus::STATUS_AUTO_NAV;

Then, in RunToDaylightV2():

    if (gl_SystemStatus == STATUS_MANUAL_CONTROL)     {       return;     }

And in CheckForUserInput() -> ‘C’ case:

gl_SystemStatus = SystemStatus::STATUS_MANUAL_CONTROL

And in CheckForUserInput() -> ‘C’ case:

And in RunToDaylightV2():

I will keep the AnomalyCode stuff around as well, but just not for this purpose:

After making these changes, I ran the Teensy program and simulated a Pi5 command to perform a stuck scan by sending “!STUCK_SCAN’ at the PC serial port, and then sent ‘C’ after the scan actually started, with the following output:

23 October 2026 Update:

So now I have the teensy RunToDaylightV2() and CheckForUserInput() code modified to handle ‘!STUCK_AHEAD’, ‘STATUS_MANUAL_CONTROL’ and ‘!STUCK_SCAN’ situations, it’s time to make the associated changes/additions to the Pi5 code.

In a ‘stuck_ahead’ situation, the teensy sends ‘!STUCK_AHEAD’ to the Pi5 via Serial1, and it is captured by the ‘telemetry_loop()’ function.

As shown in the code above, any line from the teensy of the form “[timestamp]: [body]” where ‘body’ is “DONE [cmd]”, “ACK [cmd]”, or “BUSY [cmd]” has the [body] extracted and placed in the ‘teensy_events’ queue. This queue is examined in ‘wait_for_done’ and if one of the above strings is present, does the right thing. This isn’t directly applicable to the ‘stuck’ situation, but something similar will be necessary. ‘telemetry_loop’ will have to recognize the anomaly flag from the teensy and pass it along to the main nav function

25 October 2026 Update:

I’m getting closer to the complete ‘stuck ahead’ interaction between the teensy and the pi5, but still having problems.

In order to allow the ‘manual control’ command (now ‘M’) to abort a 360-degree scan, I added

which skips all the remaining SpinTurn() invocations.

26 October 2026 Update:

I’m running into some conceptual (or maybe semantics) issues with the robot project. The Pi5 recognizes two different modes; ‘Auto’ where the Pi5 drives by sending commands to the robot via Serial1, and ‘Manual’ where the user drives by sending commands to the robot via either a direct USB cable connection (Serial) or by way of the wireless SSH connection to the robot (relayed by the Pi5 over Serial1). In ‘auto’ mode, only the Pi5 talks to the robot.

09 November 2026 Update:

The ‘stuck_ahead’ recovery project is pretty much complete. The robot will now recognize the situation, perform a ‘stuck_recovery’ process that includes using the front-facing LIDAR to measure the available ‘straight ahead’ distance every 5 degrees around a complete rotation, then turning to the ‘best’ direction and proceeding. Here’s a short video showing the recovery operation:

Once we got ‘stuck-recovery’ going, it became apparent that we had somehow managed to kill the ‘rolling turn’ behavior of the normal auto-nav mode. We finally figured out that we needed a new ‘!TWEAK command and another default argument to the SpinTurn(). function, and this got us back to the original ‘rolling turn’ behavior, as shown in the following short video:

At this point the ‘stuck-recovery’ project is pretty much complete, so I decided to merge the ‘stuck-recovery Github branch back into the ‘main’ branch. This turned out to be *much* more complicated than I thought, and I would never have gotten it done without Grok’s help. I am learning a lot about git version control and ‘history’ vs ‘code’, so that’s a win at least.

Next up ‘Too Close’ recovery: This should be identical to the ‘stuck_ahead’ case, differing (I think) only in the triggering condition.

Vision-enhanced Robot ‘Find Best Direction’ Issue

Posted 14 October 2026

WallE, my autonomous wall-following robot had a nominal capability called “run to daylight”. The idea was to use this as a last resort when all the other ‘find a wall and follow it’ tricks failed. Unfortunately, I never could get this to work and never figured out why. Fast forward to the present, and Grok and I were trying to implement the same kind of capability into the new vision-enhanced version, to address the issue of what to do when the robot gets stuck.

Basically, the algorithm is the same as it was for the wall-following version; back up, look around and turn to the heading that provides the most freedom (‘largest depth’ in vision processing language). We (Grok and I) implemented the “back up and look around” operations using the new ‘L/Rxxx’ (where ‘xxx’ is in degrees), and then the ‘turn to the best heading’ utilizes a new ‘Txx’ command which is implemented via the already-existing ‘TurnToHdgDeg()’ function.

Unfortunately, although the ‘back up and look around’ part worked almost immediately, the ‘turn to the best heading’ part failed miserably, with the end result consistently going off in a completely different direction. I was somewhat mystified by this, as I was suffering from the (soon-to-be-debunked) belief that my MPU6050 IMU/DMP was actually delivering accurate heading measurements, and the problem must be in the ‘TurnToHdgDeg()’ function. However, data beats belief, so I decided to go back to basic ‘show me’ experiments.

To validate the MPU6050 IMU function operation, I set up an experiment where I manually rotated the robot on a printed compass rose, and measured the output of the IMU at each point, as shown in the following Excel table and resulting plot:

The above plot looks ugly, but a lot of the ugliness is due to the way IMU heading output jumps from +180 to -179; this is normal. What isn’t normal is the way the IMU reported heading diverges from the actual heading – the +180 to -179 transition occurs between 150 and 160 degrees rather than 180, and the -179 to +180 transition occurs between -140 and -150 degrees on the other side.

At first I thought this must be due to a bad IMU module, but changing out the module for a brand-new one produced the same results – so not that (further validation of my “hardware never fails – its ALWAYS the software” mantra).

So, I made another plot, this time manually changing the ‘opposite sign’ measurements back into the proper range by adding/subtracting 360 degrees. This produced the following plot:

Just looking at the ‘positive’ half from 0 to 180 deg, it is clear that the measured values are consistently higher than the actual physical headings. Looking at the first five values (before the first breakpoint in the plot) we see the differential goes from zero to about 156.8-120 = 36.8 deg over a 150 deg range, or about 36.8/150 = 0.25 deg/deg. Assuming the difference is linear, then the required multiplication factor should be 156.8X = 120 –> X = 120/156.8 = 0.769. For example, a multiplicative factor of 0.787 yielded the following plot:

Good enough for government work ;).

This factor can’t be applied directly to the IMU yaw output, as that value has already been corrected for the +/- 180 arrangement, so Grok suggested an algorithm to hold a ‘running total’ heading that uses IMU heading changes to produce a separate heading value that is corrected for the slope error and only afterwards applies the +/- 360 adjustment for the +/-180 scheme, as follows:

18 October 2026 Update:

Since the last post I have been working hard on the ‘Find Best Direction’ problem, and now I (with lots of help from Grok Code) have it pretty much licked. Rather than continue to mess up my robot Arduino code, I created a small C++ console project to study the process of converting the raw Heading/Front Distance values from a robot 360-degree scan into one or more ‘runs’ of distance/heading pairs where the distance part is greater than some threshold (currently set at 200cm).

Originally I thought that the way to go was to first reverse-sort the timestamp, heading and distance data fields with ‘distance’ as the master field. This would give me all the distances in descending order, with the associated heading and timestamp values listed with them. To do this I ported the ‘QuickSort’ machinery from my May 2024 ‘Wall3_Git’ project into my ‘stuck_recovery’ branch of my current ‘VisionEnhanced4WheelRobot’ Github repo, and then onward to my little ‘RobotBestDistV2.cpp’ exploratory project, shown below:

Almost half of the actual code above is dedicated to QuickSort-related code, and as I have now found out – none of it is actually necessary – elegant, pretty – and useless. Once I took all that out, the RobotBestDistV2.cpp test program shrank down to something much smaller, as shown below:

The above is about 360 lines long, and well over half of it is copy/pasted test data from the robot scans.

After figuring that out, I used the robot code to actually do the 360 scan to collect the heading/distance data and then copy/pasted the data in text form into my RobotBestDistV2.cpp test program. This allowed me to iterate pretty quickly through different techniques while keeping the two programs isolated from each other.

The first set of data (commented out in the above code) was from a 360 scan in 10 deg steps for a total of 36 steps. This was nice, but I wanted to see what would happen with 5 deg steps – and that is the second set of data. I also wanted to verify if this test program would handle the (highly improbable, but not impossible) case where the best ‘far’ lobe spanned the +/- 0 deg split (it does – yay!). Here’s the printout from the last run:

Looking at the raw data, you can see that one section of the ‘far’ lobe goes from ‘samples[0]’ through ‘samples[12]’ and the other section goes from ‘samples[69]’ through ‘samples[71]’, for a combined ‘far’ lob of about 78.6 deg. Cool!

Wall-E Gets New Wheels

Posted 09 September 2026

While upgrading my 4-wheel autonomous wall-following robot to add vision enhancement, Wall-E managed to dive off my bench onto the floor – twice! No major damage except to my ego, but one wheel did get dinged up to the point where it needed to be replaced.

The original wheels were designed in OSCad many years ago, so the print files were no longer available. I designed a replacement wheel using my new best friend OnShape, as shown in the screenshot below:

After getting the design dialed in (version 6), I printed out the remaining three wheels and transferred the tires from the old wheels to the new ones. Since the tires were already red, I chose to print the wheels in gray PETG to produce an Ohio State University themed robot ;). Here’s a short video showing off the new wheels:

AC Power Generator Issues During Recent House Power Loss

Posted 31 August

On 11 August 2026 we had a multi-hour night-time AC power loss at our home, and although I was able to get our backup power generator running and AC power partially restored, there were some ‘issues’.

When our house was built in 2000, I had the electrician install a 240-volt twist-lock receptacle in the garage and an auxiliary breaker panel at the main AC breaker location to support the use of a backup AC power generator. Then I fabricated a 50′ jumper cable so the generator could be connected to the 240-volt connector while still outside the garage.

I didn’t actually buy the generator shown below until 2022, as AC power in our area has been very reliable, and other than testing the unit and transfer switch, it was never used ‘in anger’ until a couple of weeks ago when we had a night-time multi-hour power interruption.

I have a hobbyist engineering lab in our home, with several PC’s protected from short AC interruptions with typical single-PC UPS units. So, when the power loss occurred all the lights went out, but our PCs (and their associated displays) stayed up so we weren’t totally in the dark, but I knew that wasn’t going to last long – I needed to get that generator going before we were totally in the dark.

Using my phone as a flashlight (VERY helpful!) I went out into the garage, where I was immediately faced with the problem of getting the garage door open with no AC power. After finally getting the door open, I got the generator moved outside and tried to start it up – no dice; the electric starter solenoid just chattered without actually engaging the motor. A quick visual inspection showed that the onboard 12V SLA batter was grossly swollen – most likely due to my use of an old-style battery charger to keep the battery topped off. Fortunately, I was able to get the generator started using the manual pull cord – yay!

After getting the generator started, I got the 50′ extension cable connected to the 240-volt power receptacle in the garage and toggled the transfer switch on the emergency power sub-panel in the utility room, again using my phone as a flashlight. After toggling the transfer switch, I got lights and PC power back in my engineering lab, but there were still some issues.

  • Both the in-house refrigerator and the freezer in the garage were still unpowered (this was later found to be due to me finger-fumbling the transfer switch)
  • The house internet router and LAN ethernet switches were still unpowered. This was unexpected, but not a big deal as I was able to run an extension cord from my engineering lab space to the router/switch power strip.
  • The garage door was still unpowered.

Utility power was restored after about 3 hours, so I was able to shut down the generator, toggle the transfer switch back to the default position, and generally put everything back together before going to bed. Overall an exciting evening.

31 August Update:

The next day I was able to review the previous night’s activities and make some adjustments for the next time. I ordered a new battery for the generator, and a new modern SLA-compatible float charger, as shown below:

Interestingly, I couldn’t find a replacement battery with the same terminal arrangement as the one that came with the generator. The original had the positive terminal on the left, and all compatible offerings from Amazon had the positive terminal on the right. Fortunately I was able to confirm that the attachment cables had enough slack to reach.

After getting the battery replaced and charged, I went through the entire process again – getting the garage door open, getting the generator outside the garage and started up, getting the 240-volt cable connected to the garage 240-volt receptacle, and toggling the transfer switch on the emergency power panel. This time both the house refrigerator and the in-garage freezer had power, and I realized that I had fumble-fingered the transfer switch during the actual power failure.

Moving Vision Processing to My 4-Wheel Robot, Part 2

Posted 03 August 2026,

Part 1 in this series laid out the strategy for adding vision processing capabilities to my 4-wheel robot. This post continues that effort.

The first step was to replace the Teensy 3.6 main controller with a Teensy 4.1. As part of this process, I also replaced the glued-on ‘Gnd’ and ‘+5V’ bussbars with a bit more finished product, as you can see in the following photos:

The next step is moving the old 4-wheel firmware to the ‘new-improved’ 4-wheel hardware. I started this by porting “C:\Users\Frank\Documents\Arduino\WallE3_Git\WallE3_Git\WallE3_Git.ino” to “C:\Users\Frank\Documents\Robot_Projects\VisionEnhaned4WheelRobot_V1\VisionEnhaned4WheelRobot_V1.ino”. This took a while, and I’m not sure I wouldn’t have been better off just cloning the entire WallE3_Git.ino file, but I “got it done’.

05 August 2026 Update:

It took a while, but I now have a working 4-wheel drive robot program running again on the 4-wheel chassis with a Teensy 4.1 main controller The only small ‘gotcha’ I encountered during the Teensy 3.5 -> Teensy 4.1 controller switch was the control lines for the right motor driver. It turns out the ‘speed’ (PWM) pin used on the Teensy 3.5 isn’t PWM-capable on the Teensy 4.1, so this required some minor pin swapping, as shown below:

Using the manual control features built accessible via the ‘CheckforUserInput() function, I was able to perform left/right 10 degree turns and speed up/slow down, all from my keyboard. I don’t have the second deck connected up yet, but that is next on the agenda.

Upgraded 4-wheel robot demonstrating basic motor

06 August 2026 Update:

4-wheel robot with Raspberry Pi5 and OAKD-Lite camera mounted on 2nd deck

At this point I have a complete 4-wheel drive robot assembled with a Raspberry Pi5 and OAKD-Lite camera, and I can send it basic (left/right/faster/slower/forward/reverse) movement commands via a serial port. In previous work on the 2-wheel robot I demonstrated the ability to send vision-processing-derived movement commands to the main processor from the Pi5 via a serial port.

It occurs to me that with the above capability, The robot doesn’t really need anything else for navigation and obstacle avoidance. The OAKD-Lite can provide visual depth information to the Pi5, and the Pi5 can send basic movement commands to the robot. In addition, it seems to me that I might be able to eliminate the entire ‘homing-to-charger’ software and hardware blocks, as the camera should be able to tell the Pi5 where the charger dock is located in the field of view, and the Pi5 should be able to tell the robot which way to turn and by how much, and when to speed up and slow down. This could make the robot a LOT simpler (as Elon Musk said about Tesla FSD “Once you have vision solved, you no longer need anything else’).

08 August 2026 Update:

The robot is alive! With Grok’s help I now have a python script running on the Pi5 that can direct the robot to turn left or right depending on image processing by the OAKD-Lite camera.

First, the Python shell script ‘restart_camera.sh’ is executed to get the OAKD-Lite camera ready:

Once the camera is ready, then the demo program ‘clearest_direction_node.py’ is executed on the Pi5 (with ‘VisionEnhanced4WheelRobot.ino already running on the Teensy 4.1)

Based on a rudimentary analysis of the depth (distance) distribution in the camera field of view, the ‘clearest_direction_node.py’ Python script sends left/right/stop commands to the Teensy 4.1 from the Pi5’s serial port to the Teensy 4.1’s ‘Serial1’ port. The commands use the already-existing robot manual motion control command structure shown below:

Here’s a short video showing the action

Here’s another short video showing the robot actually making 10-deg turns left & right in response to a simulated obstacle in the field of view:

And here is some of the telemetry output from the above run:

At this point in the project, we have demonstrated that visual ‘depth’ information can be used to guide the robot, and we have separately demonstrated that the Teensy firmware can be updated ‘Over The Air’ (OTA) via the wifi connection to the Pi5. I believe the next step should be to add wifi OTA to the ‘clearest_direction_node.py’ script in order to remove the requirement for physically attaching a USB cable to the Teensy 4.1 to update the firmware.

08 August 2026 Update:

Adding Wifi OTA to the current ‘clearest_direction_node.py’ configuration turned out to be relatively easy, as this ability had already been developed as a stand-alone demo back in June 2026. All we had to do was update the ‘board.txt’ file to point to the new location of ‘PostBuild_OTA.py’ on my PC, and make sure ‘Wifi_OTA.py’ was running on the Pi5 so it would look for changes in “/home/pi/my_vision_robot/firmware/latest.hex” and trigger the update.

09 August 2026 Update:

Thinking while drifting off to sleep last night, I realized that the addition of the Pi5 to the robot means that all the navigation and obstacle avoidance tasks (including possibly navigating to and connecting with the charger module) will be handled by the Pi5, which significantly simplifies the Teensy 4.1 code. All the Teensy code has to do now is respond to motion commands from the Pi5, monitor the various hardware sensors and update the rear-facing LED array.

Teensy Responsibilities:

  • Run the motors in response to motion commands from Pi5 on Serial1
  • Update the ‘state-of-charge’ (and left/right steering) LEDs
  • Monitor the output from three different 1NA169 current sensors (I_chg, I_tot, I_upper-deck)
  • Monitor the output from two different Vbatt voltage sensors (V_batt, V_upper-deck)
  • Monitor the ‘charger connected’ output from the TPS5100 battery pack
  • Monitor the rear-facing VL53L1X LIDAR for rear collision avoidance
  • Run the speaker
  • Home in on and connect to the charger module (may be done by the Pi5 instead)

Pi5 Responsibilities:

  • Manage all navigation and obstacle avoidance tasks
  • Possibly manage charger module homing (April tag?)
  • Create map (SLAM)?
  • Respond to rear-facing obstacle alerts from Teensy
  • Pass robot telemetry data on Serial1 to PC
  • Pass Pi5-software-related telemetry data to VS Code terminal

10 August 2026 Update:

Good progress on the vision-enhanced robot project today. Yesterday we installed two additional cases in the switch block that accepts manual control commands for the robot, to allow the user to command left/right turns of an arbitrary number of degrees at an arbitrary turn rate. The command format consists of the letter ‘L’ (left/CCW) or ‘R’ (Right/CW) followed by the number of degrees to turn (and optionally a specified turn rate in deg/sec), but the commands failed. Today (while waiting in the cellphone lot for my wife) I figured out what was wrong with the teensy command parsing code. Now I can type “L30.5” at a VS Code prompt that gets transmitted via SSH over Wifi to the Pi5, then via the dedicated serial to the Teensy. Then the Teensy calls ‘SpinTurn(30.5, rate = 30) to actually effect the turn. Here’s a short video showing a left (CCW) turn of approximately 90 deg at a 90 deg/sec rate, followed by another left turn of 90 deg at the default 30 deg/sec rate, followed by a right turn of 180 deg at the default 30 deg/sec rate:

We also implemented a replacement for my old telemetry display using the Visual Studio serial port monitor. In theory I could maintain that feature as I still have the HC-05 Bluetooth serial module installed on the robot, but I would rather put everything over wifi for better range & reliability. What we did instead was to have WallE_5.py log everything that comes to it on its serial port (Teeny ‘Serial1’) to a ‘telemetry.log’ file, which allows me to start up a new Pi5 terminal session in its own window and run

to display whatever telemetry information the teensy is sending to ‘Serial1’. Here’s a short sampling of the telemetry data setup:

15 August 2026 Update:

I discovered that the Teensy 4.1 was unresponsive – yuk! After some research and troubleshooting, I realized that I had fallen into a classsic Teensy 3.5->4.1 transition trap; Teensy 3.5 is 5V tolerant on (almost) all pins, while the 4.5 is not. I didn’t really look hard at the circuit before making the 3.5->4.1 change, but almost all the peripheral hardware produces 5V signals on the MCU pins – oops!

So, I have spent the last few days going backwards – from Teensy 4.1 to Teensy 3.5. I took the opportunity to improve wire/pin labelling while doing the reverse transition. Here is the updated schematic:

And here are some photos showing the wire labelling:

I created a small test program, originally to just test the rear-facing VL53L1X LIDAR, but later expanded to test all sensors. Here’s the code:

And here’s the output showing all three current sensors, the battery voltage, and the rear-facing VL53L1X LIDAR output (variations in the rear distanced are due to my waving my hand in front of the sensor).

I wasn’t quite sure what to make of the zero readings for Bot_I, but then I realized that when the USB cable is plugged into the Teensy 3.5, it provides all the current needed for the first deck peripherals, meaning the current through the Bot_I INA169 sensor is essentially zero.

Next I ported the MPU-6050 support code from the VisionEnhanced4WheelRobot project into my little demo program and put some code in ‘loop()’ to add the IMU heading output to the sensor line. This didn’t work at first, but with Grok’s help I traced the problem to a disconnected power/ground lead from the main power distribution bus to the MPU6050. Once this was connected, the demo program started working right away:

I also installed and tested a front-facing red laser diode and exercised the on-board speaker. At this point I believe I have exercised/tested all the sensors, the laser diode and the speaker. I haven’t run the motors with this program as I believe that will happen when I get back to the ‘mainline’ VisionEnhanced4WheelRobot.ino program.

16 August 2026 Update:

I back-ported the code from my VL53L1X_Demo program back to my VisionEnhanced4WheelRobot program and after the normal number of mistakes, got it going. Here’s a small bit of output from loop(), with me rotating the robot back and forth to show variation in the ‘Hdg’ and ‘RearCm’ values:

Then I fired up the VS Code connection to the pi5, started WallE_5.py supervisor program and verified that I could send motor commands in the WallE_5.py window and have the robot respond appropriately – yay. I also verified that ‘tail -f ./logs/telemetry.log’ in a separate VS Code terminal window produced the same telemetry output as above.

17 August 2026 Update:

I finally have the ‘VisionEnhanced4WheelRobot’ program running again with a Teensy 3.5. The last little bit was undoing the change in motor control pin assignments for the right-hand motor driver. Going from Teenys 3.5 to 4.1 I had to change the pin assignments to place the ‘speed’ pin on a PWM-able output pin, and going back I didn’t initially undo this pin assignment – all fixed now.

At this point the robot firmware is pretty much complete – it correctly monitors all three current sensors, the battery voltage, the current heading, and the rear distance reading. I think the next step is to work on the python side to add more navigation and obstacle-avoidance ‘smarts’.

Stay tuned!

Frank

Generating Pull Request for Vin’s MissChanger Klipper-Toolchanger Repo

Posted 29 July 2026

In a prior post, Grok help me figure out why I was having so much trouble trying to change my Voron 2.4 printer from ‘dock’ to ‘no_dock’ configuration. Solving this problem exposed a pretty significant flaw in the way that config_switch.py managed the process of changing the printer.cfg file to reflect the new configuration. After getting everything to work, I suggested we generate a pull request to Vin’s Klipper-toolchanger repo to make the config swap process a bit more dependable. This post is intended to document this effort.

We started out by making sure we had all the preparatory work done.

  • I copied yet another set of config files to my PC
  • 1. Update my clone of Vin-y’s klipper-toolchanger repo on my printer, so all I had to do was update it with: cd ~/klipper-toolchanger, git pull. Now my local repo is the same as Vin-y’s main branch

    cd ~/klipper-toolchanger git status # just to see where you are git pull origin main
  • Created a new branch so we can make our changes without touching the main branch.Just type this one command and show me the result:bash

    git checkout -b fix-config-switch-in-place
  • In VS Code on my PC, I navigated to /home/pi/klipper-toolchanger/klipper/extras/config_switch.py and replaced its contents with the file generated by Grok.

Then we restarted the printer. Klipper came up cleanly, so that’s a good sign!

After testing the new script with some round-trip ‘TOGGLE_CONFIG_MODE‘ commands, the new script looks like it is performing correctly.

Grok then guided me through the process of updating the local repo:

Create a new branch to make the changes without changing the ‘main’ branch:

Then in VS Code we overwrote the existing klipper-toolchanger / klipper / extras / config_switch.py with the new version (see above), saved the file and then restarted Klipper with “sudo systemctl restart klipper”

Testing:

At the start of the test program, ‘printer.cfg’ contains the ‘no_dock’ configuration. Then I ran SAVE_CONFIG_MODE fro the mainsail console, and got the following output:

Most notably, now the ‘config_no_dock.cfg’ file has both the ‘#;<‘ and ‘#;>’ markers – yay!

To go the other way, we edited the ‘config_wt_dock.cfg’ file to add the closing marker ‘#;>’ to the end of the file, and then ran TOGGLE_CONFIG_MODE again to swap out the ‘no_dock’ “Session Variables” with teh ‘with_dock’ ones and then checked to make sure the Voron would reboot successfully (it did – yay!) and the “session variables” and ‘SAVE_CONFIG’ sections were correct.

Pull Request:

First we committed all the changes (principally the revised ‘config_switch.py’ script) to the local repo:

Then before we do anything else, we need to fork Vin-y’s klipper-toolchanger repo to my Github account with

  • Navigate to Vin-y’s Github klipper-toolchanger repo with: https://github.com/VIN-y/klipper-toolchanger
  • Create a fork
  • Push the local repo’s ‘fix-config-switch-in-place’ branch to the newly created fork with:
    • git remote add myfork https://github.com/paynterf/klipper-toolchanger.git
    • git push -u myfork fix-config-switch-in-place

When the push is performed, Github creates a link that can be used for the pull request:

Here’s what the pull request looks like on Github, just before clicking the ‘Create Pull Request button:

And here’s what it looks like after creating the pull request:

It feels good to be able to contribute something of worth to the MISSChanger community, as I am certain that others have run into similar problems with TOGGLE_CONFIG_MODE.

Stay Tuned,

Frank

New Current Sense & Step-Down Regulator Board

In my old 4-wheel robot setup, I had a 5V regulator built around an LF50CV low-voltage dropout 3-pin regulator. Unfortunately, with the added current drain of the Pi5 and OAKD-Lite Camera, the LF50CV started dropping the output voltage to the point where the Pi5 started to get flaky. In discussing this with Grok, he suggested The Pololu D24V50F5 step-down regulator shown below:

I did some initial testing on the module:

  • At 9.1V at the ‘Switched Battery input, the Vbatt monitor voltage was 3.3V – the upper limit for inputs to a Teensy 4.1. Since 9.1 is well above even the high charging limit (~8.4V), this seems pretty safe.
  • At a measured Irun = 0.2A, Irun_out measured 90mV
  • At a measured Irun = 1.5A, Irun_out measured 0.4V
  • at a measured run = 1.14A, Irun_out measured 0.255V

Then attached a USB Type C male pigtail to the regulator output and then plugged it directly into the Raspberry Pi5. The Pi5 booted right up and I was able to access it from my PC using VS Code. Regulator output voltage with Pi5 connected was 4.99V at a measured input current of about 0.55A.

Here’s a photo showing the current sense/regulator module already hot-glued to its 3D-printed mounting plate.

30 July 2026 Update:

Yesterday the plan was for the existing LF50CV-based LDO 5V voltage regulator to be replaced with the above D24V50F5 DC-DC step-down regulator. However, as I was waiting for sleep last night, I was thinking about the increased 5V current level required by the Raspberry Pi5 and the OAKD-Lite camera and the fact that in the current (no pun intended) design, that 5V power comes from a module on the lower deck. So even with the higher current capacity (nominally 5A max) provided by the D24V50F5 regulator, there is still going to be a significant voltage drop in the approximately 2 meters of 24-guage stranded hookup wire and the TE Connectivity ‘MATE-N-LOK inter-deck connector. As Grok reminded me, there is not only the 1m line TO the Pi5/Camera, there is also the ground wire coming BACK for a total of approx 2m and two times through the connector. Grok noted that the total round-trip IR drop at 3A would be about 0.5V, which would place the input voltage at the Pi5 at about 4.5V, way too low for reliable operation.

That made me realize that even if I replaced the LF50CV-based LDO 5V voltage regulator with the D24V50F5 5A module, it *still* wouldn’t provide a clean 5V to the Pi5. It was at that point that the way to skin this cat was to leave the LF50CV-based LDO 5V voltage regulator in place on the bottom deck and move the D24V50F5 5A module to the top deck where the wire length to the Pi5 would be more like 0.1m instead of 2m – problem solved!

Well, not entirely, as I still have to get +Vbatt (nominally 8V) up to (and back from) the second deck, with the same 2m + 2x through the connector as before. But now that same 0.5V IR drop is applied to Vbatt instead of +5V, and that makes the problem go away entirely – yay!

Looking at a recent system schematic:

I see that +5V from the LF50CV goes through the interdeck connector on pin 1 (red), and the return path is on pin 2 (black). I believe all I would have to do is move the red wire from the output to the input of the LF50CV module. No, not that simple – the LF50CV output goes directly to the Teensy main controller 5V buss, and a separate wire goes from that 5V buss up through the interdeck connector to a terminal strip. That wire will have to be disconnected from the Teensy 5V buss and re-connected to Vbatt at the input to the LF50CV module. At the other end, the wire will have to be disconnected from the terminal strip and routed instead to the ‘Batt’ terminal of the D24V50F0 module. The output (both +5 and GND) from the D24V50F0 module must be routed back to the terminal strip. At this point, the two 5V regulator modules will be tied to the same (GND) reference, but supply entirely different circuits. Here’s a photo of the D24V50F0 module installed on the upper deck.

With this setup I was able to run the Pi5 for several hours before the +5V supply dropped to low to continue.

I need at least four additional lines from the Teensy 4.1 to the 2nd deck. Two lines for Serial1-Pi5 comms and two for Vbatt/Irun sensors on the 2nd deck 5V regulator board. The existing Brn/Wht wire pair has already been designated on the schematic for Serial1-Pi5 comms, and the existing but unassigned Blu/Gry pair can be used for the sensor lines. Note that the robot now sports *three* 1NA169 current sensor modules (the third one is in the base with the battery pack), and two of those also provide (Vbatt – 6V) voltage outputs. The pre-existing gray wire on the second deck was used to reset the Teensy 3.5 used to control the VL531LX LIDAR sensors but since the Teensy 3.5 (and all but one of the VL53L1X sensors) was removed, the Gry wire is no longer used. Here’s the updated schematic:

Building an Improved Under-monitor Accessories Tray

Posted 25 July 2026

For quite a while I have used the accessories tray shown below, but I have become increasingly unhappy with the quality with it; in particular the small tray sections aren’t quite big enough to handle all my USB sticks, micro-SD cards and holders, spring-clips, etc. So, after trying in vain to find a better model on-line, I decided I would design and 3D print one for myself, using my 300×300 Voron 3D printer in the ‘no_dock’ configuration.

Here’s where I am at the moment:

preliminary design for under-monitor accessory tray. Note that this is only 1/2 of the finished product

I started out with the idea of using removable partitions to fix the problem of having too-small or too-large bins for whatever I wanted to store. The available free distance under the riser is about 270mm so I made the width (the ‘Y’ axis above) slightly wider than original at 260mm. The above model is about 237mm long (the ‘X’ direction above), but is only 1/2 length, as the full length won’t fit on the Voron’s 300x300mm print bed, so I’ll have to figure out some way of connecting the two halves.

26 July 2026 Update:

The idea I came up with to connect the two halves of the accessory tray was to place holes in the ‘front’ half of the tray, and matching posts in the ‘back’ half of the tray, as shown in the screenshot below:

Now that I have my ‘no_dock’ printer configuration working properly, I printed up the small section of the back half of the tray, along with just a small section of the mating end of the front half of the tray, just to make sure the mating idea would work. It seemed to work pretty well, as shown in the following photos:

The posts on the back half came out a little scruffy due to small diameter and their length, but still worked well after a bit of cleanup. In the final version I think I will increase the diameter a bit and reduce the length. The gap shown in the mated photo above I believe was due to the way I printed the part, and shouldn’t be a factor in the finished product – we’ll see!

The next step was to create the rear section sketch. First I tried do this by simply copy/pasting the entire ‘2-bin_Tray’ section, but the result was ‘too many’ broken references, as shown below:

‘Too many’ broken references

But after some consultation with Grok about using the ‘use’ feature, I simply created a new sketch on the same plane as the original ‘2-bin Tray’ sketch, then activated the ‘Use’ feature and dragged a rectangle to select the entire original sketch. This produced a new, unlinked sketch which I moved to a non-interfering location with the transform tool, as shown below:

A better ‘copy/paste’ using the ‘Use’ tool, selecting everything, and then using the ‘Transform’ tool to move it

The rear section of the tray will only be 120mm long instead of 240, as the total length of the tray is 360mm. Here are some photos of the constituent parts:

Removable partitions in three lengths

09 August 2026 Update:

After the ‘Gloop’ arrived I was able to glue the front & back sections together with a liberal application of ‘gloop’ to both sides of the junction and to the top and bottom of the tray once the sections were joined. Then transferred all my junk from my old tray to the new one and installed it under my monitor riser, as shown in the following photos:

Moving Vision Processing to My 4-Wheel Robot, Part 1

Posted 08 July 2026

In this previous post, I describes my work with Grok Code to successfully demonstrate the use of vision processing with a Luxonis OAKD-Lite camera and a Raspberry Pi5 to generate ‘best clear direction’ advisories for robot motion control.

After achieving the above milestone, I started thinking about the next steps. Clearly I want to move on to achieve actual robot navigation utilizing the above ‘best direction’ information, but the current 2-wheel robot battery pack doesn’t really provide enough power for the Pi5, the OAKD-Lite camera, and the wheel motors. Consequently, I started thinking about moving the vision processing project from the 2-wheel robot onto my existing 4-wheel platform to take advantage of the latter’s larger battery pack. Looking at the pinouts for the Teensy 3.6 and Teensy 4.1 along with the 2-wheel and 4-wheel schematics, I developed the following pin assignment spreadsheet:

Pin assignments for the 2-wheel to 4-wheel transfer

In the above (hopefully self-explanatory) spreadsheet there was only one significant conflict. On the current 2-wheel robot pins 29-32 are occupied by the four Hall-effect wheel encoders, and on the current 4-wheel robot these pins are used by four of the six battery charge indicator LED’s, and that function carries over into the new vision-enhanced robot. Easy enough resolution, just move the wheel encoder pins to 7-10 (actually even easier, I don’t need to move the encoders over until I actually have software/firmware that needs them, and that might be a while).

I started out thinking I would 3D print another ‘2nd deck’ plate so I wouldn’t have to disassemble the original one. Then I came to my senses and realized that I had originally constructed the 2nd deck expressly so it *could* be disassembled – duh! Here’s the mostly disassembled 2nd deck plate:

And the bottom contains all the motor hardware and drivers, the battery and charging circuitry. The ‘deck’ of the bottom deck already has a 5V regulator module (more on that below), the MPU5060 MPU and the charger unit homing module. Why re-invent when it is already there.

15 July 2026 Update:

I launched DipTrace, opened the schematic file for my current 4 wheel robot, then saved a copy as ‘Vision-Enhanced Robot Schematic’ and then edited it to reflect the following changes:

  • removed the Wixel OTA module; OTA is now handled through the Pi5 wifi link.
  • removed all but the rear-facing element of the 7-element VL53L1X LIDAR array and the Teensy 3.5 that managed it.
  • added the Raspberry Pi5 and the OAKD-Lite camera to the second deck, utilizing pins freed up by the removal of the Teensy 3.5 LIDAR array manager
  • Replaced the Teensy 3.6 main system controller with a Teensy 4.1 for additional processing power.

I also replaced the approximately 45cm long USB cable that came with the camera with a 15cm one as the extra length was just adding mass (and mess) to the installation. When the new USB cable arrived, I hooked it and the Pi5 stock power cube up to the Pi5 and used the previously developed Python script and associated shell scripts to confirm that the cable worked.

20 July 2026 Update:

In the process of moving the Pi5 and OAKD-Lite camera to the 4-wheel robot, I managed somehow to lose the Pi5’s SD card. I tried my best to find it – including dumpster-diving with the hope that I could find in my last trash bag – but no luck. Attempting to make lemonade out of lemons I decided to try and document the process of building up a new SD card from scratch.

RaspberryPi Imager:

20 July 2026 Update:

In the process of moving the Pi5 and OAKD-Lite camera to the 4-wheel robot, I managed somehow to lose the Pi5’s SD card. I tried my best to find it – including dumpster-diving with the hope that I could find in my last trash bag – but no luck. Attempting to make lemonade out of lemons I decided to try and document the process of building up a new SD card from scratch.

RaspberryPi Imager:

Choose Ubuntu Server 24.04 LTS (64-bit) (Server version is recommended — Desktop images sometimes cause issues with the customization wizard). I actually had no problem with the ‘desktop’ version, but I think it included a lot more ‘crapware’ than the ‘server’ version. Also, when the ‘server’ version is chosen, the imager includes the ‘Customization’ page for wifi setup, username/password, etc.

  • Hostname: RobotPi5.
  • Capital City: Washington D.C
  • Time Zone: America/New York
  • Username: Pi
  • Wifi: Choose ‘Secure Network, fil in SSID & password.
  • SSH: Choose ‘Enable SSH’ and ‘Use Password authentication.
  • Password: xxxx (note that on subsequent passes of the imager, it will offer to use a saved password)
  • Write: The image below shows the situation just before writing the image to the SD card

Write to the SD card (takes a few minutes).

First Boot (Monitor + Keyboard):

Insert the SD card into the Pi 5 and power it on.Complete the initial Ubuntu setup prompts (this can take a few minutes).Log in with username pi and the password you set. I had to reboot the Pi a couple of times to get it to go all the way through the startup sequence to present the login screen.

Connect from Your PC via SSH:

To confirm that the Pi can see the wifi network, run ‘ssh pi@RobotPi5’ from a Windows Command Window and enter your password. This should connect right away. If it doesn’t, then check the Pi’s IP address (DHCP can assign it a different one) with the ‘ip addr’ command on the Pi. If the address was changed (like from 192.168.1.200 to 192.168.1.201), you can change it back by editing your local router to give the Pi5 a static IP address reservation as shown below, and then rebooting the Pi. When the Pi comes back up it will get the ‘reserved’ address from the router, and life will be good again, except…

When you try to connect from your PC using ssh, you will probably get the following error message:

This occurs because the new Ubuntu installation generated a new SSH key, and the on one in your PC’s ‘host’ file no longer matches. To fix this, you must first remove the old key, with the following in a command window on your PC:

Then try to connect to the Pi from the PC with ‘ssh RobotPi5’. You should now see this:

Enter ‘yes’ (can’t enter just ‘y’) to accept the new key. Then you should be able to connect to the Pi with your username and password, and you should see this:

Connect using VS Code:

Now you should also be able to connect to the PI from VS Code with Cmd – Shift – P -> Remote SSH: Connect to host ->’RobotPi5′. This should result in the following screenshot:

Ignore the misleading warning in the blue field above and enter the password for the Pi5. This should log you in, but it may still take a while for VS Code to connect the first time (you will see ‘opening RobotPi5’ with the spinner in the bottom left-hand corner, and then this will change to ‘SSH: RobotPi5’ as shown below:

or this:

At this point you have a fully functional Ubuntu ‘server’ installation on the Pi, but none of the software packages (ROS2 Jazzy) needed to actually use the OAKD-Lite camera, and none of the already-developed user software. The user software can be retrieved from your GitHub repo (you DID create a GitHub repo and save your software, right?).

Install ROS 2 Jazzy (Jazzy is a version nickname):

From a VS Code Terminal Window, run these commands in order:

sudo apt update && sudo apt upgrade -y
sudo apt install software-properties-common curl -y
sudo add-apt-repository universe -y
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update
sudo apt install ros-jazzy-desktop -y

You will probably need Grok’s help with getting through the entire package installs. We tried the Ubuntu 24.04LTS ‘server’ edition because it has less bloatware, but ros2-Jazzy would not install. Finally went back to Ubuntu 24.04LTS ‘desktop’ edition, and this worked – yay!!

After flashing the SD card with Ubuntu 24.04LTS ‘desktop’ edition, I booted it up on the Pi5 and went through the initial setup process. The ‘desktop’ edition skips all the customization stuff in the SD card load because it can be done by the user in the desktop.

The first hurdle to overcome was the inability to connect to the Pi with SSH, even though I ‘enabled’ SSH in the desktop settings.

the first two commands above succeeded, but the stataus was still ‘unable’. However after some tangential stumbling around with (almost) trying to kill some interfering processes, it turned out that just waiting a minute or two did the trick and SSH started working – Yay!

At this point we started the process of getting ros2 ‘Jazzy’ installed, as follows:

So at this point ros2-Jazzy is installed and active, and my working software has been restored from Github – WHEW!

Tomorrow we will continue through to getting the ‘clearest_direction_node.py’ program running (yet again)

While I can’t really say that losing that micro-SD card was much fun, it *was* educational, and now I think I have a better understanding of how the startup process works, and much better documentation.

22 July 2026 Update:

I renamed the Grok session to “260722 Pi5 Boot ROS and OAKD-Lite Initialization” to be more recognizable in the future.

OK, back to the effort to recover from my disastrous loss of my original micro-SD card. When we left it last night, we had gotten to the point of successfully flashing the ‘desktop’ version of Ubuntu 24.04, gotten ros2-Jazzy installed, cloned the ‘my_vision_robot’ GitHub repo and switched to the ‘vision-to-motion-demo’ branch.