{"id":283,"date":"2023-12-14T00:50:40","date_gmt":"2023-12-14T00:50:40","guid":{"rendered":"https:\/\/ai.seejazzwork.com\/autobots\/?p=283"},"modified":"2023-12-14T00:50:44","modified_gmt":"2023-12-14T00:50:44","slug":"navigating-the-challenges-from-c-to-python","status":"publish","type":"post","link":"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/14\/navigating-the-challenges-from-c-to-python\/","title":{"rendered":"Navigating the Challenges from C++ to Python"},"content":{"rendered":"\n<p>In my last project, I went full on a challenging yet rewarding journey to reimagine our class&#8217;s bug navigation project, originally done in C++, using Python. This project not only pushed my programming skills but also deepened my understanding of robotic control systems.<br><br>My previous experience with the bug navigation project in C++ laid a solid foundation for this Python venture. The core principles of robotic movement and obstacle avoidance remained the same, but the shift to Python introduced new libraries and syntax, offering a more streamlined approach. This transition emphasized the importance of language flexibility in coding and the ability to adapt to different programming environments. But at the same time, the delay python introduces, as a high language class had to be taken into account, when managing the data inflows from the lidar to the wheel movement. <br><br>A significant problem in this project was mastering the PID (Proportional-Integral-Derivative) control to guide the robot smoothly to its destination. Initially, the robot faced issues with orientation, spiraling near the goal instead of stopping. This problem highlighted the intricacies of PID tuning and the delicate balance required for stable control.<br><br>The breakthrough came with guidance from Dr. Wu, who suggested implementing a conditional statement to halt the robot precisely (credits to Dr Jones too for the idea). This adjustment in the code elegantly solved the spiraling issue, demonstrating the power of simple, logical solutions in complex systems. <br><br>Pseudocode for the Conditional Stopping Mechanism<br># PID Control for robot navigation<br>while not at_goal:<br>    error = calculate_error(goal, current_position)<br>    control_signal = PID_controller(error)<br>    send_control_to_robot(control_signal)<br>    <br>    # Conditional to stop the robot from spiraling<br>    if is_near_goal(current_position, goal) and is_oriented_correctly(current_orientation, goal_orientation):<br>        stop_robot()<br>        break<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/share.icloud.com\/photos\/0dfPLlktdyf2OBKbjW2Y_9TWg\"><\/video><\/figure>\n\n\n\n<p>Here is the robot running:<\/p>\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\"><\/figure>\n\n\n\n<p><br><br>This pseudocode represents the logic behind the implemented solution. The `is_near_goal` and `is_oriented_correctly` functions check the robot&#8217;s position and orientation relative to the goal, triggering the `stop_robot` function to prevent the spiraling issue.<br><br>Reflecting on this project, I learned the importance of persistence and creative problem-solving in programming. Challenges like the PID control issue are not just obstacles but opportunities to deepen understanding and refine skills. This experience has been invaluable in my growth as a programmer and a robotics enthusiast.<br><br>Looking ahead, I aim to explore more advanced navigation algorithms and perhaps integrate machine learning techniques for more dynamic and intelligent robot behavior maybe in future projects, in grad school. The journey from C++ to Python was just the beginning, and I am excited to see where this path leads.<br><\/p>\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\"><\/figure>\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\"><\/figure>\n\n\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex\"><\/figure>\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\"><\/figure>\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\"><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>In my last project, I went full on a challenging yet rewarding journey to reimagine our class&#8217;s bug navigation project, originally done in C++, using Python. This project not only pushed my&#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-283","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>Navigating the Challenges from C++ to Python - 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\/14\/navigating-the-challenges-from-c-to-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Navigating the Challenges from C++ to Python - Autonomous Systems\" \/>\n<meta property=\"og:description\" content=\"In my last project, I went full on a challenging yet rewarding journey to reimagine our class&#8217;s bug navigation project, originally done in C++, using Python. This project not only pushed my...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/14\/navigating-the-challenges-from-c-to-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Autonomous Systems\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-14T00:50:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-14T00:50:44+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=\"2 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\\\/14\\\/navigating-the-challenges-from-c-to-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/blog\\\/2023\\\/12\\\/14\\\/navigating-the-challenges-from-c-to-python\\\/\"},\"author\":{\"name\":\"dimitrios\",\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/#\\\/schema\\\/person\\\/3bf350aae0f80fc0e5a5d4766bece72d\"},\"headline\":\"Navigating the Challenges from C++ to Python\",\"datePublished\":\"2023-12-14T00:50:40+00:00\",\"dateModified\":\"2023-12-14T00:50:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/blog\\\/2023\\\/12\\\/14\\\/navigating-the-challenges-from-c-to-python\\\/\"},\"wordCount\":442,\"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\\\/14\\\/navigating-the-challenges-from-c-to-python\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/blog\\\/2023\\\/12\\\/14\\\/navigating-the-challenges-from-c-to-python\\\/\",\"url\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/blog\\\/2023\\\/12\\\/14\\\/navigating-the-challenges-from-c-to-python\\\/\",\"name\":\"Navigating the Challenges from C++ to Python - Autonomous Systems\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/#website\"},\"datePublished\":\"2023-12-14T00:50:40+00:00\",\"dateModified\":\"2023-12-14T00:50:44+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/blog\\\/2023\\\/12\\\/14\\\/navigating-the-challenges-from-c-to-python\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/blog\\\/2023\\\/12\\\/14\\\/navigating-the-challenges-from-c-to-python\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/blog\\\/2023\\\/12\\\/14\\\/navigating-the-challenges-from-c-to-python\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ai.seejazzwork.com\\\/autobots\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Navigating the Challenges from C++ to Python\"}]},{\"@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":"Navigating the Challenges from C++ to Python - 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\/14\/navigating-the-challenges-from-c-to-python\/","og_locale":"en_US","og_type":"article","og_title":"Navigating the Challenges from C++ to Python - Autonomous Systems","og_description":"In my last project, I went full on a challenging yet rewarding journey to reimagine our class&#8217;s bug navigation project, originally done in C++, using Python. This project not only pushed my...","og_url":"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/14\/navigating-the-challenges-from-c-to-python\/","og_site_name":"Autonomous Systems","article_published_time":"2023-12-14T00:50:40+00:00","article_modified_time":"2023-12-14T00:50:44+00:00","author":"dimitrios","twitter_card":"summary_large_image","twitter_misc":{"Written by":"dimitrios","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/14\/navigating-the-challenges-from-c-to-python\/#article","isPartOf":{"@id":"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/14\/navigating-the-challenges-from-c-to-python\/"},"author":{"name":"dimitrios","@id":"https:\/\/ai.seejazzwork.com\/autobots\/#\/schema\/person\/3bf350aae0f80fc0e5a5d4766bece72d"},"headline":"Navigating the Challenges from C++ to Python","datePublished":"2023-12-14T00:50:40+00:00","dateModified":"2023-12-14T00:50:44+00:00","mainEntityOfPage":{"@id":"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/14\/navigating-the-challenges-from-c-to-python\/"},"wordCount":442,"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\/14\/navigating-the-challenges-from-c-to-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/14\/navigating-the-challenges-from-c-to-python\/","url":"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/14\/navigating-the-challenges-from-c-to-python\/","name":"Navigating the Challenges from C++ to Python - Autonomous Systems","isPartOf":{"@id":"https:\/\/ai.seejazzwork.com\/autobots\/#website"},"datePublished":"2023-12-14T00:50:40+00:00","dateModified":"2023-12-14T00:50:44+00:00","breadcrumb":{"@id":"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/14\/navigating-the-challenges-from-c-to-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/14\/navigating-the-challenges-from-c-to-python\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/ai.seejazzwork.com\/autobots\/blog\/2023\/12\/14\/navigating-the-challenges-from-c-to-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ai.seejazzwork.com\/autobots\/"},{"@type":"ListItem","position":2,"name":"Navigating the Challenges from C++ to Python"}]},{"@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\/283","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=283"}],"version-history":[{"count":2,"href":"https:\/\/ai.seejazzwork.com\/autobots\/wp-json\/wp\/v2\/posts\/283\/revisions"}],"predecessor-version":[{"id":319,"href":"https:\/\/ai.seejazzwork.com\/autobots\/wp-json\/wp\/v2\/posts\/283\/revisions\/319"}],"wp:attachment":[{"href":"https:\/\/ai.seejazzwork.com\/autobots\/wp-json\/wp\/v2\/media?parent=283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.seejazzwork.com\/autobots\/wp-json\/wp\/v2\/categories?post=283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.seejazzwork.com\/autobots\/wp-json\/wp\/v2\/tags?post=283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}