From c0db1536aedad8c580f584be78df5ca9f2139c8b Mon Sep 17 00:00:00 2001 From: retinfai Date: Tue, 5 Sep 2023 17:09:02 +1200 Subject: [PATCH 1/4] Update helperScripts --- helperScripts/1manual.sh | 9 +++++++-- helperScripts/2train.sh | 13 ++++++++++--- helperScripts/3test.sh | 9 +++++++-- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/helperScripts/1manual.sh b/helperScripts/1manual.sh index 62948fe9..b6940d9a 100755 --- a/helperScripts/1manual.sh +++ b/helperScripts/1manual.sh @@ -10,8 +10,13 @@ trap cleanup SIGINT SIGTERM cd ~/autonomous_f1tenth/ -export GZ_PARTITION=50 -export ROS_DOMAIN_ID=50 +if [ -n "$1" ]; then + export GZ_PARTITION=$1 + export ROS_DOMAIN_ID=$1 +else + export GZ_PARTITION=50 + export ROS_DOMAIN_ID=50 +fi . install/setup.bash diff --git a/helperScripts/2train.sh b/helperScripts/2train.sh index 4567c0de..382e530d 100755 --- a/helperScripts/2train.sh +++ b/helperScripts/2train.sh @@ -10,14 +10,21 @@ trap cleanup SIGINT SIGTERM cd ~/autonomous_f1tenth/ -export GZ_PARTITION=100 -export ROS_DOMAIN_ID=100 +if [ -n "$1" ]; then + export GZ_PARTITION=$1 + export ROS_DOMAIN_ID=$1 +else + export GZ_PARTITION=100 + export ROS_DOMAIN_ID=100 +fi . install/setup.bash colcon build ros2 launch reinforcement_learning train.launch.py & -gz sim -g & +if [ "$1" == "y" ] || [ "$1" == "Y" ]; then + gz sim -g & +fi wait diff --git a/helperScripts/3test.sh b/helperScripts/3test.sh index 6ec86930..d675e273 100755 --- a/helperScripts/3test.sh +++ b/helperScripts/3test.sh @@ -10,8 +10,13 @@ trap cleanup SIGINT SIGTERM cd ~/autonomous_f1tenth/ -export GZ_PARTITION=150 -export ROS_DOMAIN_ID=150 +if [ -n "$1" ]; then + export GZ_PARTITION=$1 + export ROS_DOMAIN_ID=$1 +else + export GZ_PARTITION=150 + export ROS_DOMAIN_ID=150 +fi . install/setup.bash From a25e6a39328ef646a763b99b78b26a861223783c Mon Sep 17 00:00:00 2001 From: retinfai Date: Tue, 5 Sep 2023 17:09:20 +1200 Subject: [PATCH 2/4] Update train.yaml --- src/reinforcement_learning/config/train.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reinforcement_learning/config/train.yaml b/src/reinforcement_learning/config/train.yaml index fc015517..dcff700f 100644 --- a/src/reinforcement_learning/config/train.yaml +++ b/src/reinforcement_learning/config/train.yaml @@ -10,10 +10,10 @@ train: observation_mode: 'lidar_only' evaluate_every_n_steps: 2000 evaluate_for_m_episodes: 3 - # actor_path & critic_path must exist, it can't be commented # actor_path: 'rl_logs/23_08_02_17:59:13/models/actor_checkpoint.pht' # critic_path: 'rl_logs/23_08_02_17:59:13/models/critic_checkpoint.pht' gamma: 0.95 + # actor_path & critic_path must exist for retrain.sh, it can't be commented # tau: 0.005 g: 1 # batch_size: 32 From 6788a099294c95f9c399946984e0b685d0fc2c93 Mon Sep 17 00:00:00 2001 From: retinfai Date: Tue, 5 Sep 2023 17:11:25 +1200 Subject: [PATCH 3/4] CarBeat change to lidar_only default --- src/environments/environments/CarBeatEnvironment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/environments/environments/CarBeatEnvironment.py b/src/environments/environments/CarBeatEnvironment.py index f30f974b..dfc38272 100644 --- a/src/environments/environments/CarBeatEnvironment.py +++ b/src/environments/environments/CarBeatEnvironment.py @@ -27,7 +27,7 @@ def __init__(self, collision_range=0.2, step_length=0.5, track='track_1', - observation_mode='full', + observation_mode='lidar_only', max_goals=500): super().__init__('car_beat_environment') From 7f6b8c7bd4e1bc9b9c93d7fb1907cc8f8027c763 Mon Sep 17 00:00:00 2001 From: Nick <69305722+Bac0nEater@users.noreply.github.com> Date: Tue, 5 Sep 2023 17:12:51 +1200 Subject: [PATCH 4/4] Update train.yaml --- src/reinforcement_learning/config/train.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reinforcement_learning/config/train.yaml b/src/reinforcement_learning/config/train.yaml index dcff700f..9687b2d8 100644 --- a/src/reinforcement_learning/config/train.yaml +++ b/src/reinforcement_learning/config/train.yaml @@ -10,10 +10,10 @@ train: observation_mode: 'lidar_only' evaluate_every_n_steps: 2000 evaluate_for_m_episodes: 3 + # actor_path & critic_path must exist for retrain.sh, it can't be commented # actor_path: 'rl_logs/23_08_02_17:59:13/models/actor_checkpoint.pht' # critic_path: 'rl_logs/23_08_02_17:59:13/models/critic_checkpoint.pht' gamma: 0.95 - # actor_path & critic_path must exist for retrain.sh, it can't be commented # tau: 0.005 g: 1 # batch_size: 32