# Flying a copter through an L-shaped hallway using Bendy Ruler and a 360 degree lidar

Hello All! I’ve been wondering what method could work to execute this mission of flying a copter through an L-shaped hallway, one of them is to use 360 degree lidar and Bendy Ruler. 360 degree lidar is used to scan the obstacles around the copter, and bendy ruler is used to determine the shortest path between two waypoints.

Since the copter starts taking off inside of the hallway, and the shortest path between two waypoints is through the L-shaped path, I think the copter should follow that L-shaped path. But, is it truly possible? Thanks in advance!

1 Like

What you are describing is likely a use case for the Djikstra algorithm over BendyRuler. Djikstra looks ahead to the next waypoint, where BendyRuler only looks ahead as far as you specify.

2 Likes

Yeah, i think about that route, but with lidar and fixed OA_MARGIN_MAX, i think it will through the center of the corner, won’t it?

Thanks for the answer, mate. But i’m a bit confused here, because in the documentation (Object Avoidance with Dijkstra’s — Copter documentation), it says that Dijkstra’s does not support avoiding objects sensed with lidar or proximity sensors

Ah yes. So you must use BR. I’m not confident that it will perform well if you try to navigate narrow corridors without some prior knowledge and a few breadcrumbs to guide the way. It’s testable in SITL.

Really, this probably calls for SLAM and a ROS layer or similar to guide the navigation rather than relying solely on the somewhat simplistic native OA.

1 Like

Hi @syahrialrasyid ! As Yuri suggested, you can try cartographer or hector slam with ROS for these type of tasks.

Cartographer ROS 1

Cartographer ROS 2

Hector SLAM

1 Like

Well, I think it depends on the geometry of the copter and the L-shaped corridor, and we can try thoese paramters and check the result in simulation.

1 Like

@lida2003 Thanks for the answer, mate! I have another question, because Bendy Ruler (in my case) uses waypoints, which is set by using the help of GPS, so it means that this Bendy Ruler does rely on GPS accuration, doesn’t it?

Okay, i’ve also been considering learning about it

Thanks for the help, mate!

If it depens on GPS, then it has something to do with the accuracy of GPS. Maybe RTK GPS should be used.
But Is it possible for GPS get locked in an L-shaped hallway (no ceiling, no high walls)??? Or Non-GPS positioning tech might be a good choice, such as lidar/visual camera.