Skip to content

Inconsistency between state and self.ControlParameters.state14  #12

@rizwan-malik

Description

@rizwan-malik

While trying to understand the workings of the code and writing an agent myself, I noticed certain inconsistencies in the parameters defined in parameters.py file and value assignment to those variables in xplane_envBase.py file.
In Line 14 of parameters.py file state14 is defined as:
"state14" :{"roll_rate" :0 ,"pitch_rate" :0, "altitude": 0 ,"Pitch" :0 ,"Roll" :0, "velocity_x": 0, "velocity_y" :0 ,"velocity_z" :0 ,"delta_altitude" :0, "delta_heading" :0 ,"yaw_rate" :0},

then on Line 139 of xplane_envBase.py the variable state is assigned:

state = self.ControlParameters.stateAircraftPosition + self.ControlParameters.stateVariableValue

stateAircraftPosition is retrieved from XPlane Connect's getPOSI() function which returns these values : [Lat, Lon, Alt, Pitch, Roll, Yaw, Gear]

and stateVariableValue containes values for these drefs:

"stateVariable" : ["sim/flightmodel/position/local_vx" ,"sim/flightmodel/position/local_vy", "sim/flightmodel/position/local_vz"],

so, essentially the list 'state' contains following variables:
state = [Lat, Lon, Alt, Pitch, Roll, Yaw, Gear, local_vx, local_vy, local_vz]

However, when we look at assignments in Line 175, 176 and 177 of xplane_envBase.py file it can be noted that

  1. state14['velocity_x'] = state[6] whereas state[6] = Gear
  2. state14['velocity_y'] = state[6] whereas state[6] = local_vx
  3. state14['velocity_z'] = state[6] whereas state[6] = local_vy

So, I don't know if I am missing on something or what, but this should have a major impact on training.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions