ROS in arm/v7, Docker, and Limited Storage Robot
Hello all,
I have searched online for solutions to my problems but am still seeking a suitable answer. I am running ROS Humble on our company's custom robot with Yocto Kirkstone build. Our robot architecture is arm/v7. Since the robot has limited storage, I can not use the official ROS image, which wights 3GB. I thought of using Docker to install ROS in a container for many benefits. I plan to do three images as a solution:
- An image to build the ROS with build tools and Colcon as the compilation container.
- An image of slim ROS installation to load in the robot as the runner container.
- A container to run the following:
- Take the compilation container.
- Clone my robot code from my repositories.
- Build the code with Colcon.
- Take the runner container.
- Copy the binaries from the compilation container to the runner container.
- Save the new container in Artifactory Storage.
However, I am facing two issues:
- There is yet to be an official container (any of the three) available for this platform (arm/v7).
- I cannot find a guide for installing ROS with minimal dependencies to run the code without compilation (The runner container).
If someone could help me get through this, it would be great. If someone could say that my plan is legit, it would be great too. Thank you all.
Asked by Yuval Aharoni on 2023-04-03 03:38:16 UTC
Answers
Here is an example that builds all of ROS2 from source, but only packages that a colcon overlay workspace would require. You could then copy over the install
folders from the colcon workspace into a new stage that only has the runtime dependencies for your application installed on the system:
- https://github.com/ros-planning/navigation2/blob/ae887b1eb91bbce5de8f4c8787946acc9af2e384/tools/source.Dockerfile#L1
- https://github.com/ruffsl/docs-1/pull/1
- https://github.com/ros-infrastructure/rosdep/pull/789#issuecomment-868858650
As for bootstrapping a builder stage for the target platform architecture, that may take a bit more legwork.
Asked by ruffsl on 2023-04-07 10:35:08 UTC
Comments
quick comment:
ros:humble
on my machine is around 750MB.Not the smallest image by far, but certainly not 3000MB.
there likely never will be, as anything but
arm64
is Tier 3 and build-from-source only (see thearm32
row in the table and see this for a discussion about the tiers).Asked by gvdhoorn on 2023-04-04 01:09:58 UTC
As @gvdhoorn mentioned, you can build from source. A nice thing about building from source is that you can choose the external libraries you want. A good choice is to eliminate all the graphics capabilities and to log in to your robot via ssh. Also, you might want to take a look at purging the
apt cache
in order to save some disk space. Hope this helps :)Asked by sampreets3 on 2023-04-04 02:56:43 UTC