Skip to content

Commit

Permalink
Merge pull request #74 from UoA-CARES/add-2nd-car
Browse files Browse the repository at this point in the history
Add sanity_check yaml file
  • Loading branch information
Bac0nEater authored Jul 17, 2023
2 parents 82af34e + 8c34eb9 commit 7c50951
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
18 changes: 18 additions & 0 deletions src/reinforcement_learning/config/sanity_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
sanity_check:
ros__parameters:
environment: 'CarTrack' # CarGoal, CarWall, CarBlock, CarTrack
track: 'track_1' # track_1, track_2, track_3 -> only applies for CarTrack
max_steps_exploration: 5000
max_steps_training: 1000000
reward_range: 1.0
collision_range: 0.2
# gamma: 0.95
# tau: 0.005
# g: 5
# batch_size: 32
# buffer_size: 1000000
# actor_lr: 0.0001
# critic_lr: 0.001
# max_steps: 10
# step_length: 0.25
# seed: 123
6 changes: 3 additions & 3 deletions src/reinforcement_learning/launch/sanity_check.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ def generate_launch_description():

config_path = os.path.join(
get_package_share_directory('reinforcement_learning'),
'train.yaml'
'sanity_check.yaml'
)

config = yaml.load(open(config_path), Loader=yaml.Loader)
env = config['train']['ros__parameters']['environment']
env = config['sanity_check']['ros__parameters']['environment']

environment = IncludeLaunchDescription(
launch_description_source=PythonLaunchDescriptionSource(
os.path.join(pkg_environments, f'{env_launch[env]}.launch.py')),
launch_arguments={
'track': TextSubstitution(text=str(config['train']['ros__parameters']['track'])),
'track': TextSubstitution(text=str(config['sanity_check']['ros__parameters']['track'])),
}.items() #TODO: this doesn't do anything
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
ACTION_NUM = 2

DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
TRAINING_NAME = 'sanity-' + datetime.now().strftime("%d-%m-%Y-%H:%M:%S")
TRAINING_NAME = 'sanity_check-' + datetime.now().strftime("%d-%m-%Y-%H:%M:%S")

# For controlling the car
linear_vel = 0
Expand Down

0 comments on commit 7c50951

Please sign in to comment.