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.

2 Likes

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.

2 Likes

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.

2 Likes

I’ve gotten pretty good at this :wink:

3 Likes

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:

2 Likes

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.

2 Likes

Wow - that’s amazing!

2 Likes

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.

2 Likes

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.

2 Likes

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

3 Likes

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

3 Likes

GoPiGo3 in the “ROS News”

(weekly gathering of ROS things on discourse.ros.org)
 


2 Likes

Wow - great shout out. Congrats.
/K

2 Likes

Jeez!

Just what we needed - more publicity!
(:wink:)

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

2 Likes

Wow! How did I miss that! Congratulations!

3 Likes

Thanks so much for sharing this. After the libcamera/v4l2 and raspi nightmare, I got this high FR streamer node working for the raspicam v2.1 in the Ubuntu 22.04 / ROS2 Humble environment: GitHub - christianrauch/camera_ros: ROS2 node for libcamera supported cameras (V4L2, Raspberry Pi Camera Modules)
E.g., ros2 run camera_ros camera_node --ros-args -p width:=640 -p height:=480

3 Likes

As is, or did you need changes?

2 Likes

That’s great - thanks for sharing.
/K

2 Likes

as is, as long as libcamera-hello is working (may require some adjustments in the /boot/firmware/config.txt file)

3 Likes