### Install JSBGym on Windows Source: https://github.com/sryu1/jsbgym/blob/main/README.md Install jsbgym using pip. Ensure FlightGear is installed and its bin directory is in the system PATH. ```console pip install jsbgym ``` -------------------------------- ### Install Rendering Packages on Linux Source: https://github.com/sryu1/jsbgym/blob/main/README.md Install python3-tk for rendering capabilities on Linux. ```console sudo apt-get install python3-tk ``` -------------------------------- ### Construct Environment ID Source: https://github.com/sryu1/jsbgym/blob/main/README.md An example of how to construct a JSBGym environment ID string. ```python f"{aircraft}-{task}-{shaping}-{flightgear}-v0" ``` -------------------------------- ### Verify FlightGear Installation on Windows Source: https://github.com/sryu1/jsbgym/blob/main/README.md Confirm FlightGear is runnable from the terminal by checking its version. ```console fgfs --version ``` -------------------------------- ### Create Environment with Specific ID Source: https://github.com/sryu1/jsbgym/blob/main/README.md Instantiate a JSBGym environment for a Cessna 172 on the Heading Control task without FlightGear. ```python env = gym.make("C172-HeadingControlTask-Shaping.STANDARD-NoFG-v0") ``` -------------------------------- ### Basic JSBGym Environment Usage Source: https://github.com/sryu1/jsbgym/blob/main/README.md Create, reset, and step through a JSBGym environment using the Gymnasium interface. ```python import jsbgym import gymnasium as gym env = gym.make(ENV_ID) env.reset() observation, reward, terminated, truncated, info = env.step(action) ``` -------------------------------- ### Configure FlightGear on Linux Source: https://github.com/sryu1/jsbgym/blob/main/README.md Move the FlightGear AppImage to /usr/local/bin and set the FG_ROOT environment variable. ```console sudo mv fgfs /usr/local/bin export FG_ROOT=/path/to/datafolder ``` -------------------------------- ### Render Environment in Human Mode Source: https://github.com/sryu1/jsbgym/blob/main/README.md Create and render a JSBGym environment in human mode for visualization. Requires FlightGear for 3D visualization. ```python env = gym.make("C172-HeadingControlTask-Shaping.STANDARD-NoFG-v0", render_mode="human") env.reset() env.render() ``` -------------------------------- ### Enable FlightGear 3D Rendering Source: https://github.com/sryu1/jsbgym/blob/main/README.md Use this code to create a JSBGym environment with FlightGear rendering enabled. Note that using this render mode during training is discouraged due to potential connection errors. ```python env = gym.make("C172-HeadingControlTask-Shaping.STANDARD-FG-v0", render_mode="flightgear") env.reset() env.render() ``` -------------------------------- ### JSBGym Action Space Definition Source: https://github.com/sryu1/jsbgym/blob/main/README.md Defines the 3-tuple continuous action space for JSBGym environments, representing normalized commands for ailerons, elevator, and rudder. ```python (name='fcs/aileron-cmd-norm', description='aileron commanded position, normalised', min=-1.0, max=1.0) (name='fcs/elevator-cmd-norm', description='elevator commanded position, normalised', min=-1.0, max=1.0) (name='fcs/rudder-cmd-norm', description='rudder commanded position, normalised', min=-1.0, max=1.0) ``` -------------------------------- ### JSBGym State Space Definition Source: https://github.com/sryu1/jsbgym/blob/main/README.md Defines the 11-tuple continuous state space for JSBGym environments, including altitude, pitch, roll, velocities, rates, and error metrics. ```python (name='position/h-sl-ft', description='altitude above mean sea level [ft]', min=-1400, max=85000) (name='attitude/pitch-rad', description='pitch [rad]', min=-1.5707963267948966, max=1.5707963267948966) (name='attitude/roll-rad', description='roll [rad]', min=-3.141592653589793, max=3.141592653589793) (name='velocities/u-fps', description='body frame x-axis velocity [ft/s]', min=-2200, max=2200) (name='velocities/v-fps', description='body frame y-axis velocity [ft/s]', min=-2200, max=2200) (name='velocities/w-fps', description='body frame z-axis velocity [ft/s]', min=-2200, max=2200) (name='velocities/p-rad_sec', description='roll rate [rad/s]', min=-6.283185307179586, max=6.283185307179586) (name='velocities/q-rad_sec', description='pitch rate [rad/s]', min=-6.283185307179586, max=6.283185307179586) (name='velocities/r-rad_sec', description='yaw rate [rad/s]', min=-6.283185307179586, max=6.283185307179586) (name='error/altitude-error-ft', description='error to desired altitude [ft]', min=-1400, max=85000) (name='error/track-error-deg', description='error to desired track [deg]', min=-180, max=180) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.