24. State Signal Specification - m-marini/wheellyj GitHub Wiki

State Signal Specification

Revision 0.27.0

1. Overview

The Wheelly state is represented by three signals:

Signal Type Shape Values Description
sensor FLOAT [1] -135 ... +135 Head direction relative to the map
canMoveStates INTEGER [1] 0 ... 5 Movement and contact state
map INTEGER [4+N, W, H] 0, 1 Map and marker information

For a batch of n states:

Signal Shape
sensor [n, 1]
canMoveStates [n, 1]
map [n, 4+N, W, H]

Where:

  • N = number of configured markers
  • W = map width
  • H = map height

2. sensor

The sensor signal represents the robot head direction relative to the map direction.

Value Meaning
-135° 135° in the negative direction
0° Aligned with the map
+135° 135° in the positive direction

The value is expressed in degrees.


3. canMoveStates

The canMoveStates signal represents the robot movement and contact condition.

Code Description
0 Blocked with front contact
1 Front obstacle with contact
2 Rear contact
3 No contact
4 Blocked without front contact
5 Front obstacle without contact

The state depends on:

  • whether the robot can move forward;
  • whether the robot can move backward;
  • whether the front sensor detects an obstacle.

Decision Table

Forward Backward Front sensor State
Yes Yes — 3
Yes No — 2
No Yes Yes 5
No Yes No 1
No No Yes 4
No No No 0

4. map

The map signal is a binary multi-channel grid.

Each cell contains either:

  • 0 — condition not present
  • 1 — condition present

The map contains four cell-state channels plus one channel for each configured marker.

Cell Channels

Channel Meaning
0 Unknown
1 Empty
2 Contact
3 Echo

Each cell belongs to exactly one of these four states.

Marker Channels

Each recognized marker has one dedicated channel.

Marker channels start at channel 4.

For marker index i:

channel = 4 + i
Channel Meaning
4 Marker 0
5 Marker 1
6 Marker 2
... ...
4 + N - 1 Marker N - 1

5. State Flow

flowchart TD
    WM[World Model]

    WM --> RS[Robot Status]
    WM --> GM[Grid Map]
    WM --> MK[Markers]

    RS --> SENSOR[sensor]
    RS --> MOVE[canMoveStates]

    GM --> MAP[map]
    MK --> MAP

Summary

The Wheelly state provides:

  • Orientation through sensor
  • Movement and contact information through canMoveStates
  • Spatial information through map

Together, these signals provide the Reinforcement Learning agent with information about the robot's orientation, movement constraints, and surrounding environment.