reiniscimurs / DRL-robot-navigation

Deep Reinforcement Learning for mobile robot navigation in ROS Gazebo simulator. Using Twin Delayed Deep Deterministic Policy Gradient (TD3) neural network, a robot learns to navigate to a random goal point in a simulated environment while avoiding obstacles.
MIT License
571 stars 119 forks source link

Problem with the starting training #83

Closed Mehmet-Gozukucuk closed 6 months ago

Mehmet-Gozukucuk commented 10 months ago

First of all, Thank you for this great project . I am trying to train the agent you created with the codes you provided I did everything as you mentioned then I was able to train the agent but I had to stop the training. I tried to do it again a few times but I couldn't do it . if I export this

export ROS_HOSTNAME=localhost export ROS_MASTER_URI=http://localhost:11311 export ROS_PORT_SIM=11311 export GAZEBO_RESOURCE_PATH=~/DRL-robot-navigation/catkin_ws/src/multi_robot_scenario/launch source ~/.bashrc cd ~/DRL-robot-navigation/catkin_ws source devel_isolated/setup.bash

commands in the terminal and then start training I got this ; Screenshot from 2023-11-09 07-46-24 Screenshot from 2023-11-09 07-46-22

in my terminal . it says roscore on the top and nothing happens.

When I try to do it without exporting this commands;

export ROS_HOSTNAME=localhost export ROS_MASTER_URI=http://localhost:11311 export ROS_PORT_SIM=11311 export GAZEBO_RESOURCE_PATH=~/DRL-robot-navigation/catkin_ws/src/multi_robot_scenario/launch source ~/.bashrc cd ~/DRL-robot-navigation/catkin_ws source devel_isolated/setup.bash

I get something but I have some problems I see in my terminal and the robot goes randomly there is no obtacles and nothing in camera. Screenshot from 2023-11-09 07-11-23 Screenshot from 2023-11-09 07-28-37 Screenshot from 2023-11-09 07-28-49

Screenshot from 2023-11-09 07-28-57 so I am stuck at this point and I can't train the agent . if you can help me with this problem I would be so glad. Thanks in advance. additionally this is my .bashrc file Screenshot from 2023-11-09 07-58-49

reiniscimurs commented 10 months ago

Hi,

If you do not export the export GAZEBO_RESOURCE_PATH the gazebo simulation will not be able to find where the world file is located. So you end up loading just an empty world file. You could just add these exports to your source file.

For ROS not starting issues I do not know, what issue you might be facing. Generally there should be no problem in just passing these commands in the terminal, given that you closed your previous training properly and stopped all ros actions. Did you try simply restarting your computer and starting the training? This would ensure that any ros background process has been closed.

Mehmet-Gozukucuk commented 10 months ago

Yes I tried to restart my computer

Mehmet-Gozukucuk commented 10 months ago

I solved the problem thank you :)

reiniscimurs commented 10 months ago

I solved the problem thank you :)

Great! What was the solution? Would be good to know as it could help others if they encounter a similar situation.

Mehmet-Gozukucuk commented 10 months ago

of course, I am not sure if it was the problem but it was okay after I delete the commands in my bashrc file . As you see I had some commands starting from 121 line about conda . I delete all of them and redo the steps . Finally it is working perfectly Screenshot from 2023-11-09 11-44-42 Screenshot from 2023-11-09 11-44-55

manishvvit commented 7 months ago

Hello sir I am getting the same error , can you please help me out with training process. Screenshot from 2024-02-23 10-12-10