Skip to content

steftri/ERNI_hackathon_2023

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ERNI_hackathon_2023

This is the main development repository for the 030 Berlin Spartans team for the oneERNI global hackathon 2023.

Development branch: develop

Link to main repository: oneERNIglobalhackaton

Our members are:

The base for the project is the PiCar-X by SunFounder with a Rapberry Pi 4.

Intended Use

A robot shall be able to drive thorugh a pre-defined parcours as fast as possible, while the operator is not physically present at the location of the parcours.

Requirements

Stakeholder Requirements

StR01 - Solving a parcours from remote

With the robot, it shall be possible to perform a drive through a parcours with the operator not beeing physically present at the location as quickly as possible.

System Requirements

SysR02 - Remote Control

The system shall be able to control the movement of the robot remotely.

SysR03 - Lane Assist

The system shall provide a lane assist.

SysR04 - Optimization

The system shall provide the posibility to parametrize the software to improve the performance.

Frontend Software Requirements

FR02 - Keyboard controls

The user should be able to control the robot with WASD (driving/steering) and EQ (turning the head). The keyboard controls should be responsive and not laggy.

FR03 - On-screen keyboard

The user should be able to control the robot with an on-screen keyboard/gamepad. The on-scren keyboard should give feedback to the user if it's being pressed.

FR04 - Video feed

The user should see the robot's video feed so they know where they are going.

FR05 - Line Assist support

The software shall provide the possibility to engage the lane assist on the robot.

FR06 - Configuration of parameters

The software shall provide the possibility to configure the P and I factor of the robot's PI controller.

FR07 - Configuration grayscale sensor

The software shall provide the possibility to configure the grayscale values interpreted as black and white.

Firmware SW Requirements

SW01 - Environment

The software shall run on a Raspberry Pi 4 with a Robot HAT board.

SW02 - Motion

The software shall be able to control the forward and backward motion.

SW03 - Steering

The software shall be able to control the direction of the robot's movement.

SW04 - Video

The software shall be able to provide a real-time video from the robot's camera.

SW05 - RemoteControl

The software shall be able to receive and process remote control commands.

SW06 - Lane Assist

The software shall be able to follow a given track.

SW07 - Minimum Turn radius

The software shall be able to follow a track with a radius of down to 30 cm.

SW08 - Gaps in the track

The software shall be able to be tolerant against gaps in the track marking of up to 25 cm.

SW09 - Configuration of parameters

The software shall provide the posibility to configure the PI controller.

SW10 - Configuration grayscale sensor

The software shall provide the possibility to configure the grayscale values interpreted as black and white.

SW11 - Calibration grayscale sensor

The software shall provide the possibility to calibrate the grayscale values.

Traceabilitiy and Test Coverage

Stakeholder Traceability

Stakeholder Requiremet Traces to
StR01 - Solving a parcours SysR02 - Remote Control
SysRS3 - Lane Assist
SysR04 - Optimization

System Traceability

System Requirements Traces to
SysR02 - Remote Control FR02 - Keyboard controls
FR03 - On-screen keyboard
FR04 - Video feed
SW01 - Environment
SW02 - Motion
SW03 - Steering
SW04 - Video
SW05 - RemoteControl
SysR03 - Lane Assist FR05 - Line Assist support
SW06 - Lane Assist
SW07 - Minimum Turn radius
SW08 - Gaps in the track
SysR04 - Optimization FR06 - Configuration of parameters
FR07 - Configuration grayscale sensor
SW09 - Configuration of parameters
SW10 - Configuration grayscale sensor
SW11 - Calibration grayscale sensor

Communication Interface

The frontend and the firmware communicate via MQTT messages. The body of the messages are JSON-formatted.

Topic "command"

The JSON message is formatted as follows:

{
    "operation" : "<operation>",
    "<parmeter>" : <value>
}

The following operations are available:

  • stop
  • set_speed(speed)
  • stop()
  • set_direction(angle)
  • set_head_rotate(angle)
  • set_head_tilt(angle)
  • say(text)
  • start_lane_asssist()
  • set_grayscale_config(black, white)
  • set_controller_config(p, i)

Software Architecture

The firmware is composed of different modules

  • The Lane Controller is responsible for calculating the position relatively to the track. Input data are the three grey values from the grey scale sensor. Output data is a value in float, while 0 means the car is exactly above the track, negative values means it is left of the track, positive values right.
  • the PiControlle is responsible for calculating a direction command as the result of the calculated position above the track.
  • the LinearCalib module is responsible for calibrate sensor values to a given output range.

Software Development

Tools used for Firmware development

Firmware SOUP

  • Raspberry Pi OS Lite (32-bit) with git, python3-pip, python3-setuptools and python3-smbus
  • Robot-Hat v2.0
  • vilib v0.0.6
  • PiCar-X v2.0

Tools used for Frontend development

  • Visual Studio 2022

Nuget Packages used for the Frontend

Package Version
Microsoft.Extensions.Logging.Abstractions 7.0.1
Microsoft.Extensions.Options 7.0.1
MQTTnet 4.3.1.873
MQTTnet.Extensions.ManagedClient 4.3.1.873
Microsoft.NET.Test.Sdk 17.5.0
NSubstitute 5.1.0
xunit 2.4.2
xunit.runner.visualstudio 2.4.5
coverlet.collector 3.2.0
Microsoft.Extensions.Logging 7.0.0

Changelog

Version 1.1

Date: 2023-10-31

Release-triggering changes

  • Increase of motor speed to 50

Secondary changes

  • MQTT commands for configuration of PI controller and grayscale sensor added
  • Calibration of grayscale sensor added
  • Limits for integral part of PI Controller implemented
  • PI controller parameters adjusted

Version 1.0

Date: 2023-09-25

Initial version

Additional Information

Getting started with the Raspberry PI

Youtube video: The PiCar-X. A Raspberry Pi powered robot car. Supplied by SunFounder

Environment:

WLAN: Hackathon
MQTT: broker.hivemq.com