/starfive2

Files for the StarFive v2

Primary LanguageDockerfileMIT LicenseMIT

ROS2 for VisionFive 2

This repository contains documentation for installing ROS2 on a StarFive VisionFive v2 board running Ubuntu 23.04. As of September 2023, ROS2 is (still) 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.

VisionFive 2 Setup

SBC Setup

  1. Update SPL and U-Boot described in 3.8.1. Updating SPL and U-Boot of Flash
  2. Flash a Ubuntu 23.04 image to an SD Card e.g. using Balena Etcher
  3. Boot the VisionFive in SPI flash mode (DIP switches RGPIO_0 = 0, RGPIO_1 = 0)
  4. Install some software:
    sudo apt install git
    sudo apt install docker.io
    sudo apt install docker-compose
  5. 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 slci/ros:iron /bin/bash

Using as the root for your own container

Create a dockerfile for your image (example below):

FROM slci/ros:iron

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