Skip to content

Commit

Permalink
Merge pull request #161 from UoA-CARES/Random_launch
Browse files Browse the repository at this point in the history
Random can launch
  • Loading branch information
emilysteiner71 authored Apr 23, 2024
2 parents 0b2cfc3 + f028f62 commit e59807b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/controllers/config/sim.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sim:
ros__parameters:
algorithm: 'ftg'
algorithm: 'random'
observation_mode: 'lidar_only'
environment: 'CarTrack'
track: 'multi_track'
Expand Down
3 changes: 2 additions & 1 deletion src/controllers/controllers/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ def main():
CAR_NAME = params[0]

controller = Controller('random_', CAR_NAME, 0.25)
policy_id = 'random'

while True:
action = np.asarray([random.uniform(0, 3), random.uniform(-3.14, 3.14)])
controller.step(action)
controller.step(action, policy_id)


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/controllers/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import rclpy
import torch

from cares_reinforcement_learning.util.network_factory import NetworkFactory
#from cares_reinforcement_learning.util.network_factory import NetworkFactory
import cares_reinforcement_learning.util.configurations as cfg

from reinforcement_learning.parse_args import parse_args
Expand Down
1 change: 1 addition & 0 deletions src/controllers/launch/sim.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
alg_launch = {
'ftg': 'ftg',
'rl': 'rl',
'random': 'random',
}

def generate_launch_description():
Expand Down

0 comments on commit e59807b

Please sign in to comment.