{"id":754,"date":"2024-07-29T18:19:15","date_gmt":"2024-07-29T18:19:15","guid":{"rendered":"https:\/\/commons.mtholyoke.edu\/roselab\/?p=754"},"modified":"2024-07-29T18:19:15","modified_gmt":"2024-07-29T18:19:15","slug":"danielles-week-7-progress","status":"publish","type":"post","link":"https:\/\/commons.mtholyoke.edu\/roselab\/2024\/07\/29\/danielles-week-7-progress\/","title":{"rendered":"Danielle&#8217;s week 7 progress"},"content":{"rendered":"\n<p class=\"has-medium-font-size wp-block-paragraph\">Week 7: Braitenberg exercise, gym-duckietown simulation<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong><em>07\/22\/2024<\/em><\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">Today, I decided to tackle the braitenberg issue once more. I have updated the connections.py file and run &#8220;dts code workbench &#8211;sim&#8221; but when I try to open the simulator, I get a &#8220;<strong>site can&#8217;t be reached<\/strong>&#8221; error. This has happened a couple times. I have tried to change some values for the const and gain variables but that just prematurely stops my command from running in the terminal with an error saying &#8220;<strong>input channel not ready after 3 seconds. Will retry<\/strong>&#8221; and it just stops. I am trying to first work with the same values for const and gain variable in agent.py and then adding a few more tweaks to connections.py to see if it will work.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong><em>7\/23\/2024<\/em><\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">The braitenberg exercise is perhaps a bit more complicated than intended. We are supposed to tweak the values in the connections.py file but it is a bit strange since you will have to keep testing out numbers until it works and there are a lot of possibilities. I was able to figure out some specific numbers that worked and that did the trick but they are constants and will forever produce the same result. I did not change values for const and gain in agent.py because when I did that, I got an error. Tweaking just the connections.py file will get the simulator running for now.  When you run the command, you should see something like this: <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"120\" src=\"https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-11.54.57\u202fAM-1024x120.png\" alt=\"\" class=\"wp-image-772\" style=\"aspect-ratio:8.533333333333333;width:840px;height:auto\" srcset=\"https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-11.54.57\u202fAM-1024x120.png 1024w, https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-11.54.57\u202fAM-300x35.png 300w, https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-11.54.57\u202fAM-768x90.png 768w, https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-11.54.57\u202fAM.png 1062w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">and with this you should immediately click the link which will take you to a site where the simulation will begin to work. It will look like this(left side) and after a while it will look like this(right side) when the duckiebot comes into contact with a duck. This is because it crashes and this is where I get the &#8220;<strong>site can&#8217;t be reached<\/strong>&#8221; error. I  have to keep fine tuning the numbers in the connections.py file to make sure it runs longer.  <\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 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-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"546\" src=\"https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-11.54.49\u202fAM-1-1024x546.png\" alt=\"\" class=\"wp-image-774\" srcset=\"https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-11.54.49\u202fAM-1-1024x546.png 1024w, https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-11.54.49\u202fAM-1-300x160.png 300w, https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-11.54.49\u202fAM-1-768x409.png 768w, https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-11.54.49\u202fAM-1.png 1066w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/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 is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"826\" height=\"428\" src=\"https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-12.22.43\u202fPM.png\" alt=\"\" class=\"wp-image-775\" style=\"aspect-ratio:1.9299065420560748;width:436px;height:auto\" srcset=\"https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-12.22.43\u202fPM.png 826w, https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-12.22.43\u202fPM-300x155.png 300w, https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-12.22.43\u202fPM-768x398.png 768w\" sizes=\"auto, (max-width: 826px) 100vw, 826px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">I have tried running the code on skyduck as well as suggested in the READme of the braitenberg exercise and it seems to work with skyduck but I did not have enough ducks in the way to see If it was going to actually try to avoid them. I started of with just 1 duck and skyduck kept going in circles but when I increased the number of ducks around skyduck to 4, it seemed to swerve one duck but I need to have the more ducks laid out like the image above and then run the workbench once more to see if it actually works. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong><em>7\/24\/2024<\/em><\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">Today, I am working on making the gym-duckietown simulation work.  It took a lot of steps and thanks to my lab mate who was able to figure out that some code related to numpy was outdated so it was changed and now I have been able to run the simulator and move around with the arrow keys. <\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">The steps needed are:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li class=\"has-medium-font-size\">Go to duckietown <a href=\"https:\/\/docs.duckietown.com\/ente\/devmanual-software\/intermediate\/simulation\/index.html\">simulation<\/a> and then follow the steps to create a new environment in simulation<\/li>\n\n\n\n<li class=\"has-medium-font-size\">cd into gym-duckietown<\/li>\n\n\n\n<li class=\"has-medium-font-size\">Activate the environment<\/li>\n\n\n\n<li class=\"has-medium-font-size\">Switch branch from daffy to master<\/li>\n\n\n\n<li class=\"has-medium-font-size\">Install pillow and downgrade pyglet from current version to 1.5.11(it is more stable for now)<\/li>\n\n\n\n<li class=\"has-medium-font-size\">Hopefully the simulator.py file will be updated and you would not need to make changes to it like I did<\/li>\n\n\n\n<li class=\"has-medium-font-size\">Now you can proceed to making the python file as instructed in the simulation document and then moving in the simulation<\/li>\n<\/ol>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">You should have an output like this and then you can use your arrow keys to move around.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 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=\"544\" height=\"708\" src=\"https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-1.46.04\u202fPM.png\" alt=\"\" class=\"wp-image-777\" srcset=\"https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-1.46.04\u202fPM.png 544w, https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-1.46.04\u202fPM-231x300.png 231w\" sizes=\"auto, (max-width: 544px) 100vw, 544px\" \/><\/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-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"780\" src=\"https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-1.46.20\u202fPM-1024x780.png\" alt=\"\" class=\"wp-image-778\" srcset=\"https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-1.46.20\u202fPM-1024x780.png 1024w, https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-1.46.20\u202fPM-300x228.png 300w, https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-1.46.20\u202fPM-768x585.png 768w, https:\/\/commons.mtholyoke.edu\/roselab\/wp-content\/uploads\/sites\/953\/2024\/07\/Screenshot-2024-07-24-at-1.46.20\u202fPM.png 1064w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">Now that I have been able to run the simulation, the next step is to go through the developer manual and the code on the gym duckietown GitHub to get a better understanding of what exactly is available and what I need to do next.  Start and goal for the environment? so the precomputed thing. do eDx for planning and do work on the simulator(8 and 9 planning strategy). plan a robot with 6 degrees of freedom(front and back and rotation). when you create a sample, it should be for all the agents but you are just using 1.  guide decoupled algorithms<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">Today we also had our reviews with Diane about the papers we read and the paper I read was very interesting  &#8211; &nbsp;<a href=\"https:\/\/docs.google.com\/document\/u\/0\/d\/1usaAh4V63roMVgSq8UYLoOVt5BQUM9gD7lsG1PY8pws\/edit\">A Complete Algorithm for a Moving Target Traveling Salesman Problem with Obstacles<\/a> &#8211; and what amazed me about this paper was that it was the first of it&#8217;s kind in terms of a complete algorithm which was evident in the experiments and the video showing the experiment.  After we discussed our goals for the following week which is to implement and run a planning strategy in the simulation and on the duckiebot. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong><em>7\/25\/2024<\/em><\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">I am not giving up on the braitenberg exercise. I realized that I did the preprocessing in the braitenberg exercise two wrong. I had to outline the duck but I outlined the nose only and everything else was black.  I reckon that may have been the reason why my agent kept crashing in the first few seconds or why I had the &#8220;site not found&#8221; error because it crashes right when the simulation starts.  I re-did the preprocessing.py file where I adjusted the HSV values and also the methods in the connections.py file for the left and right motors and that it seems to be working a bit better now. Adjusting the const and gain values in agent.py is also helping with the movement of the agent which is good but still a bit tricky since the simulation changes everything and does not work as perfectly even with the constant tuning to the values.  I have submitted this exercise after working on some more fine tuning for the const and gain values in agent.py<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">I also started the edX course chapter 7 which delves into <strong>planning I <\/strong>and I am hoping to do the exercise that comes with it. This chapter and the next chapter which is <strong>planning II <\/strong>will help with the goal of having the simulation running and having a start and goal for the duckiebot to be directed to. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong><em>7\/26\/2024<\/em><\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">Today, I finished watching the <strong>planning I<\/strong> video and I have moved on to the exercise. For this exercise, we are to check if a robot collides with an obstacle(the environment). This involves decomposing the idea into smaller bits. If a part of the robot collides with the environment then it means that the robot as a whole has collided with the environment and false otherwise. The exercise aims to introduce us to how planning is achieved for motion planning and so far, I understand the concept and moving on to the implementation of the code. Unfortunately, there is no simulator for me to check if what I have is right or is even heading into the right direction :(.  Checking for a collision between rectangle and rectangle where one is the environment and the other is the robot has proven to be very difficult. There are many surfaces the rectangle can have &#8211; left, right, up, down and the corners so I had to implement methods to cater for those. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Week 7: Braitenberg exercise, gym-duckietown simulation 07\/22\/2024 Today, I decided to tackle the braitenberg issue once more. I have updated the connections.py file and run &#8220;dts code workbench &#8211;sim&#8221; but when I try to open the simulator, I get a &#8220;site can&#8217;t be reached&#8221; error. This has happened a couple times. I have tried to&hellip;<\/p>\n","protected":false},"author":2578,"featured_media":778,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[17],"tags":[],"class_list":["post-754","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-danielle-quaye"],"_links":{"self":[{"href":"https:\/\/commons.mtholyoke.edu\/roselab\/wp-json\/wp\/v2\/posts\/754","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/commons.mtholyoke.edu\/roselab\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/commons.mtholyoke.edu\/roselab\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/commons.mtholyoke.edu\/roselab\/wp-json\/wp\/v2\/users\/2578"}],"replies":[{"embeddable":true,"href":"https:\/\/commons.mtholyoke.edu\/roselab\/wp-json\/wp\/v2\/comments?post=754"}],"version-history":[{"count":14,"href":"https:\/\/commons.mtholyoke.edu\/roselab\/wp-json\/wp\/v2\/posts\/754\/revisions"}],"predecessor-version":[{"id":805,"href":"https:\/\/commons.mtholyoke.edu\/roselab\/wp-json\/wp\/v2\/posts\/754\/revisions\/805"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/commons.mtholyoke.edu\/roselab\/wp-json\/wp\/v2\/media\/778"}],"wp:attachment":[{"href":"https:\/\/commons.mtholyoke.edu\/roselab\/wp-json\/wp\/v2\/media?parent=754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/commons.mtholyoke.edu\/roselab\/wp-json\/wp\/v2\/categories?post=754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/commons.mtholyoke.edu\/roselab\/wp-json\/wp\/v2\/tags?post=754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}