# 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

edit retag reopen merge delete

### Closed for the following reason question is not relevant or outdated by Hendrik Wiese close date 2018-10-01 03:49:37.019881

Did you ever come up with a solution to this problem?

( 2018-09-19 10:28:19 -0500 )edit

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.

( 2018-10-01 03:47:56 -0500 )edit

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.

( 2018-10-01 03:48:59 -0500 )edit

But, as I said, the question has become obsolete.

( 2018-10-01 03:49:16 -0500 )edit