How to find point to approach an object that is as far away from closest obstacle as possible? [closed]
This appears to me like a pretty complex task. I'd like to make my robot approach an object that is in a known location on the map. The robot should move to a specified distance to the object... ah, let a picture explain it:
The grey area in the center is an obstacle. The yellow square is the object my robot shall approach. The red dot is the position the robot should move to without touching the object. The dashed circle around the object is the distance the robot should stop at, facing the object. The dashed line indicates that the goal is on the exact opposite side of the object from the nearest obstacle.
Do you guys have any idea of how I can achieve this behavior?
What I already have is the location of the object and a local and global costmap map (which both should be taken into account).
Thank you very much!
Cheers, Hendrik
Did you ever come up with a solution to this problem?
Not really, no. It has become obsolete by now. I'd probably just calc the line between the centers of the obstacle and the object, calc a circle around the center of the object and take the point where the line and the circle intersect. There are two, so I'd take the one further away f. t. obstacle.
Furthermore I'd rely on some navigation stack that can avoid obstacles and set a navigation target including the heading which can also be calculated from the centers of the object and the obstacle.
But, as I said, the question has become obsolete.