mbaske / grid-sensor

Grid Sensor Components for Unity ML-Agents
MIT License
134 stars 28 forks source link

Spaceship normalized observations #7

Open Ademord opened 3 years ago

Ademord commented 3 years ago

Hello, Could you help me understand what are you doing here in the Spaceship.cs?

 NormPosition = Mathf.Clamp01(sqrMag / m_BrakeThreshRadiusSqr) * 2 - 1;
NormOrientation = Vector3.Angle(normal, fwd) / 90f - 1;

I am trying to understand how to normalize my position and orientation following your example.

Question 2: what is the point of normalizing positions and orientations?

mbaske commented 3 years ago

The agent needs to know how far it is from the asteroid field's center and what its orientation is in relation to a normal going from the center through the spaceships position. I'm normalizing both values to -1/+1 for vector observations.