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 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') diff --git a/src/reinforcement_learning/config/train.yaml b/src/reinforcement_learning/config/train.yaml index fc015517..9687b2d8 100644 --- a/src/reinforcement_learning/config/train.yaml +++ b/src/reinforcement_learning/config/train.yaml @@ -10,7 +10,7 @@ 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 & 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