Success: ROS2 GoPiGo3 in 1 hour - ROS News

So you can have your GoPiGo3 up on ROS2 in 1 hour:

Step1:  Follow steps to create (headless) GoPiGo3 on Ubuntu 22.04 Server
Step2:  Run script to install ROS2, GoPiGo3 ROS nodes,  and helper scripts
Step3:  Follow Test Plan - 
             Drive ROS2 GoPiGo via remote control from your keyboard
             Inspect ROS2 topics
             Publish ROS2 "command" topics to ROS2 GoPiGo3

(only GoPiGo3 and remote ssh shell on your desktop/laptop computer required - no ROS GUI)

I don’t know how to package the completed image - any tips?

1 Like

You can look into my multi-booting threads where I described how to package things.

I haven’t created a “universal” script but it should be doable.

The big issue is that when you do create the image, you have to preserve all the attributes, including extended attributes and ownership, as well as preserving both soft and hard links.

It’s not difficult, but it’s not trivial.

There are several major steps:

  1. Use something like ddrescue (gddrescue) to make a file that is an exact image of the system.2

  2. Use a “shrinking” utility to reduce the image to the minimum size, removing all the unused part of the partition. Some utilities can set the “expand on boot” option too.

  3. Open it using the system’s image mounter to verify that the image is valid.

  4. Run it through something like gzip to compress the image to a more manageable size.

  5. Thoroughly test the image by re-installing it to various media and run it to death. Insure that every test cycle begins with a full e2fsk on the unmounted image partitions before booting it for the first time.

  6. Once you get that down pat, there are additional steps, like clearing the apt cache, clearing browser cache, cookies and history, system temp, secrets, saved passwords, command cache, network configs, (except for IPv6), and other things you specifically set for yourself that is nobody else’s business. This will also shrink your final image size.

  7. Test your final image by installing it on various Raspberry Pi versions, running e2fsk over it, and beating the living :face_with_symbols_over_mouth: out of it. Don’t forget to e2fsk the images.

There are imaging tools out there for Raspberry Pi images, some claim to automagically clean things up. It will just require some searching.

Right now all the systems here are occupied by the granddaughters this week while they are on their “fall” school holiday. Once that’s done I can help with this.


I set up the image with:

  • password robots1234 for both the ubuntu and pi users,
  • no GUI, no browser to worry about
  • network:
    • I think I can clean out /etc/netplan/50-cloud-init.yaml before shutdown, then
    • mount the SDcard and clean out the /boot/network-config SSID and password
    • Next user should be able to add their SSID and WiFi pswd to the /boot/network-config
      to have the image connect (and re-write the /etc/netplan/50 file at first boot.

I found a Linux script tool PiShrink which purports to shrink the image - Hopefully it will work for a Raspberry Pi Ubuntu image.

If I can get this to work, it will cut the install time from 1 hr to 10 minutes.


Good show, old boy! Bloody good show!

In any event, you can verify if the image is valid by trying to mount it with archive mounter. You can install it from the repositories if you don’t have it.

Oh, blast. You don’t have a desktop so you will have to try to loop mount it.


I’ve gotten pretty good at this :wink:


Ok then, 'fess up!

We’ve all, (especially me!), have been interested in the details of your packaging and build process for a while now. . . . :wink:


Indeed you have. Hopefully all the “___ has been deprecated and will cease … “ takes as long to become real as the termination of Python 2 after it was first warned.

I saw so many warnings that I was astounded that my system even boots. I don’t have any automated tests to ensure my system even should be shrunk and unleashed.


Wow - that’s amazing!


It took a while, thinking about this … you reminded me of what I forgot about to prepare for imaging - remove the Dexter/gpg3_config.json file! My image, as is, would force 16 tick motors on an unsuspecting user.

The PiShrink log claims to have done all the removals that @jimrh mentioned giving me an image to test now.


Oh so close …

It booted, the GoPiGo3 power service turned the green LED solid, and it connected to my WiFi correctly, but I can’t ssh in.

So close, but so not.


Turns out this issue was filed an a fix is in a pull request. Looking up.


Now you know about the pain involved with creating, testing, packaging, and distributing an O/S package - there’s always “something else”!


GoPiGo3 in the “ROS News”

(weekly gathering of ROS things on


Wow - great shout out. Congrats.



Just what we needed - more publicity!

Totally agree, great plug for the best small robot on the planet! (At least IMHO. . . .)


Wow! How did I miss that! Congratulations!