I need a help and guide in this case

Seems to me here, that the issue is one of discriminating between an obstacle and a target. There are many ways of measuring distance to something (ultrasound, eg), but knowing that something's a target (attract) or an obstacle (repel) is another question.

Then, you need to be able to detect a target even if there's an obstacle in the way.

So, you need to investigate what sensors are available that are a) able to discriminate between friends and foes and b) be visible behind each other.

Infrared beaconing comes to mind, although I have no knowledge of it. How about RFID?- although I don't know what range that works over. I think electronic toll tags are RFID, not sure.

How does aircraft IFF (Identify Friend of Foe) work? Maybe look into that?