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
634 stars 126 forks source link

Some problems about ZeroDivisionError #138

Open Ethan0207 opened 7 months ago

Ethan0207 commented 7 months ago

Hi, I have a question I'd like to consult about. When I changed the LiDAR, I encountered the following error during the training process. So, when using the Velodyne LiDAR, why do you not need to consider this division by zero error? And How can you ensure that mag1 * mag2 does not equal zero? 4 24-1 4 24-2

reiniscimurs commented 7 months ago

Division by 0 can only happen if both data[i][0] and data[i][1] are 0. This is unrealistic as it means that the returned point value is at x=0 and y=0. This does not happen for the velodyne Puck as those are not real values that it could encounter.

My only guess is that the lidar you are using is either not set up properly, is returning faulty data or sets inf values as 0. You shoyld check how data is represented differently between the velodyne lidar and the lidar you are using.