{"id":49,"date":"2023-11-21T18:20:01","date_gmt":"2023-11-21T18:20:01","guid":{"rendered":"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/?page_id=49"},"modified":"2024-12-21T19:47:26","modified_gmt":"2024-12-21T19:47:26","slug":"software-design","status":"publish","type":"page","link":"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/system-implementation\/software-design\/","title":{"rendered":"Software Design and Implementation"},"content":{"rendered":"\n<h2 class=\"wp-block-heading has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background\">Software CodeBase<\/h2>\n\n\n\n<p>Our codebase can be found at our GitHub workspace (Running instructions can be found in respective ReadMes):<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/EmberEye-MRSD\/rsun_uas\" data-type=\"link\" data-id=\"https:\/\/github.com\/EmberEye-MRSD\/rsun_uas\">rsun_goal<\/a> &#8211; Utils and Launch files for physical\/simulation UAS bring-up &#8211; branch: fuel-cer-hw<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/EmberEye-MRSD\/rsun_fire_localization\">rsun_fire_localization<\/a> &#8211; Scripts for running our new perception pipeline &#8211; branch: main<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/EmberEye-MRSD\/rsun_goal_planner\" data-type=\"link\" data-id=\"https:\/\/github.com\/EmberEye-MRSD\/rsun_goal_planner\">rsun_goal_planner<\/a> &#8211; Personal copy of open source project with relavant mod &#8211; branch: p2p_hw<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/EmberEye-MRSD\/fast_exploration_planner\" data-type=\"link\" data-id=\"https:\/\/github.com\/EmberEye-MRSD\/fast_exploration_planner\">fast_exploration_planner <\/a>&#8211; Personal copy of open source exploration mod &#8211; branch: fuel_cer_hw<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/EmberEye-MRSD\/rsun_autonomy_simple\" data-type=\"link\" data-id=\"https:\/\/github.com\/EmberEye-MRSD\/rsun_autonomy_simple\">rsun_autonomy_simple<\/a> &#8211; branch: fuel_cer_hw<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/EmberEye-MRSD\/rsun_gcs_streaming\">rsun_gcs_streaming<\/a> &#8211; branch: hw_mods<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/EmberEye-MRSD\/rsun_drivers\" data-type=\"link\" data-id=\"https:\/\/github.com\/EmberEye-MRSD\/rsun_drivers\">rsun_drivers<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background\">Spring and Fall Semester Implementation<\/h2>\n\n\n\n<p>The following description about our subsystem implementation is distributed into two broad time periods: the Spring semester and the Fall semester. The fire localization and the state estimation subsystems were of major focus in the spring semester, however in the interest of a successful demonstration and realism to our use case, we took decision in the fall semester which extensively changed our subsystem design as compared to the spring semester including designing a new drone. To explain this aptly, we first describe the implementation summary of the fall semester, referring to the spring semester implementation details along the way. The spring semester work would be displayed below the fall semester work.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-pale-ocean-gradient-background has-background\">Fall Semester<\/h2>\n\n\n\n<h2 class=\"wp-block-heading has-text-align-center has-black-color has-text-color has-link-color wp-elements-69bb9dd14ed0436237de384a9ff232dd\">[Revamped] Fire Perception<\/h2>\n\n\n\n<p><strong>Fire Localization in Phoenix:<\/strong> In our previous aerial system, Phoenix, the fire localization module processed thermal images to determine fire hotspot coordinates for mapping. Two methods were explored: a learning-based approach developed by AirLab and a classical method developed by our team.<\/p>\n\n\n\n<p>The deployed method relied on classical stereo matching of synchronized thermal feeds, rectified using OpenCV&#8217;s <em>stereoRectify<\/em> to correct distortions. Temperature-based masks were generated to segment hotspots, and ORB features were then detected and matched between the left and right frames. The matches were refined using epipolar constraints to estimate depth and compute 3D coordinates in the world frame.<\/p>\n\n\n\n<p>Alternative approaches included generating disparity maps with StereoSGBM and using Fast-ACVNet for learning-based depth estimation. These methods showed promise but faced challenges such as information loss during image conversion and poor performance due to distribution mismatches.<\/p>\n\n\n\n<p>While Phoenix Pro employs a different fire localization system, these efforts informed our understanding of thermal-based perception.<\/p>\n\n\n\n<p><strong>In the <em>Phoenix Pro<\/em> system,<\/strong> the fire perception module was designed to localize and map fire hotspots more accurately compared to the previous approach used in <em>Phoenix<\/em>. The previous system relied on a thermal stereo-based design, which exhibited a localization error of approximately 2 meters within a range of 5 meters. This approach faced several challenges, including the requirement for a large baseline between thermal cameras and the difficulty of performing precise extrinsic calibration between them. These factors contributed to inaccuracies in fire localization, limiting the effectiveness of the system for real-world applications.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-medium-font-size\">Fusing RGBD and Thermal<\/h3>\n\n\n\n<p>To overcome these challenges and improve localization accuracy, we adopted a new approach in <em>Phoenix Pro<\/em> that leveraged the RealSense point cloud, effectively bypassing the need for thermal stereo. The RealSense camera provided dense RGB-D data, enabling us to obtain accurate depth measurements without the need for large baseline configurations or complex thermal camera calibration. By integrating thermal information with the RealSense point cloud, we could project fire hotspots detected in the thermal images into 3D space with higher precision. This method significantly enhanced the accuracy, localizing fires now up to 50 cm error for a 6 m range.<\/p>\n\n\n\n<p>The overall flow of information from the sensors (FLIR Boson + RealSense D456) to the fire localization and mapping is depicted in the figure below. We receive data from FLIR Boson at 30 fps, and point cloud from RS D456 at 30 fps. We first downsample the point cloud with a leaf size of 0.1 m, and clip the range to 8 m. This reduces the computational load and filters out bad points in the point cloud. With this configuration, we are able to achieve localization at 30 fps, i.e., in real time.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"321\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/fire_perception_pipeline-1024x321.png\" alt=\"\" class=\"wp-image-931 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/fire_perception_pipeline-1024x321.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/fire_perception_pipeline-300x94.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/fire_perception_pipeline-768x241.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/fire_perception_pipeline-1536x482.png 1536w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/fire_perception_pipeline-750x235.png 750w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/fire_perception_pipeline.png 1606w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>We do a binary segmentation of fire hotspots, transform the point cloud into FLIR Boson&#8217;s optical frame using RS-Thermal extrinsics, and then project the points onto the FLIR&#8217;s frame using the intrinsic parameters of the FLIR. We reproject only the pixels corresponding to the hotspots using the mask, and then publish the centroid of the reprojected points. For tackling multiple hotspots, we cluster the segments in the binary mask generated from the thermal image using OpenCV&#8217;s <code>connected_components<\/code>. Clustering in 2D image space rather than 3D space reduces the computational overload significantly and enables real-time operation. This is depicted in the following figure.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"356\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/fire_pipe-1024x356.png\" alt=\"\" class=\"wp-image-822 img-responsive\" style=\"width:849px;height:auto\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/fire_pipe-1024x356.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/fire_pipe-300x104.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/fire_pipe-768x267.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/fire_pipe-750x261.png 750w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/fire_pipe.png 1152w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Note that the range of the point cloud affects the fire perception capability during exploration. This parameter should be set based on the depth range assigned in the exploration. If the drone performs less exploration, then it is advised to set a longer range. However, this would affect localization accuracy due to poor points from the RS D456.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Global Fire Mapping<\/h3>\n\n\n\n<p>Similar to the Spring semester, the global fire mapping subsystem handles the temporal side of the fire perception subsystem. The fire perception module provides raw measurements of hotspot locations relative to the world frame. When the fire perception subsystem publishes a new set of measurements, this mapping subsystem is executed as shown in the flowchart above.<\/p>\n\n\n\n<p><mark class=\"has-inline-color has-black-color\"><em><strong>Note<\/strong>: Unlike the Spring where we had a dedicated filtering module, the introduction of RGBD-Thermal fusion significantly enhances the quality of our raw measurements. Specifically, moving away from the triangulation approach, there are now no false positives behind the camera.<\/em><\/mark><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"319\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/fire_mapping_flowchart-1024x319.png\" alt=\"\" class=\"wp-image-894 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/fire_mapping_flowchart-1024x319.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/fire_mapping_flowchart-300x93.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/fire_mapping_flowchart-768x239.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/fire_mapping_flowchart-750x233.png 750w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/fire_mapping_flowchart.png 1273w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<p><strong>Adding New Hotspot<\/strong>: We then perform nearest neighbor clustering for each hotspot to determine whether it is a measurement for a new or existing one. A new hotspot is created if it exceeds distances from all previously seen hotspots.<\/p>\n\n\n\n<p><strong>Updating Existing Hotspot<\/strong>: If we instead find any measurement corresponding to an existing hotspot, we add it to the existing nearest-neighbor map, and use a mean search to find the updated position of its parent hotspot.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-dots\" \/>\n<\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading has-text-align-center\">[Revamped] State Estimation<\/h2>\n\n\n\n<p>In line with our non-functional requirement <strong>MNF4<\/strong>, which mandates the use of passive sensing modalities, and considering the GPS-denied environment in which our system operates, we developed the state-estimation module to use two NIR cameras and an IMU sensor as inputs to estimate visual odometry.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">VINS Fusion<\/h3>\n\n\n\n<p>We choose to use off-the-shelf <a href=\"https:\/\/github.com\/HKUST-Aerial-Robotics\/VINS-Fusion\" data-type=\"link\" data-id=\"https:\/\/github.com\/HKUST-Aerial-Robotics\/VINS-Fusion\">VINS Fusion<\/a> which is an optimization-based multi-sensor state estimation package due to its wide adoption in the robotics community and its recognition for robustness. <\/p>\n\n\n\n<p>The key prerequisite for using the package with an IMU and cameras is to provide accurate IMU-to-camera extrinsic, camera intrinsics, IMU gyroscope and accelerometer biases (noise), and the time offset between the IMU and camera topics. The figure below shows the calibration pipeline developed to accomplish these tasks. Initially, <a href=\"https:\/\/www.google.com\/search?q=kalibr+&amp;sca_esv=fa27aa6c1a2c9000&amp;ei=VxhbZ6bOOL-QseMPjO7b2AE&amp;ved=0ahUKEwjm1c6B3KKKAxU_SGwGHQz3FhsQ4dUDCBA&amp;uact=5&amp;oq=kalibr+&amp;gs_lp=Egxnd3Mtd2l6LXNlcnAiB2thbGliciAyBRAAGIAEMgoQABiABBhDGIoFMgUQABiABDILEC4YgAQYxwEYrwEyBRAAGIAEMhAQLhiABBjRAxhDGMcBGIoFMgUQABiABDIFEAAYgAQyBRAAGIAEMgUQABiABEjKBlDrBFjhBXABeAGQAQCYAbEBoAGxAaoBAzAuMbgBA8gBAPgBAZgCAqACwQHCAgoQABiwAxjWBBhHwgINEAAYgAQYsAMYQxiKBcICExAuGIAEGLADGEMYxwEYigUYrwGYAwCIBgGQBgqSBwMxLjGgB8kJ&amp;sclient=gws-wiz-serp\" data-type=\"link\" data-id=\"https:\/\/www.google.com\/search?q=kalibr+&amp;sca_esv=fa27aa6c1a2c9000&amp;ei=VxhbZ6bOOL-QseMPjO7b2AE&amp;ved=0ahUKEwjm1c6B3KKKAxU_SGwGHQz3FhsQ4dUDCBA&amp;uact=5&amp;oq=kalibr+&amp;gs_lp=Egxnd3Mtd2l6LXNlcnAiB2thbGliciAyBRAAGIAEMgoQABiABBhDGIoFMgUQABiABDILEC4YgAQYxwEYrwEyBRAAGIAEMhAQLhiABBjRAxhDGMcBGIoFMgUQABiABDIFEAAYgAQyBRAAGIAEMgUQABiABEjKBlDrBFjhBXABeAGQAQCYAbEBoAGxAaoBAzAuMbgBA8gBAPgBAZgCAqACwQHCAgoQABiwAxjWBBhHwgINEAAYgAQYsAMYQxiKBcICExAuGIAEGLADGEMYxwEYigUYrwGYAwCIBgGQBgqSBwMxLjGgB8kJ&amp;sclient=gws-wiz-serp\">Kalibr<\/a> calibration package is used to obtain the camera intrinsics for the RealSense left and right NIR cameras using a checkerboard pattern. The <a href=\"https:\/\/github.com\/ori-drs\/allan_variance_ros\" data-type=\"link\" data-id=\"https:\/\/github.com\/ori-drs\/allan_variance_ros\">imu_variance_ros<\/a> package was then used to estimate the IMU biases, which were subsequently used by Kalibr to perform the calibration and obtain the IMU-to-camera extrinsic (for both cameras) and time offset.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"926\" height=\"319\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/vins-calibration-pipeline-1.png\" alt=\"\" class=\"wp-image-917 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/vins-calibration-pipeline-1.png 926w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/vins-calibration-pipeline-1-300x103.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/vins-calibration-pipeline-1-768x265.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/vins-calibration-pipeline-1-750x258.png 750w\" sizes=\"auto, (max-width: 926px) 100vw, 926px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Overall Pipeline<\/h3>\n\n\n\n<p>The flow of our state estimation module is illustrated below. The VINS node uses an IMU sensor and two NIR (Near-Infrared) images from the left and right cameras of the RealSense D456 to estimate the odometry. This data is then processed by the Transformer node, which publishes the odometry at a fixed rate of 25Hz, transformed with respect to the UAV platform&#8217;s base-link frame. Additionally, this node is also responsible for broadcasting the transforms between the map, IMU, odometry, base-link, and thermal camera to the RealSense depth frame.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"660\" height=\"237\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/state-estimation-flow-1.png\" alt=\"\" class=\"wp-image-910 img-responsive\" style=\"width:660px;height:auto\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/state-estimation-flow-1.png 660w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/state-estimation-flow-1-300x108.png 300w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/figure>\n<\/div>\n\n\n<p><strong><em>Note: <\/em><\/strong><em>In the Fall, we decided not to use Multi-Spectral Odometry (MSO), previously used in our Spring Demonstration. The decision was based on its limited documentation, tight integration within a Docker environment on ARM-based hardware (ORIN on ORDv1), incomplete code commits, and the departure of its key developer from Airlab, making it difficult to integrate into the new platform <strong>(Phoenix Pro)<\/strong>.<\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-dots\" \/>\n\n\n\n<h2 class=\"wp-block-heading has-text-align-center\">State Manager<\/h2>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a54d7da17b8b&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a54d7da17b8b\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"278\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" data-id=\"819\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/autonomy_plan-1024x278.png\" alt=\"\" class=\"wp-image-819 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/autonomy_plan-1024x278.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/autonomy_plan-300x81.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/autonomy_plan-768x209.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/autonomy_plan-750x204.png 750w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/autonomy_plan.png 1167w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Autonomy Architecture<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">FSM States<\/h3>\n\n\n\n<p>To keep track of the overall state of the system, we have some central states which are the minimum essential for aerial systems. These are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>GROUNDED:<\/strong> System on the ground in unarmed state.<\/li>\n\n\n\n<li><strong>TAKEOFF:<\/strong> System takes off and reaches desired height.<\/li>\n\n\n\n<li><strong>HOVER<\/strong> System in offboard mode. holding positions, awaiting interface state change.<\/li>\n\n\n\n<li><strong>ACTIVE_P2P:<\/strong> Active in P2P navigation mode<\/li>\n\n\n\n<li><strong>ACTIVE_EXP:<\/strong> Active in exploration mode<\/li>\n\n\n\n<li><strong>LANDING:<\/strong> System landing (in case of mission end or failure)<\/li>\n\n\n\n<li><strong>END:<\/strong> Mission end, disarm, no further transitions.<\/li>\n\n\n\n<li><strong>FAILURE:<\/strong> System level failures &#8211; asynchronous<\/li>\n<\/ul>\n\n\n\n<p>These states help us implement logic for the entire mission. Inside the Active P2P and EXP states we have further internal states inside the P2P and Exploration modules. These internal states handle the inner logic and help the central manager understand what&#8217;s going on inside the individual packages. These internal states are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>PRE_INIT<\/strong> : Pre-initialization phase to allow checking for inputs to either planner or exploration.<\/li>\n\n\n\n<li><strong>INIT_READY:<\/strong> Above checks pass, system ready to receive goal<\/li>\n\n\n\n<li><strong>ACTIVE:<\/strong> System is executing task ( p2p navigation or exploring an area )<\/li>\n\n\n\n<li><strong>DONE:<\/strong> Successful completion of task<\/li>\n\n\n\n<li><strong>FAILURE<\/strong>: Can happen at any step during the execution of task.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Central Manager<\/h3>\n\n\n\n<p>With the information about the system and the individual packages from above defined states, we have our mission logic inside the central manager. This handles the following tasks sequentially:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Arming the drone and takeoff commands using MAVROS API<\/li>\n\n\n\n<li>Switch to OFFBOARD mode and checks<\/li>\n\n\n\n<li>Once in OFFBOARD, and if overall system status in HOVER, switch to ACTIVE_P2P<\/li>\n\n\n\n<li>Once a goal is given, P2P goes to ACTIVE<\/li>\n\n\n\n<li>If there is no Failure, and P2P is done and <strong>system inside exploration region<\/strong>, switch to ACTIVE_EXP<\/li>\n\n\n\n<li>Once exploration is done, and there is no failure, go to LANDING.<\/li>\n<\/ul>\n\n\n\n<p>The rough plan explained above has checks in between to ensure correct state transitions. Using these state transitions, when exploration is done, we can switch back to ACTIVE_P2P mode and give the goal as home base however this was not demoed at FVD due to lack of testing time, but this was tested successfully in simulation. These state transitions were logged in real time so that the operator knows the current state of the system. This was especially helpful to us during testing.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-dots\" \/>\n\n\n\n<h2 class=\"wp-block-heading has-text-align-center\">Mapping + Motion Planning + Trajectory Generation<\/h2>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"580\" data-id=\"402\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/mapping-1024x580.png\" alt=\"\" class=\"wp-image-402 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/mapping-1024x580.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/mapping-300x170.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/mapping-768x435.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/mapping-750x425.png 750w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/mapping.png 1105w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"598\" data-id=\"404\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/motion_planning-1024x598.png\" alt=\"\" class=\"wp-image-404 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/motion_planning-1024x598.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/motion_planning-300x175.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/motion_planning-768x449.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/motion_planning-750x438.png 750w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/motion_planning.png 1063w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/figure>\n\n\n\n<p>The above three mentioned modules are incorporated by the open source packages that we use for performing two tasks: <strong>Point-to-Point Navigation, <\/strong>and <strong>Exploration<\/strong>. The former allows the user (or firefighter) to give an initial goal to the drone inside the &#8220;dangerous area&#8221;. The P2P module generates a safe trajectory around the obstacles, and minimizes the path length. Once the drone enters the dangerous area and reaches it&#8217;s rough goal, it uses the Exploration module to survey the entire area for hotspots while avoiding obstacles. These modules are explained in depth below along with our modifications to port them into our system<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Point-to-Point Navigation<\/h3>\n\n\n\n<p>To demonstrate a realistic enactment of our use case, we wanted to give a rough goal to the drone inside a &#8220;dangerous area&#8221; where we want the drone to explore, map the environment for hotspots and return this map. To get the drone inside the dangerous area, we looked for an open source implementation capable of autonomous path generation and obstacle avoidance given a goal. <\/p>\n\n\n\n<p>We decided to go with <a href=\"https:\/\/github.com\/Zhefan-Xu\/CERLAB-UAV-Autonomy\" data-type=\"link\" data-id=\"https:\/\/github.com\/Zhefan-Xu\/CERLAB-UAV-Autonomy\">CERLab&#8217;s work<\/a> for navigating in presence of static and dynamic obstacles (we were only interested in static obstacles). This package was easy to setup and run, and our plan was to detach the controller from this package, and use the trajectory generation output and feed the waypoints into our autonomy manager which can then further handle sending these waypoints to PX4&#8217;s inbuilt controller.<\/p>\n\n\n\n<p>After initial tests, a simulation world similar to our testing site at NREC&#8217;s Drone Cage was setup to test this package with a model of the drone (IRIS) with a depth camera plugin, and our autonomy manager. <\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"550\" height=\"446\" data-id=\"847\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/depth.png\" alt=\"\" class=\"wp-image-847 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/depth.png 550w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/depth-300x243.png 300w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><figcaption class=\"wp-element-caption\">Camera plugin in sim<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"540\" height=\"435\" data-id=\"851\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/drone_iris.png\" alt=\"\" class=\"wp-image-851 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/drone_iris.png 540w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/drone_iris-300x242.png 300w\" sizes=\"auto, (max-width: 540px) 100vw, 540px\" \/><figcaption class=\"wp-element-caption\">Early simulation world<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"428\" height=\"272\" data-id=\"890\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/p2pworld.png\" alt=\"\" class=\"wp-image-890 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/p2pworld.png 428w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/p2pworld-300x191.png 300w\" sizes=\"auto, (max-width: 428px) 100vw, 428px\" \/><figcaption class=\"wp-element-caption\">P2P in Simulation<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Exploration<\/h3>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-dots\" \/>\n\n\n\n<h2 class=\"wp-block-heading has-text-align-center\">Controller<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"599\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/controller-1024x599.png\" alt=\"\" class=\"wp-image-405 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/controller-1024x599.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/controller-300x176.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/controller-768x450.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/controller-750x439.png 750w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/controller.png 1054w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Autopilot API<\/h3>\n\n\n\n<figure class=\"wp-block-gallery aligncenter has-nested-images columns-default is-cropped wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"988\" height=\"262\" data-id=\"926\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/unnamed-file-1.png\" alt=\"\" class=\"wp-image-926 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/unnamed-file-1.png 988w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/unnamed-file-1-300x80.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/unnamed-file-1-768x204.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/12\/unnamed-file-1-750x199.png 750w\" sizes=\"auto, (max-width: 988px) 100vw, 988px\" \/><figcaption class=\"wp-element-caption\">Autonomy Architecture<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<p>This is the underlying Python library used Autonomy Manager for interacting with the FCU. This library was developed from scratch. MavrosAPI as the name suggests acts as the Python wrapper around the ROS interface utilities provided by MAVROS. <a href=\"https:\/\/github.com\/mavlink\/mavros\" data-type=\"link\" data-id=\"https:\/\/github.com\/mavlink\/mavros\">MAVROS<\/a> in turn acts as the ROS wrapper for <a href=\"https:\/\/github.com\/mavlink\/mavlink\" data-type=\"link\" data-id=\"https:\/\/github.com\/mavlink\/mavlink\">MAVLink<\/a> communications, enabling control over the PX4 Autopilot functions via MAVLink running over serial.<\/p>\n\n\n\n<p><strong>Some utilities provided by the API library:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Autopilot Failure Monitor<\/strong><\/li>\n\n\n\n<li><strong>Autopilot Arm\/Disarm<\/strong><\/li>\n\n\n\n<li><strong>PX4 Parameter Validation\/Overrides<\/strong><\/li>\n\n\n\n<li><strong>Autopilot Flight Mode Configuration<\/strong><\/li>\n\n\n\n<li><strong>Auto-Takeoff<\/strong><\/li>\n\n\n\n<li><strong>Waypoint Navigation<\/strong><\/li>\n\n\n\n<li><strong>Trajectory Tracking<\/strong><\/li>\n\n\n\n<li><strong>Auto Landing<\/strong><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-dots\" \/>\n\n\n\n<h2 class=\"wp-block-heading has-pale-ocean-gradient-background has-background\">Spring Semester<\/h2>\n\n\n\n<h2 class=\"wp-block-heading has-text-align-center\">Fire Perception<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"612\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/fire_perception-1-1024x612.png\" alt=\"\" class=\"wp-image-398 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/fire_perception-1-1024x612.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/fire_perception-1-300x179.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/fire_perception-1-768x459.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/fire_perception-1-750x448.png 750w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/02\/fire_perception-1.png 1043w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Implementation [Exploration Phase]<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Fire Segmentation<\/strong>: The fire segmentation pipeline processes raw radiometric readings by both left and right cameras, and converts them into easily readable temperature values, typically measured in Celsius.  Following this conversion, a binary segmentation pipeline is used to isolate the fire hotspot region by masking out all pixels below a predetermined threshold value, effectively highlighting the area of interest. Additionally, another pipeline is available to conduct slab-wise segmentation of the temperature map, allowing for a more detailed analysis.<\/li>\n\n\n\n<li><strong>Fire Localization:<\/strong> In the development of the fire localization system, several methods were explored but encountered various challenges. The first approach utilized the OpenCV StereoSGBM module to generate disparity maps from thermal stereo images. This method faced issues with accuracy due to the necessary conversion of 16-bit images to 8-bit, resulting in significant information loss (image smoothing and noisy disparity maps). An enhancement was attempted by performing image processing of the rectified thermal images; however, this improvement yielded minimal enhancement in the feature-matching process. Lastly, a learning-based method using a Fast-ACVnet architecture was trialled, which showed promising results with disparity maps achieving a performance of 13 frames per second. Despite some artefacts, the depth estimation near the ground was reliable, suggesting potential for practical application in fire mapping. Although the results from the learned model were good, this approach can not be used for our application since the space heaters that were used for simulating fire were out of the distribution of the model. Hence the learning-based model produced poor results on our test site. The results for these approaches are attached in the figures attached below.<\/li>\n\n\n\n<li><strong>Fire Mapping<\/strong>: The fire mapping pipeline takes into input the three major upstream subsystems, ie., fire segmentation, fire localization (thermal depth estimation), and VIO, and fuses them to give the locations of the hotspots in the world frame. This is done by first performing clustering of the hotspots in the image plane (using the segmented mask), then projecting these hotspots in the camera frame (3D) using the depth image, and ultimately in the world frame (using VIO).<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-5 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"644\" height=\"594\" data-id=\"747\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/learned_disp1-2.png\" alt=\"\" class=\"wp-image-747 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/learned_disp1-2.png 644w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/learned_disp1-2-300x277.png 300w\" sizes=\"auto, (max-width: 644px) 100vw, 644px\" \/><figcaption class=\"wp-element-caption\">Learning-Based Thermal Stereo<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"780\" height=\"584\" data-id=\"749\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/stereo_sgbm1-1.png\" alt=\"\" class=\"wp-image-749 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/stereo_sgbm1-1.png 780w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/stereo_sgbm1-1-300x225.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/stereo_sgbm1-1-768x575.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/stereo_sgbm1-1-750x562.png 750w\" sizes=\"auto, (max-width: 780px) 100vw, 780px\" \/><figcaption class=\"wp-element-caption\">StereoSGBM<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"778\" height=\"584\" data-id=\"748\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/stereo_sgbm2-1.png\" alt=\"\" class=\"wp-image-748 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/stereo_sgbm2-1.png 778w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/stereo_sgbm2-1-300x225.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/stereo_sgbm2-1-768x576.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/stereo_sgbm2-1-750x563.png 750w\" sizes=\"auto, (max-width: 778px) 100vw, 778px\" \/><figcaption class=\"wp-element-caption\">StereoSGBM<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Implementation [Deployment Phase]<\/h3>\n\n\n\n<p>Under this section we briefly explain the final working pipeline that we went ahead with for our SVD. The high-level steps to calculate the coordinate of the hotspots and append them in a map were as follows<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The feed from left and right thermal camera image are first rectified using cv2&#8217;s stereoRectification funciton using the camera&#8217;s distortion coefficients. <\/li>\n\n\n\n<li>The rectified image is then converted to a temperature based binary image. This is explained in the segmentation technique above.<\/li>\n\n\n\n<li>The mask generated from the temperature mapping is used on the rectified feeds to isolate out the hotspots and their surrounding area.<\/li>\n\n\n\n<li>On these areas, we detect ORB features and compute key-points and descriptors for the same.   <\/li>\n\n\n\n<li>These features are then matched using a Brute-Force matcher and then filtered out using epipolar constraint.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-6 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"481\" data-id=\"677\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/masks-1024x481.png\" alt=\"\" class=\"wp-image-677 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/masks-1024x481.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/masks-300x141.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/masks-768x361.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/masks-750x352.png 750w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/masks.png 1278w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Masks based on Temperature<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"470\" data-id=\"679\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/kps-1024x470.png\" alt=\"\" class=\"wp-image-679 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/kps-1024x470.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/kps-300x138.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/kps-768x353.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/kps-750x344.png 750w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/kps.png 1261w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Matched features<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"479\" data-id=\"680\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/epipolar-1024x479.png\" alt=\"\" class=\"wp-image-680 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/epipolar-1024x479.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/epipolar-300x140.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/epipolar-768x360.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/epipolar-750x351.png 750w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/epipolar.png 1271w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Epipolar Lines<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<p><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Only those matched features are selected, which are closer to the epipolar line of their corresponding match in the other frame.<\/li>\n\n\n\n<li>Using these good matches, we calculate disparity, and eventually depth using the baseline information.<\/li>\n\n\n\n<li>Using proper transformations now we can calculate the 3D coordinate of the hotspot in world frame.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Fire Localization (Global Mapping)<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"938\" height=\"262\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/mapping_architecture.png\" alt=\"\" class=\"wp-image-761 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/mapping_architecture.png 938w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/mapping_architecture-300x84.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/mapping_architecture-768x215.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/mapping_architecture-750x209.png 750w\" sizes=\"auto, (max-width: 938px) 100vw, 938px\" \/><\/figure>\n\n\n\n<p>Our global mapping subsystem handles the temporal side of the fire perception subsystem. The fire perception module provides raw measurements of hotspot locations relative to the world frame. When the fire perception subsystem publishes a new set of measurements, this mapping subsystem is executed as shown in the flowchart above.<\/p>\n\n\n\n<p><strong>Filtering<\/strong>:  Once we receive a hotspot measurement, we first need to filter out the good readings, because most readings are quite noisy. The following are the 2 main filters we employ. Figure below shows the measurements from 2 successful flights (L) and the measurements after filtering (R). The red spots show the ground truth hotspot locations.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"286\" height=\"225\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/mapping_plot1.png\" alt=\"\" class=\"wp-image-758 img-responsive\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"289\" height=\"221\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/05\/mapping_plot2-1.png\" alt=\"\" class=\"wp-image-759 img-responsive\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p><strong>Adding New Hotspot<\/strong>: We then perform nearest neighbor clustering for each hotspot to determine whether it is a measurement for a new or existing one. A new hotspot is created if it exceeds distances from all previously seen hotspots.<\/p>\n\n\n\n<p><strong>Updating Existing Hotspot<\/strong>: If we instead find any measurement corresponding to an existing hotspot, we add it to the existing nearest-neighbor map, and use a mean search to find the updated position of its parent hotspot.<\/p>\n<\/div>\n<\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-dots\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">Implementation<\/h3>\n\n\n\n<p><strong>Multi-Spectral Odometry<\/strong>: is a package we used from Airlab which uses a set of cameras (RGB, Thermal or a combination). The algorithm detects features in the image captured by the cameras, tracks the motion of the features as the robot platform moves and estimates the state using this information. A brief description can be seen in the following slide images:<\/p>\n\n\n\n<p><strong>Frame Transformations:<\/strong> <\/p>\n\n\n\n<p>The MSO odometry data is estimated concerning the primary camera optical frame. For use of this data for autonomous flight with PX4, the estimates need to be transformed to a body-fixed FLU frame (centred at the IMU of the FCU). We incorporated the camera-IMU extrinsic data from Kalibr to perform this transformation.<\/p>\n\n\n\n<p><strong>Indoor hand-held Test:<\/strong> To test the drift and RMSE of the multi-spectral odometry and the IMU propagated odometry, we perform some indoor tests by dragging the Phoenix on a cart around the lab to make a path of more than 100 meters. <\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-3 is-cropped wp-block-gallery-7 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"261\" height=\"463\" data-id=\"554\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/cart3.png\" alt=\"\" class=\"wp-image-554 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/cart3.png 261w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/cart3-169x300.png 169w\" sizes=\"auto, (max-width: 261px) 100vw, 261px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"258\" height=\"461\" data-id=\"556\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/cart1.png\" alt=\"\" class=\"wp-image-556 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/cart1.png 258w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/cart1-168x300.png 168w\" sizes=\"auto, (max-width: 258px) 100vw, 258px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"262\" height=\"460\" data-id=\"555\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/cart2.png\" alt=\"\" class=\"wp-image-555 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/cart2.png 262w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/cart2-171x300.png 171w\" sizes=\"auto, (max-width: 262px) 100vw, 262px\" \/><\/figure>\n<\/figure>\n\n\n\n<hr class=\"wp-block-separator has-text-color has-white-color has-alpha-channel-opacity has-white-background-color has-background\" \/>\n\n\n\n<p>The 100 meter path shows a final drift of less than 1% ( of 0.912m with path length 116.562m ). Note this is using the upward looking camera in the left-front. In the field we would be using the downward facing camera in the front with appropriate mask to hide the landing gear and the sky that shows up around the edge of the fisheye feed due it&#8217;s more than 180 degree fov.<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"1080\" style=\"aspect-ratio: 1920 \/ 1080;\" width=\"1920\" autoplay controls loop muted src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/80ca8ec4-6b78-4fd0-928e-bc90334b7084-2.mp4\"><\/video><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-text-color has-white-color has-alpha-channel-opacity has-white-background-color has-background\" \/>\n\n\n\n<p><strong>Outdoor Flight Test (Hover): <\/strong>(Location: Nardo)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"238\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/IMG_0102-1-1024x238.jpg\" alt=\"\" class=\"wp-image-572 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/IMG_0102-1-1024x238.jpg 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/IMG_0102-1-300x70.jpg 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/IMG_0102-1-768x179.jpg 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/IMG_0102-1-750x175.jpg 750w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/IMG_0102-1.jpg 1500w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>We perform a hover test with the following criteria:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>No pilot input is given to the drone<\/li>\n\n\n\n<li>Less than 0.1 meter drift during the hover period<\/li>\n\n\n\n<li>Hover period should be of more than 5 seconds<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-text-color has-white-color has-alpha-channel-opacity has-white-background-color has-background\" \/>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-8 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"402\" height=\"310\" data-id=\"566\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/var_eclipse.png\" alt=\"\" class=\"wp-image-566 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/var_eclipse.png 402w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/var_eclipse-300x231.png 300w\" sizes=\"auto, (max-width: 402px) 100vw, 402px\" \/><figcaption class=\"wp-element-caption\">Hover regions highlighted<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"743\" height=\"415\" data-id=\"567\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/hover_var.png\" alt=\"\" class=\"wp-image-567 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/hover_var.png 743w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/hover_var-300x168.png 300w\" sizes=\"auto, (max-width: 743px) 100vw, 743px\" \/><figcaption class=\"wp-element-caption\">Hover regions of 26s and 8s<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<hr class=\"wp-block-separator has-text-color has-white-color has-alpha-channel-opacity has-white-background-color has-background is-style-default\" \/>\n\n\n\n<p>Video Link to hover flight footage at Nardo: <a href=\"https:\/\/drive.google.com\/file\/d\/1F5KQ4VgDD9Ojskx4JA-1q7zFz8-oaJRF\/view?usp=drive_link\">https:\/\/drive.google.com\/file\/d\/1F5KQ4VgDD9Ojskx4JA-1q7zFz8-oaJRF\/view?usp=drive_link<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-text-color has-white-color has-alpha-channel-opacity has-white-background-color has-background is-style-default\" \/>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"338\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/IMG_16351-ezgif.com-video-to-gif-converter-1-1-1.gif\" alt=\"\" class=\"wp-image-576 img-responsive\" \/><\/figure>\n<\/div>\n\n\n<hr class=\"wp-block-separator has-text-color has-white-color has-alpha-channel-opacity has-white-background-color has-background\" \/>\n\n\n\n<p><strong>Outdoor Flight Test (Loop): <\/strong>(Location: Nardo)<\/p>\n\n\n\n<p>Loop flight footage: <a href=\"https:\/\/drive.google.com\/file\/d\/115YwKfgc7a4GouLOdBDppV8XkNJJ0_i0\/view?usp=drive_link\">https:\/\/drive.google.com\/file\/d\/115YwKfgc7a4GouLOdBDppV8XkNJJ0_i0\/view?usp=drive_link<\/a><\/p>\n\n\n\n<p>The drone was flown in a loop to evaluate the MSO drift metric in the field when compared to the GPS data. The resulting drift was of around <strong>1.6m<\/strong> for a path length of <strong>105.47m<\/strong>. This satisfies the performance metric that was set ( &lt; 4% drift for a path length of 100m ).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"622\" height=\"332\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/loop.png\" alt=\"\" class=\"wp-image-582 img-responsive\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/loop.png 622w, https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-content\/uploads\/sites\/75\/2024\/04\/loop-300x160.png 300w\" sizes=\"auto, (max-width: 622px) 100vw, 622px\" \/><\/figure>\n<\/div>\n\n\n<hr class=\"wp-block-separator has-text-color has-white-color has-alpha-channel-opacity has-white-background-color has-background\" \/>\n\n\n\n<p><strong>Failsafe Policy for MSO<\/strong>: <\/p>\n\n\n\n<p>As VIO by nature is unreliable in HDR and feature-sparse settings, we always need a failure detection logic to trigger appropriate failover. Some systems use the estimated confidence\/covariance to make this transition. But as our VIO system does not offer such quality metrics, we rely on simple but effective data sanity checks incorporating raw IMU data and kino-dynamic limits of the system.<\/p>\n\n\n\n<p>Having such a failsafe helps us prevent catastrophic loss of the system and\/or lives.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-dots\" \/>\n\n\n\n<h3 class=\"wp-block-heading\"><\/h3>\n","protected":false},"excerpt":{"rendered":"<p>Software CodeBase Our codebase can be found at our GitHub workspace (Running instructions can be found in respective ReadMes): Spring and Fall Semester Implementation The following description about our subsystem implementation is distributed into two broad time periods: the Spring semester and the Fall semester. The fire localization and the state estimation subsystems were of &#8230; <a href=\"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/system-implementation\/software-design\/\" class=\"more-link text-uppercase small\"><strong>Continue Reading<\/strong> <i class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/i><\/a><\/p>\n","protected":false},"author":349,"featured_media":0,"parent":30,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-49","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-json\/wp\/v2\/pages\/49","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-json\/wp\/v2\/users\/349"}],"replies":[{"embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-json\/wp\/v2\/comments?post=49"}],"version-history":[{"count":68,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-json\/wp\/v2\/pages\/49\/revisions"}],"predecessor-version":[{"id":938,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-json\/wp\/v2\/pages\/49\/revisions\/938"}],"up":[{"embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-json\/wp\/v2\/pages\/30"}],"wp:attachment":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2024teamb\/wp-json\/wp\/v2\/media?parent=49"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}