Skip to content

polyhobbyist/mangopi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ROS2 for MangoPi

visitors

This repository contains documentation for installing ROS2 on a Mango Pi running Ubuntu 22.04. As of February 2022, ROS2 is not distributed as an apt package or docker container for RISC-v, so must either be cross compiled or built natively. This repository contains a base image of ROS2 build using docker buildx, which has been published to a public container repo. Feel free to use this as a base image for your own docker containers.

Mango Pi Setup

NOTE: Visual Studio Code Remoting is not supported on RISC-V as of February 22 2022; might be better to develop on a different system and deploy to the Mango Pi.

SBC Setup

  1. Flash a Ubuntu 22.04 image to an SD Card using Balena Etcher

  2. Boot the Mango Pi with a Mini-HDMI Cable and USB-C Hub with keyboard.

  3. Install some software:

    sudo apt install git
    sudo apt install docker.io
    sudo apt install docker-compose
  4. After setup, setup Wifi:

    mkdir ~/ext
    cd ~/ext
    git clone https://github.com/lwfinger/rtl8723ds
    cd rtl8723ds
    make
    sudo make install
    sudo modprobe -v 8723ds 
  5. Configure your Wifi

    ls /sys/class/net
    sudo nano /etc/netplan/50-cloud-init.yaml
    network:
      ...
      wifis:
        <from the class/net>:
          optional: true
          access-points:
              "your ssid":
                  password: "wifi password"
          dhcp4: true
  6. Configure docker to not require sudo (optional)

    sudo gpasswd -a $USER docker

ROS2 Docker Image

Using Docker Directly

This method allows you to use the demo applications to validate your install; however deriving your own container from the released version is recommended.

docker run --network host -i -t polyhobbyist/ros:humble /bin/bash

Using as the root for your own container

Create a dockerfile for your image (example below):

FROM polyhobbyist/ros:humble

RUN apt-get update && \
  apt install \
  libopencv-dev \
  python3-opencv \
  python-is-python3 \
  libboost-all-dev \
  openssl \
  git \
  gdb \
  i2c-tools \
  libcurl4-openssl-dev \
  libssl-dev \
  curl \
  libi2c-dev


ENTRYPOINT ["./ros_entrypoint.sh"]
CMD [ "bash" ]

I recommend using a Docker-Compose file, so that you don't have to remember the docker command line to launch your containers.

version: '3.4'
services:
  mangopi:
    image: mangopiws
    network_mode: "host"
    privileged: true
    cap_add:
      - SYS_PTRACE
    security_opt:
      - seccomp:unconfined   
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    devices:
      - /dev:/dev
    build:
      context: .
      dockerfile: ./Dockerfile
    command: /bin/sh -c "while sleep 1000; do :; done"

you can then use the command line:

docker-compose up 

then

docker exec -ti <ros container> /bin/bash

Resources

About

Files for the Mango Pi

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published