Skip to content

werder11/hackathon_prep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Introduction

This document aims to provide an insight into the installation and usage of various tools and technologies for creating a simulation environment for autonomous systems and IoT projects. It covers the setup and integration of tools like Windows Subsystem for Linux (WSL), Nvidia Docker, ROS, Kuksa, Autoware, and Ankaios, allowing users to:

  • Simulate and control autonomous vehicles using containerized environments.
  • Process and communicate vehicle signal data through standards like VSS with Kuksa.
  • Manage fleets using Ankaios and OCI-compatible tools.

Installing WSL

In order to run a container based simulation environment there is a need to access to Nvidia GPU and setup Nvidia docker run time. It is easier to setup a WSL for Nvidia GPU configuration as it by default has direct access to sources of the host (compared to VM setup).

To install WSL the following tutorial can be followed: Installing WSL on Windows 10

Sample ROS Autonomous Driving Project in Docker

After setting up Nvidia Docker run-time,

A sample autonomous driving project can be initialized with:

docker pull noshluk2/ros2-self-driving-car-ai-using-opencv:latest

docker run -it \
    --name=ros2_sdc_container \
    --env="DISPLAY=$DISPLAY" \
    --env="QT_X11_NO_MITSHM=1" \
    --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
    --env="XAUTHORITY=$XAUTH" \
    --volume="$XAUTH:$XAUTH" \
    --net=host \
    --privileged \
    noshluk2/ros2-self-driving-car-ai-using-opencv \
    bash

# Bridging the environment with Prius Car
ros2 launch self_driving_car_pkg world_gazebo.launch.py

# In another terminal run:
 docker exec -it ros2_sdc_container bash

cd ~/ROS2-Self-Driving-Car-AI-using-OpenCV/
ros2 run self_driving_car_pkg computer_vision_node # Self driving mode

Watch the video

Kuksa

Eclipse Kuksa Quick Start

Important Note: Based on the documentation the original port to publish Kuksa.Val serveris 55555, however it doesn't work, using port 55556 is an alternative.

Sample Kuksa Project:

 docker run -it --rm  --publish 55556:55556 ghcr.io/eclipse/kuksa.val/databroker:master  --port 55556 --insecure
# To install Kuksa Python library:
pip install kuksa_client

A Sample Python Project Creating and Subscribing to a Kafka Topic

#!/usr/bin/env python3

# sample_kuksa.py
# The following project is executed using version 0.4.3

from kuksa_client.grpc import VSSClient
from kuksa_client.grpc import Datapoint

import time

with VSSClient('127.0.0.1', 55556) as client: # Attach to local host port 55556 to listen kuksa.val server
    for speed in range(0, 100):
        client.set_current_values({
            'Vehicle.Speed': Datapoint(speed),
        })
        print(f"Feeding Vehicle.Speed to {speed}")

        # Read back the value to confirm it was set correctly
        response = client.get_current_values(['Vehicle.Speed'])
        if 'Vehicle.Speed' in response:
            read_back_speed = response['Vehicle.Speed'].value
            print(f"Read back Vehicle.Speed: {read_back_speed}")
        else:
            print("Failed to read back Vehicle.Speed")

        time.sleep(1)
print("Finished.")
usr@usr:~$ chmod +x ./sample_kuksa.py
usr@usr:~$ python3 ./sample_kuksa.py

# Expected output:
Feeding Vehicle.Speed to 0
Read back Vehicle.Speed: 0.0
Feeding Vehicle.Speed to 1
Read back Vehicle.Speed: 1.0
Feeding Vehicle.Speed to 2
Read back Vehicle.Speed: 2.0
Feeding Vehicle.Speed to 3
Read back Vehicle.Speed: 3.0
...

Vehicle Signal Specification (VSS) Datatypes:

Kuksa supports VSS data type specification. For detailed documentation on VSS data types and definitions please refer to:

Autoware

Autoware Documentation:

  • Installation Process
# Clone autowarefoundation/autoware and move to the directory.

git clone https://github.com/autowarefoundation/autoware.git
cd autoware
# The setup script will install all required dependencies with Ansible:

./setup-dev-env.sh -y docker
# To install without NVIDIA GPU support:

./setup-dev-env.sh -y --no-nvidia docker

In case you get such error "NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver." Please follow the video:

Ankaios:

Important Note: Ankaios uses OCI image format. Hence it leverages Podman as container manager.

Install Podman:

To install Podman on Ubunutu the following tutorial can be followed:

sudo sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key -O- | sudo apt-key add -
sudo apt-get update -qq
sudo apt-get -qq --yes install podman

Create OCI Image from Docker Instance (via Docker2OCI tool)

It is possible to convert an existing Docker format image to OCI image format. Following tutorial shows the steps on how to convert a Docker image format into OCI image format which Ankaios supports.

  • Docker2OCI
    • Supports Docker2OCI conversion
    • Supports validation of an Image based on OCI formatting

A sample Ankaios Project

# state.yaml
apiVersion: v0.1
kind: Config
workloads:
  nginx:
    runtime: podman
    agent: agent_A
    restart: true
    updateStrategy: AT_MOST_ONCE
    accessRights: #
      allow: []
      deny: []
    tags:
      - key: owner
        value: Ankaios team
    runtimeConfig: |
      image: docker.io/nginx:latest
      ports:
      - containerPort: 80
        hostPort: 8081
ank-server -k  --startup-config state.yaml # Start ankaios server with  provided configuration
ank -k apply state.yaml # Apply the workload

ank -k  get workload # Get all workload states
ank -k get state # Get detailed state about all workload states

Autowrx Gitlab Repository

ThreadX

Uprotocol

Influxdb Connection

Kubernetes InfluxDB Setup

TODOS

  • For IOT tracability demonstrate ROS/Autoware topic subscription and data visualization through Influxdb / Grafana

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published