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
487 stars 97 forks source link

There is a problem replacing the robot model #90

Closed pzhabc closed 3 months ago

pzhabc commented 6 months ago

Hello, thank you for sharing. After I changed the model of the robot to "turtlebot3_burger", the robot stayed in the same place all the time. What is the cause of this?

pzhabc commented 6 months ago

After a while, this happened. https://github.com/reiniscimurs/DRL-robot-navigation/assets/147294035/d0c529fd-f758-48f6-835e-056bf9fa1c7c d516fd869b31a91b0de7b7f285f3596c

pzhabc commented 6 months ago

I've found a few reasons why using this code is fine. 9ce7c0083724fa1227c15c4d65efefd0 Using this code will cause problems. d5fc8b5c8647ebbb12271aa1573c8509

reiniscimurs commented 6 months ago

Hi,

Please provide full information of the changes you have made and what exactly you are trying to do. It is very difficult to give any reasonable suggestions without more information.

pzhabc commented 6 months ago

你好

请提供您所做的更改以及您到底要做什么的完整信息。如果没有更多信息,很难给出任何合理的建议。

Hi,

Please provide full information of the changes you have made and what exactly you are trying to do. It is very difficult to give any reasonable suggestions without more information.

I used someone else's velodyne_env.py, who is quoting your code, and when I changed the robot model from "Pionner3dx" to "turtlebot3_burger", the robot stopped moving. My initial judgment was that it was a lidar problem. The problem arises when I replace the liDAR with the following: d5fc8b5c8647ebbb12271aa1573c8509 With this, there's no problem: 9ce7c0083724fa1227c15c4d65efefd0 Here is the main section of "velodyne_env.py" : self.unpause = rospy.ServiceProxy('/gazebo/unpause_physics', Empty) self.pause = rospy.ServiceProxy('/gazebo/pause_physics', Empty) self.reset_proxy = rospy.ServiceProxy('/gazebo/reset_world', Empty) self.publisher = rospy.Publisher('vis_mark_array', MarkerArray, queue_size=10)
self.vel_pub = rospy.Publisher('/r1/cmd_vel', Twist, queue_size=1) self.set_state = rospy.Publisher('gazebo/set_model_state', ModelState, queue_size=10)
self.velodyne = rospy.Subscriber('/velodyne_points', PointCloud2, self.velodyne_callback, queue_size=10)
self.laser = rospy.Subscriber('/r1/front_laser/scan', LaserScan, self.laser_callback, queue_size=10)
self.odom = rospy.Subscriber('/r1/odom', Odometry, self.odom_callback, queue_size=10)

reiniscimurs commented 6 months ago

Which repository branch are you using? You mention changing the p3dx model, why not just use the turtlebot branch and then just call the burger model?

Where is this code that you added from? It seems to me it is describing only joints of the sensor and not the sensor itself. Do you get any topics published as a laser scan? If you are using melodic branch, the robot will wait for scan to become available. If there is no scan, it will do nothing.

Just to re-iterate: Please provide full information about your problem and your setup such as (but not limited to) repo branch, your system setup, where did you get the other repo from, what exact code changes you made. Even if you think it is self explanatory, I cannot know what you are working with so please provide any sort of information you can give. Or else it is really difficult to help with any issues.

pzhabc commented 6 months ago

Which repository branch are you using? You mention changing the p3dx model, why not just use the turtlebot branch and then just call the burger model?

Where is this code that you added from? It seems to me it is describing only joints of the sensor and not the sensor itself. Do you get any topics published as a laser scan? If you are using melodic branch, the robot will wait for scan to become available. If there is no scan, it will do nothing.

Just to re-iterate: Please provide full information about your problem and your setup such as (but not limited to) repo branch, your system setup, where did you get the other repo from, what exact code changes you made. Even if you think it is self explanatory, I cannot know what you are working with so please provide any sort of information you can give. Or else it is really difficult to help with any issues.

I am using this code: env.txt image 208fb33ba6de782785dc4306b1f7e731

turtlebot3_burger.urdf.txt turtlebot3_burger.gazebo.txt Use "” There would be no problem

reiniscimurs commented 6 months ago

Which version of the repo are you using and do you see your laser topic being published?

pzhabc commented 6 months ago

I saw two lidar topics in the terminal, one was in "turtlebot3_burger.gazebo.xacro" and one was in "env.py".What is the reason for this? image image

reiniscimurs commented 6 months ago

Please provide the information asked.

I cannot help you if you do not provide meaningful information. If you do not know what information to provide, then please read previous comments or ask. You have changed some parts of the code that I do not know and are asking questions about it. I cannot help you in such a case.

pzhabc commented 6 months ago

Please provide the information asked.

I cannot help you if you do not provide meaningful information. If you do not know what information to provide, then please read previous comments or ask. You have changed some parts of the code that I do not know and are asking questions about it. I cannot help you in such a case.

Okay, the main thing is that the 'env.txt' file I provided above has been modified, and the other files are from your "turtlebot3" library. I can't seem to find this at the moment. I just copied the Pioneer3dx robot model from this library. , changed to the turtlebot3 burger robot model, and other files were not modified. But when I directly replaced it with turtlebot3 burger, an error occurred. I wonder if this information is enough? Sorry for the inconvenience.

reiniscimurs commented 6 months ago

I am still unsure what your repository is that you are using. Is it the Noetic-Turtlebot branch? But there are changes added from Melodic branch?

And what you are trying to do is to add 2d laser to the robot? It seems to me that you are doing something very messy here and I find it very difficult to understand what is what.

In any case your laser scan topic names do not line up. Check what is the name of the laser sensor that you are actually publishing.