TD Environment - m-marini/wheellyj GitHub Wiki
The TD environment manages the interaction between the robot controller and the TD agent
In particular it transforms the signals of the robot controller into signals for the TD agent and the actions of the TDAgent into actions for the robot controller.
The environment also generates the reward based on the objective you set.
PolarRobotEnv
The polar environment are implemented by org.mmarini.wheelly.envs.PolarRobotEnv class.
Signals
The signals generated are:
sensor
The relative direction of sensor in degrees as single float value of degrees from -90 to 90 DEG
distance
The distance of echo signal as single float value of meters from 0 to 10 m
canMoveStates
The flag of move ability as single integer (0, 5) value
| Value | 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 |
sectorStates
The sector flag as n integer values one for each sector of the polar map
| Value | Descr |
|---|---|
| 0 | Unknown: no scans for that sector |
| 1 | Empty: scans without any signal |
| 2 | Hindered: scans with echo signal but no QR code recognized by camera |
| 3 | Labeled: scans with echo signal and QR code recognized by camera |
sectorDistances
The distance in meters of the hindered or labeled sectors known as n float values from 0 to maximum distance of radar echo
One for each sector of the polar map
robotMapDir
The direction of robot relative to the frontal radar view in DEG from -45 to 45
cellStates
The cells flag as n integer values one for each radar cell of the frontal robot view.
| Value | Descr |
|---|---|
| 0 | Unknown: no scans for that cell |
| 1 | Contact: contact cell |
| 2 | Labeled: scans with echo signal and QR code recognized by camera |
| 3 | Hindered: scans with echo signal but no QR code recognized by camera |
| 4 | Empty: scans without any signal |
Action
move action
The motion action code encodes the movement of the robot, encodes two basic actions: speed and direction change. In total there are # speeds x # of directions.
E.g. 5 speed x 8 directions (45 DEG step)
| Code | Direction (DEG) | Speed (pps) |
|---|---|---|
| 0 | -180 | -60 |
| 1 | -180 | -30 |
| 2 | -180 | 0 |
| 3 | -180 | 30 |
| 4 | -180 | 60 |
| 5 | -135 | -60 |
| 6 | -135 | -30 |
| 7 | -135 | 0 |
| 8 | -135 | 30 |
| 9 | -135 | 60 |
| 10 | -90 | -60 |
| 11 | -90 | -30 |
| 12 | -90 | 0 |
| 13 | -90 | 30 |
| 14 | -90 | 60 |
| 15 | -45 | -60 |
| 16 | -45 | -30 |
| 17 | -45 | 0 |
| 18 | -45 | 30 |
| 19 | -45 | 60 |
| 20 | 0 | -60 |
| 21 | 0 | -30 |
| (halt) 22 | 0 | 0 |
| 23 | 0 | 30 |
| 24 | 0 | 60 |
| 25 | 45 | -60 |
| 26 | 45 | -30 |
| 27 | 45 | 0 |
| 28 | 45 | 30 |
| 29 | 45 | 60 |
| 30 | 90 | -60 |
| 31 | 90 | -30 |
| 32 | 90 | 0 |
| 33 | 90 | 30 |
| 34 | 90 | 60 |
| 35 | 135 | -60 |
| 36 | 135 | -30 |
| 37 | 135 | 0 |
| 38 | 135 | 30 |
| 39 | 135 | 60 |
Release 0.21.0