reiniscimurs / GDAE

A goal-driven autonomous exploration through deep reinforcement learning (ICRA 2022) system that combines reactive and planned robot navigation in unknown environments
110 stars 15 forks source link

How to use the TD3 trained model for GDAE for beginners? #5

Closed DevAB-Git closed 1 year ago

DevAB-Git commented 2 years ago

Hi Reinis,

Thank you for sharing the code and for all the support. I have trained the TD3 model for Neotic. Now, I want to use that model in GDAE for path-planning. I tried to run it however here are some of the issues that I could not understand as a beginner. 1) How to start the path planner server? I tried to run the roscore in a separate shell but the robot does not move. Is it the right way? 2) How to link the GDAE with the TD3 trained model. I mean how to use the trained model files (TD3_velodyne_actor.pth and/or TD3_velodyne_critic.pth) I could not find a place in the GDAE code files.

reiniscimurs commented 2 years ago

Hi

  1. First, make sure you have Navigation package installed and properly set up (including move_base and map_server). After that I am not entirely sure what exactly is the issue you are facing. The path planner will not execute the path and will not move the robot.
  2. TD3 repository is slightly different than the method presented here. It was never meant to be the exact network used in the GDAE project. In order to use it here, you will need to adjust the network parameters either on the GDAE end or train the TD3 with the parameters for GDAE. Manily, GDAE step function here describes the state with 23 values, but in TD3 repo it is 24 values. You could change the way lasers are bagged in GDAE to output 20 laser values instead of the 19. But to load the parameters you need to look at lines 61 to 70 in the GDAM.py file.
DevAB-Git commented 2 years ago

Hi Reinis, Thank you for your response. I have the navigation package and found both move_base and map_server packages at /opt/ros/noetic/share/move_base and /opt/ros/noetic/share/map_server, respectively. When I run the command pythn3 GDAM.py it stuck and generate a message:

Unable to register with master node [http://localhost:11311]: master may not be running yet. Will keep trying.

After that, I run roscore in a separate shell. Consequently, the ROS is loaded but the control is again stuck at self.client.wait_for_server()

It is noted that I'm not using an actual robot. Could you please tell me the procedure (steps) required to run the GDAE code?

To my understanding, the GDAE project is a kind of testing project that can use an already trained model (navigation policy) such as TD3 to avoid local obstacles and guide the robot to reach the global goal. Is it right? Your help in this regard is needed. Thanks

Regards, AB

reiniscimurs commented 2 years ago

To automatically start roscore, add line subprocess.Popen(["roscore"]) in line 122 in the gdam_env.py file. I think that should start roscore automatically. But yes, you can just start the roscore in a separate shell as well, that should not be an issue.

To check if the server is set up correctly, can you succesfully run this tutorial on actionlib?

DevAB-Git commented 2 years ago

Hi Reinis, Thank you for your reply. Sorry for the delayed response, I was busy writing a rebuttal for our IEEE Transactions on Cybernetics paper.

As per your suggestion, I played with the fibonacci tutorial on the actionlib. To make the client working, I have to run roscore, fibonacci_server, and then fibonacci_client.

Regarding the GDAE, my system is still stuck at the line, self.client.wait_for_server(). I read your comments in issue # 4 "but you should make sure that you have the Navigation and Move_Base ROS packages installed and that they are up and running." The Move_Base packages are installed on my machine but I could not get how to make them up and running. I think my path planner server is not running. Could you please guide me on how to start it? Thanks in advance.

reiniscimurs commented 2 years ago

You should see the nodes running by executing rostopic list If you see nodes like /move_base or /map then the nodes should be running

What does your launchfile look like? Is it similar to the example launchfile here?

If I remember correctly, then the map server should actually be started independently by SLAM_toolbox package, so that part might be missing from the launchfile. But then you should start SLAM_toolbox package beforehand in a separate shell.

reiniscimurs commented 1 year ago

Closing due to inactivity