diff --git a/src/environments/environments/CarBeatEnvironment.py b/src/environments/environments/CarBeatEnvironment.py index b552bfe8..66e270b2 100644 --- a/src/environments/environments/CarBeatEnvironment.py +++ b/src/environments/environments/CarBeatEnvironment.py @@ -19,6 +19,46 @@ class CarBeatEnvironment(Node): + """ + CarBeat Reinforcement Learning Environment: + + Task: + Agent learns to drive a track and overtake a car that is driving at a constant speed. + The second car is using the Follow The Gap algorithm. + + Observation: + full: + Car Position (x, y) + Car Orientation (x, y, z, w) + Car Velocity + Car Angular Velocity + Lidar Data + no_position: + Car Orientation (x, y, z, w) + Car Velocity + Car Angular Velocity + Lidar Data + lidar_only: + Car Velocity + Car Angular Velocity + Lidar Data + + No. of lidar points is configurable + + Action: + It's linear and angular velocity (Twist) + + Reward: + +2 if it comes within REWARD_RANGE units of a goal + +200 if it overtakes the Follow The Gap car + -25 if it collides with a wall + + Termination Conditions: + When the agent collides with a wall or the Follow The Gap car + + Truncation Condition: + When the number of steps surpasses MAX_GOALS + """ def __init__(self, rl_car_name, ftg_car_name, diff --git a/src/environments/environments/CarBlockEnvironment.py b/src/environments/environments/CarBlockEnvironment.py index df12b79a..f09b6081 100644 --- a/src/environments/environments/CarBlockEnvironment.py +++ b/src/environments/environments/CarBlockEnvironment.py @@ -14,25 +14,28 @@ class CarBlockEnvironment(F1tenthEnvironment): """ - CarWall Reinforcement Learning Environment: + CarBlock Reinforcement Learning Environment: Task: - Here the agent learns to drive the f1tenth car to a goal position + Agent learns to navigate to a goal position while avoiding obstacles that are dynamically placed at the start of each episode Observation: - It's position (x, y), orientation (w, x, y, z), lidar points (approx. ~600 rays) and the goal's position (x, y) + Car Position (x, y) + Car Orientation (x, y, z, w) + Car Velocity + Car Angular Velocity + Lidar Data Action: - It's linear and angular velocity + Its linear and angular velocity (Twist) Reward: - It's progress toward the goal plus, - 100+ if it reaches the goal plus, - -50 if it collides with the wall + Its progress towards the goal * 10 + +100 if it reaches the goal + -25 if it collides with an obstacle or flips over Termination Conditions: - When the agent is within REWARD_RANGE units or, - When the agent is within COLLISION_RANGE units + When the agent collides with a wall or reaches the goal Truncation Condition: When the number of steps surpasses MAX_STEPS diff --git a/src/environments/environments/CarGoalEnvironment.py b/src/environments/environments/CarGoalEnvironment.py index 9a6e78ff..2967afb4 100644 --- a/src/environments/environments/CarGoalEnvironment.py +++ b/src/environments/environments/CarGoalEnvironment.py @@ -8,26 +8,28 @@ class CarGoalEnvironment(F1tenthEnvironment): """ - CarWall Reinforcement Learning Environment: + CarGoal Reinforcement Learning Environment: Task: Here the agent learns to drive the f1tenth car to a goal position. - This happens all within a 10x10 box + This happens in an open area. Observation: - It's position (x, y), orientation (w, x, y, z), lidar points (approx. ~600 rays) and the goal's position (x, y) + Car Position (x, y) + Car Orientation (x, y, z, w) + Car Velocity + Car Angular Velocity + Goal Position (x, y) Action: - It's linear and angular velocity + Its linear and angular velocity Reward: - It's progress toward the goal plus, - 100+ if it reaches the goal plus, - -50 if it collides with the wall + Its progress toward the goal plus, + +100 if it reaches the goal plus Termination Conditions: - When the agent is within REWARD_RANGE units of the goal or, - When the agent is within COLLISION_RANGE units of a wall + When the agent is within REWARD_RANGE units of the goal Truncation Condition: When the number of steps surpasses MAX_STEPS diff --git a/src/environments/environments/CarTrackEnvironment.py b/src/environments/environments/CarTrackEnvironment.py index 42e1a1dc..af539bb9 100644 --- a/src/environments/environments/CarTrackEnvironment.py +++ b/src/environments/environments/CarTrackEnvironment.py @@ -11,6 +11,43 @@ class CarTrackEnvironment(F1tenthEnvironment): + """ + CarTrack Reinforcement Learning Environment: + + Task: + Agent learns to drive a track + + Observation: + full: + Car Position (x, y) + Car Orientation (x, y, z, w) + Car Velocity + Car Angular Velocity + Lidar Data + no_position: + Car Orientation (x, y, z, w) + Car Velocity + Car Angular Velocity + Lidar Data + lidar_only: + Car Velocity + Car Angular Velocity + Lidar Data + + Action: + It's linear and angular velocity (Twist) + + Reward: + +2 if it comes within REWARD_RANGE units of a goal + -25 if it collides with a wall + + Termination Conditions: + When the agent collides with a wall or the Follow The Gap car + + Truncation Condition: + When the number of steps surpasses MAX_GOALS + """ + def __init__(self, car_name, reward_range=0.5, diff --git a/src/environments/environments/CarWallEnvironment.py b/src/environments/environments/CarWallEnvironment.py index 0fc0b8cc..32fe1020 100644 --- a/src/environments/environments/CarWallEnvironment.py +++ b/src/environments/environments/CarWallEnvironment.py @@ -18,7 +18,12 @@ class CarWallEnvironment(F1tenthEnvironment): This happens all within a 10x10 box Observation: - It's position (x, y), orientation (w, x, y, z), lidar points (approx. ~600 rays) and the goal's position (x, y) + Car Position (x, y) + Car Orientation (x, y, z, w) + Car Velocity + Car Angular Velocity + Lidar Data + Goal Position (x, y) Action: It's linear and angular velocity