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
554 stars 120 forks source link

How to get the coordinates of obstacle area? #154

Open SleepTenMinuteAgain opened 2 months ago

SleepTenMinuteAgain commented 2 months ago

Hello, how can I get the coordinates of the obstacle area, such as the first area if -3.8 > x > -6.2 and 6.2 > y > 3.8: goal_ok = False I didn't understand what it meant by the obstruction area. image Is that the red area in the picture?

reiniscimurs commented 2 months ago

Yes that seems correct. We do not want goals to be located too close to the obstacles so we hardcode zones around them where a goal and robots starting position should not be located.

To get the coordinates you can either look up the positions of obstacles in the world file or simply estimate them even from this image (each square is 1x1 meter and the origin is the blue line)

SleepTenMinuteAgain commented 1 month ago

Thank you for your answer, it is very helpful to me! I have another question for you, how to move the self-contained aggregates (such as the cube below) in gazebo? Or is it moving at some linear and angular velocity? image

reiniscimurs commented 1 month ago

You mean to add it as a dynamic obstacle? Sorry, that is outside the scope of this repo and I do not know off the top of my head. I am sure there is some tutorial out there on that.

SleepTenMinuteAgain commented 1 month ago

Thank you very much for your patient answer❤❤❤!!! I tried to modify the minimum collision distance, but there were some problems. When I set the minimum collision distance to anything less than 0.35, the following picture will appear, collision occurs but does not terminate, how is this? image

reiniscimurs commented 1 month ago

Are you sure a collision is detected here? What you see is a laser state representation. But we only use velodyne lidar to detect collisions. Check the min value of the collision check to see if any collision is actually detected here.