Closed tyuownu closed 3 years ago
There are the world files, you can try it. If I forgot something, pls let me know. world.tar.gz
The recovery-mode is a little different. It basically means that the robot ignores its goal for a while and just drives to where is space. EvaluateAction is used to calculate the "goodness" of every possible motion command in [-1 .. 1] and the one evaluated best is executed. Changing the order of evaluation (e.g starting at 0 ) shouldn't change anything in the result.
Looking at your narrow passage, I would suggest to decrease the robot_radius instead, so that the robot "knows" that it can fit through the passage. It always helps to visualize the Operator's Costmap to see what is happening. In your case the robot sees its path blocked, and in this situation turning in place is the only safe operation.
Yeah, I was do something with the narrow passage.
Image that situation
the robot run into a passage with not strictly in line. Than the robot will turn left( with best best_dir
), then it turn in a straight line, see below:
The robot still turn left in origin code(with dir=1, -1 or 0, best_dir = -1
), but it's more reasonable to run straight forward(best_dir = 0
), what do you think?
I also encountered this problem. What is your solution? @tyuownu @skasperski
I would say that navigating through a corridor as narrow as this example is a little outside the scope of this package. You might need to use a more sophisticated motion planner.
That being said, if you feel your robot should be able to pass a certain passage but cannot do it, the parameters of the operator's costmap_2d should always be the starting point for fine tuning the system.
Hi skasperski, I found that when the robot in a narrow corridor, the robot will spin after a while. Just like the image shows: The RIVZ shows:
the robot will turn left when it through the corridor.
So I dig into the source code, and found that when in this situation, the robot is in
recovery
mode (because the corridor is narrow), thevalueDistance
andvalueSafety
are all equal to 1.0 (when the direction = -1/1 and direction = 0), and the final result isbest_dir = -1
(turn left). But I think when in this situation,best_dir = 0
is more reasonable:best_dir = 0
means that the robot walks on the global planrecovery
mode is that there is a obstacle in front of the robot, but in this situation there none. Even there is a obstacle, thevalueDistance
will not equal to 1 (dir = 0).And the robot do a lot turn left operation, so I change the code, and after a lot tests found that it can deal with this situation. And it also helps the robot go through the narrow door. What do you think? Thanks