← Back to search

For robotics teachers: ROS 2 Obstacle Detection Zones with LiDAR in C++ | Open Class #7

The Construct Robotics Institute 41:02

1,429 views · 34 likes Watch on YouTube ↗

In a real warehouse environment, a robot needs to know not just that an obstacle exists, but where it is relative to itself. By dividing LiDAR scan data into directional zones—Front, Left, and Right—the robot can make informed decisions about its path.

In this open class, you will walk through a practical project that demonstrates exactly how this works, processing the raw ranges array from the /fastbot_1/scan topic and alerting the operator whenever an obstacle enters any of these zones.

You will learn:

✅ Subscribing to LiDAR scan topics and processing the raw ranges array in C++
✅ Dividing a 360° field of view into named directional zones using angular index calculations
✅ Filtering invalid sensor readings (NaN, Inf, out-of-range values) for robust obstacle detection
✅ Using RCLCPP_WARN to trigger zone-specific alerts when obstacles breach a configurable distance threshold

📁 *ROS project link: https://app.theconstruct.ai/l/71852762/
🤖️ *Robot Used: BotBot: https://www.theconstruct.ai/botbox-warehouse-lab/

Related courses:
* C++ for Robotics (Free): https://app.theconstruct.ai/courses/c-for-robotics-59/
* ROS2 Basics in 5 Days (C++): https://app.theconstruct.ai/courses/ros2-basics-in-5-days-c-325/


============================

[For Robotics Teachers Open Class], a weekly series of videos by The Construct Robotics Institute, aims to make robotics education easier by helping teachers teach a wide range of robotics topics through hands-on practice.

Each session provides a ROS-based project (referred to as ROSJECTs 🦾 📁) for all attendees, including notebooks, code, and robot simulations. Led by ROS expert Desire, you'll see how robotics teaching and hands-on practice come together in real time.

*Missed a session? Find recordings & ROSJECTs on https://app.theconstruct.ai/open-classes/*

We're excited to share this series with you! If you have questions or want to explore new topics, drop us a comment below.

Cheers.

*The Construct Robotics Institute | Where Your Robotics Career Happens*

============================

👨‍🏫 Class Creator: Desire (ROS Tutor @The Construct Robotics Institute )
👩‍💻 Class cover designer: Sonia/Ruojun Wang (Marketing Assistant @The Construct Robotics Institute )

--
#ai #Robotics #ros #robot #ros2

Playback is via YouTube's official embedded player. Data from YouTube; Exumo is not affiliated with YouTube.