{"id":279,"date":"2023-12-08T20:18:59","date_gmt":"2023-12-08T20:18:59","guid":{"rendered":"https:\/\/ai.seejazzwork.com\/autobots\/?p=279"},"modified":"2023-12-08T20:19:03","modified_gmt":"2023-12-08T20:19:03","slug":"bfs-maze-planning-and-slam","status":"publish","type":"post","link":"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/08\/bfs-maze-planning-and-slam\/","title":{"rendered":"BFS maze planning and Slam"},"content":{"rendered":"Hello, fellow tech enthusiasts. Having finally completed this project, I look back with pride, and with a little bit of more faith in my abilities and in making theory practice.<br \/><br \/><br \/>SLAM stands for Simultaneous Localization and Mapping. In this project, SLAM was like the backbone, enabling our robot to understand and navigate its environment. SLAM involves creating a map of an unknown environment while simultaneously tracking the robot&#8217;s location within that map. It&#8217;s like being blindfolded in a room and having to both map out the room and pinpoint your location within it.<br \/><br \/>The core of this project was to implement a path planning algorithm, using the mBot as our test subject, so from theory to practice. Path planning is essentially the robot&#8217;s brain figuring out how to get from point A to point B without bumping into obstacles. <br \/><br \/>First, we used a Grid Graph, a data structure to represent the map. Think of it like a chessboard, where each square is a potential spot for mBot to move. Next, we taught mBot to identify its &#8216;neighbors&#8217; &#8211; the squares it can move to from its current location. We used the BFS algorithm to explore the map. BFS is like casting a net wider and wider from the starting point, checking each square systematically until the goal is reached. Before letting mBot loose, I tested my algorithm on the webapp API by Michigan, which was great for saving us time and troubleshooting. Finally, I uploaded our code to mBot and watched in happiness as it navigated around our makeshift obstacle course (of course not with the first try!).<br \/><br \/>For path planning, iexperimented with two algorithms: BFS and A*. BFS is straightforward; it doesn&#8217;t consider the goal&#8217;s location until it finds it by exploring all possible paths. A*, on the other hand, is more like a homing missile; it considers the goal&#8217;s location right from the start, making it faster and more efficient. <br \/><br \/>Pseudocode for BFS<br \/><br \/>function BFS(start, goal)<br \/>  initialize queue with start node<br \/>  while queue is not empty<br \/>    current = dequeue()<br \/>    if current is goal<br \/>      return success<br \/>    for each neighbor of current<br \/>      if neighbor is not visited<br \/>        mark neighbor as visited<br \/>        enqueue neighbor<br \/>  return failure<br \/><br \/><br \/><br \/><br \/>The mbot, plans the entire path before moving. This makes it Efficient and less prone to getting stuck. But it needs a map beforehand and struggles with dynamic changes in the environment.<br \/>It also reacts to obstacles as they appear.But something that happened once is that it got stuck in &#8220;dead ends.&#8221; once or twice.<br \/><br \/>This project was a blend of frustration and excitement. The biggest challenge was debugging. Sometimes mBot would stubbornly crash into a wall, other times it would spin in circles, lost and confused. Each bug fixed was a mini-win :). Through trial and error, I learned the importance of precise calculations and the value of patience in coding.<br \/><br \/>Transforming theory into practice with mBot was an unforgettable journey. It gave me a new appreciation for the complexity behind seemingly simple navigational tasks. This project was not just about programming a robot; it was about problem-solving, perseverance, and the joy of seeing your code come to life.","protected":false},"excerpt":{"rendered":"<p>Hello, fellow tech enthusiasts. Having finally completed this project, I look back with pride, and with a little bit of more faith in my abilities and in making theory practice. SLAM stands&#8230;<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-279","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>BFS maze planning and Slam - Autonomous Systems<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/08\/bfs-maze-planning-and-slam\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"BFS maze planning and Slam - Autonomous Systems\" \/>\n<meta property=\"og:description\" content=\"Hello, fellow tech enthusiasts. Having finally completed this project, I look back with pride, and with a little bit of more faith in my abilities and in making theory practice. SLAM stands...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/08\/bfs-maze-planning-and-slam\/\" \/>\n<meta property=\"og:site_name\" content=\"Autonomous Systems\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-08T20:18:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-08T20:19:03+00:00\" \/>\n<meta name=\"author\" content=\"dimitrios\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"dimitrios\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/blog\\\/2023\\\/12\\\/08\\\/bfs-maze-planning-and-slam\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/blog\\\/2023\\\/12\\\/08\\\/bfs-maze-planning-and-slam\\\/\"},\"author\":{\"name\":\"dimitrios\",\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/#\\\/schema\\\/person\\\/3bf350aae0f80fc0e5a5d4766bece72d\"},\"headline\":\"BFS maze planning and Slam\",\"datePublished\":\"2023-12-08T20:18:59+00:00\",\"dateModified\":\"2023-12-08T20:19:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/blog\\\/2023\\\/12\\\/08\\\/bfs-maze-planning-and-slam\\\/\"},\"wordCount\":536,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/#organization\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/blog\\\/2023\\\/12\\\/08\\\/bfs-maze-planning-and-slam\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/blog\\\/2023\\\/12\\\/08\\\/bfs-maze-planning-and-slam\\\/\",\"url\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/blog\\\/2023\\\/12\\\/08\\\/bfs-maze-planning-and-slam\\\/\",\"name\":\"BFS maze planning and Slam - Autonomous Systems\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/#website\"},\"datePublished\":\"2023-12-08T20:18:59+00:00\",\"dateModified\":\"2023-12-08T20:19:03+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/blog\\\/2023\\\/12\\\/08\\\/bfs-maze-planning-and-slam\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/blog\\\/2023\\\/12\\\/08\\\/bfs-maze-planning-and-slam\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/blog\\\/2023\\\/12\\\/08\\\/bfs-maze-planning-and-slam\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"BFS maze planning and Slam\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/#website\",\"url\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/\",\"name\":\"AI and Autonomous Systems Class\",\"description\":\"AI, Algorithms, Robotics (HelloRob | Berea College)\",\"publisher\":{\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/#organization\",\"name\":\"Berea College Computer Science\",\"url\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/mbot-omni.jpg\",\"contentUrl\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/mbot-omni.jpg\",\"width\":603,\"height\":751,\"caption\":\"Berea College Computer Science\"},\"image\":{\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/#\\\/schema\\\/person\\\/3bf350aae0f80fc0e5a5d4766bece72d\",\"name\":\"dimitrios\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7a9e774f05354bd665153595ae5c83e2480b29a171c0de1e3f918ce73c543dcf?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7a9e774f05354bd665153595ae5c83e2480b29a171c0de1e3f918ce73c543dcf?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7a9e774f05354bd665153595ae5c83e2480b29a171c0de1e3f918ce73c543dcf?s=96&d=mm&r=g\",\"caption\":\"dimitrios\"},\"url\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/blog\\\/author\\\/dimitrios\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"BFS maze planning and Slam - Autonomous Systems","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/08\/bfs-maze-planning-and-slam\/","og_locale":"en_US","og_type":"article","og_title":"BFS maze planning and Slam - Autonomous Systems","og_description":"Hello, fellow tech enthusiasts. Having finally completed this project, I look back with pride, and with a little bit of more faith in my abilities and in making theory practice. SLAM stands...","og_url":"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/08\/bfs-maze-planning-and-slam\/","og_site_name":"Autonomous Systems","article_published_time":"2023-12-08T20:18:59+00:00","article_modified_time":"2023-12-08T20:19:03+00:00","author":"dimitrios","twitter_card":"summary_large_image","twitter_misc":{"Written by":"dimitrios","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/08\/bfs-maze-planning-and-slam\/#article","isPartOf":{"@id":"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/08\/bfs-maze-planning-and-slam\/"},"author":{"name":"dimitrios","@id":"https:\/\/ai.seejazzwork.com\/autobots\/#\/schema\/person\/3bf350aae0f80fc0e5a5d4766bece72d"},"headline":"BFS maze planning and Slam","datePublished":"2023-12-08T20:18:59+00:00","dateModified":"2023-12-08T20:19:03+00:00","mainEntityOfPage":{"@id":"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/08\/bfs-maze-planning-and-slam\/"},"wordCount":536,"commentCount":0,"publisher":{"@id":"https:\/\/ai.seejazzwork.com\/autobots\/#organization"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/08\/bfs-maze-planning-and-slam\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/08\/bfs-maze-planning-and-slam\/","url":"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/08\/bfs-maze-planning-and-slam\/","name":"BFS maze planning and Slam - Autonomous Systems","isPartOf":{"@id":"https:\/\/ai.seejazzwork.com\/autobots\/#website"},"datePublished":"2023-12-08T20:18:59+00:00","dateModified":"2023-12-08T20:19:03+00:00","breadcrumb":{"@id":"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/08\/bfs-maze-planning-and-slam\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/08\/bfs-maze-planning-and-slam\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/08\/bfs-maze-planning-and-slam\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ai.seejazzwork.com\/autobots\/"},{"@type":"ListItem","position":2,"name":"BFS maze planning and Slam"}]},{"@type":"WebSite","@id":"https:\/\/ai.seejazzwork.com\/autobots\/#website","url":"https:\/\/ai.seejazzwork.com\/autobots\/","name":"AI and Autonomous Systems Class","description":"AI, Algorithms, Robotics (HelloRob | Berea College)","publisher":{"@id":"https:\/\/ai.seejazzwork.com\/autobots\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ai.seejazzwork.com\/autobots\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ai.seejazzwork.com\/autobots\/#organization","name":"Berea College Computer Science","url":"https:\/\/ai.seejazzwork.com\/autobots\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ai.seejazzwork.com\/autobots\/#\/schema\/logo\/image\/","url":"https:\/\/ai.seejazzwork.com\/autobots\/wp-content\/uploads\/2023\/08\/mbot-omni.jpg","contentUrl":"https:\/\/ai.seejazzwork.com\/autobots\/wp-content\/uploads\/2023\/08\/mbot-omni.jpg","width":603,"height":751,"caption":"Berea College Computer Science"},"image":{"@id":"https:\/\/ai.seejazzwork.com\/autobots\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/ai.seejazzwork.com\/autobots\/#\/schema\/person\/3bf350aae0f80fc0e5a5d4766bece72d","name":"dimitrios","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/7a9e774f05354bd665153595ae5c83e2480b29a171c0de1e3f918ce73c543dcf?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/7a9e774f05354bd665153595ae5c83e2480b29a171c0de1e3f918ce73c543dcf?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7a9e774f05354bd665153595ae5c83e2480b29a171c0de1e3f918ce73c543dcf?s=96&d=mm&r=g","caption":"dimitrios"},"url":"https:\/\/ai.seejazzwork.com\/autobots\/blog\/author\/dimitrios\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ai.seejazzwork.com\/autobots\/wp-json\/wp\/v2\/posts\/279","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ai.seejazzwork.com\/autobots\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ai.seejazzwork.com\/autobots\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ai.seejazzwork.com\/autobots\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/ai.seejazzwork.com\/autobots\/wp-json\/wp\/v2\/comments?post=279"}],"version-history":[{"count":1,"href":"https:\/\/ai.seejazzwork.com\/autobots\/wp-json\/wp\/v2\/posts\/279\/revisions"}],"predecessor-version":[{"id":282,"href":"https:\/\/ai.seejazzwork.com\/autobots\/wp-json\/wp\/v2\/posts\/279\/revisions\/282"}],"wp:attachment":[{"href":"https:\/\/ai.seejazzwork.com\/autobots\/wp-json\/wp\/v2\/media?parent=279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.seejazzwork.com\/autobots\/wp-json\/wp\/v2\/categories?post=279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.seejazzwork.com\/autobots\/wp-json\/wp\/v2\/tags?post=279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}