Monday, May 13, 2024

AI controls Lunar Lander: From Earth to Moon


AI/Reinforcement Learning - The Lunar Lander environment simulates landing a small rocket on the moon surface. The environment for testing the algorithm is freely available on the Gymnasium web site. In the simulation, the spacecraft has a main engine and two lateral boosters that can be used to control its descent and the orientation of the spacecraft. The spacecraft is subject to the moon's gravitational pull, and the engines have an unlimited amount of fuel. The spacecraft must navigate to the landing spot between two flags at coordinates (0,0) without crashing. Landing outside of the landing pad is possible. The lander starts at the top center of the viewport with a random initial force applied to its center of mass. The environment has 4 discrete actions: 0: do nothing 1: fire left orientation engine 2: fire main engine 3: fire right orientation engine The state is an 8-dimensional vector: the coordinates of the lander in x & y, its linear velocities in x & y, its angle, its angular velocity, and two booleans that represent whether each leg is in contact with the ground or not. After every step a reward is granted. The total reward of an episode is the sum of the rewards for all the steps within that episode. For each step, the reward: - is increased/decreased the closer/further the lander is to the landing pad. - is increased/decreased the slower/faster the lander is moving. - is decreased the more the lander is tilted (angle not horizontal). - is increased by 10 points for each leg that is in contact with the ground. - is decreased by 0.03 points each frame a side engine is firing. - is decreased by 0.3 points each frame the main engine is firing. The episode receive an additional reward of -100 or +100 points for crashing or landing safely respectively. An episode is considered a solution if it scores at least 200 points. The episode finishes if the lander crashes, flies outside of the viewport of stops moving. 🌐 My Website 🌐: https://www.techrakete.com Want to see more videos? Then visit my channel: 🚀 https://www.youtube.com/@techrakete Here you'll find playlists on various topics: 🚀 https://www.youtube.com/@techrakete/playlists You can subscribe to my channel using this link: 🚀 https://www.youtube.com/c/techrakete?sub_confirmation=1 Follow me on Instagram or Facebook 📱: https://www.instagram.com/techrakete https://www.facebook.com/techrakete

No comments:

Post a Comment