{"id":4926,"date":"2020-12-10T17:54:57","date_gmt":"2020-12-10T16:54:57","guid":{"rendered":"http:\/\/dronesonen.usn.no\/?p=4926"},"modified":"2020-12-10T17:59:13","modified_gmt":"2020-12-10T16:59:13","slug":"sprint-13","status":"publish","type":"post","link":"https:\/\/dronesonen.usn.no\/?p=4926","title":{"rendered":"Sprint 13"},"content":{"rendered":"\n<p><strong>Felles:<\/strong><\/p>\n\n\n\n<p>During this final week we are working to get the robot arm up and running. We\u2019ve encountered a problem with a lack of servo motors required for the arm to be fully functional. The servos we needed were \u201cTowerPro MG968\u201d and unfortunately they weren\u2019t available at campus. Luckily, we got a recommendation to visit a shop in Drammen called \u201cHobbymannen\u201d, and we were able to purchase some servos there. Furthermore, the hardware we require for the project to be fully operational is not available, so we have to make some changes.<\/p>\n\n\n\n<p><strong>Maskin (Simen):<\/strong><br><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/X3rTwRSdViLt_PqDCCg2dduXmMuTj5rHs6kG6DVDsAuPhgu0e3ghm8YZpkU_2ixQFEGRVfbZXw_V1R3O_IbFeSFxF0MpXtintXyrBnPf_GCCduTjGaxcF5Hlg1VJJZaur2EWzaEO\" alt=\"\" \/><\/figure>\n\n\n\n<p>After some setbacks with the servos needed, we had to make do with what we could get our hands on. As of right now, the arm is mostly functional. The parts are at the moment a mix between stiff and heavy, although a bit too heavy for the servos we had to make use of, but with the time left, optimization will not be significant enough in time for the presentation.<br><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/-NpPy0cNBRMii7lt_3kxb7-0J42jS57nj8o5xD3hFIikY_7VDYIgSrWjzPmQPYZ98CXtz5pK9EGENkp5YMwJW3tFUF8gORjEBoZcQkdtnK9pktDDDkI1PUKv6fuUcUfD_Om5Lan7\" alt=\"\" \/><\/figure>\n\n\n\n<p>An example of optimization being initialized by the use of Topology studies in Solidworks.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/tVUTQr6Tco5AgOZPwDJLtENvQsI0jKBQ7Ya_5EG1GKmGXaAntkFTDtPUzPpE4tltw-xURgtpwxOC7lGmaRdt07NEHOpg9ZCcusszDRkvYQCJBQoJxc1wAojvfuC-5yS36rZ56E2r\" alt=\"\" \/><\/figure>\n\n\n\n<p>In hindsight I should not have relied on the school\u2019s servos, and instead ordered my own.<\/p>\n\n\n\n<p>When attempting to print the remaining parts for the video, I could not get it from the school, so I had to pull some strings and got help from classmates, so the parts were finished right before the recording of the video.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/MqV_8dCvtdpmPOYBEUqyQAYuQ8Ug7uXLZO4v608QxOeAQxZqe_nQbY-DDi-etf9c631HpZ80L9OBtcjZ5SS1CEwIXEQSGLl-pE-bUbIUdbvedwGUDFunieUGq35JrV7ydQGKIEj6\" alt=\"\" width=\"543\" height=\"346\" \/><\/figure>\n\n\n\n<p><strong>Elektro (Sondre):&nbsp;<\/strong><\/p>\n\n\n\n<p>During these final days before everything has to be ready, I have been connecting everything for the card shuffler machine. In the picture below we can see the original wiring of the DC motors inside the card shuffler.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/JbKQSxkXQUrN9SKHO7B_6jD5gThV9R-ulNvmzmEb3vHfd7JeBEF7KlFjS9f9sTt6e9GSeIjPKrjIzOVOFWVLES9LAXSPKMl5sg67BBGk_vBt1FKFFGpOaqb1mZ62UqpQcvmt9Ha4\" alt=\"\" \/><\/figure>\n\n\n\n<p>Almost every wire inside the machine is connected to the battery power supply and feedback between the motors, so I got rid of all of them and simply connected 2 wires to each motor and fed the wires into the DC motor driver after some soldering. After everything was connected and ready to go I put everything back together and wrote a quick and easy script for the Arduino to test it, and the result can be seen down below.&nbsp;<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/OV50fsanmmvIsYPf0UtzBTtRxWYMf_LabFvx-zL-zp_xtqHrCbOoJz85TFPPmI122MCmeZXLB3CpEIXDYwNWyQGRdnf0HKT0ifJe1bhxPl5JsLROoJn817_yAuoz-1polfv3M2IE\" alt=\"\" \/><\/figure><\/div>\n\n\n\n<p>Right now the shuffling isn\u2019t too accurate and sometimes shuffles two cards at a time, but hopefully with some tweaking the shuffler is more accurate. One of the problems with the machine is that the wheels that spin the card out to the camera detection chamber aren\u2019t symmetrical at all, so that it sometimes spins out one card, and other times two cards. If there is enough time then I\u2019ll see if I can \u2018straighten\u2019 the wheels a bit.&nbsp;<\/p>\n\n\n\n<p>Utilizing the same DC motor driver as the card shuffler, I connected a small but powerful DC motor to a new driver. This motor is the one that will push out the cards from the robotic arm when it is dealing out cards to the players.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/6aMpS6ZIGkn3QCLXjclOJzgH3nWzuHS1nqaVMJn4i_lmvlD6wyGJJ6rfzsnDxn27_zpHA1dR5MOgdlNlUF6UzM0vVDF6sGuobhmZeZ23or-l4KRhaVjgzMcu_ALsH_NYxhLzJVAx\" alt=\"\" width=\"400\" height=\"180\" \/><\/figure><\/div>\n\n\n\n<p>Moving on to another subject, we sadly didn\u2019t incorporate the use of SPI with our system. The reason is that since we are using ROS with an Arduino to control the motors, the communication between the Arduino and Raspberry Pi would be too complex with the use of ROS if we decided to communicate between the devices utilizing SPI. From an electrical engineers point of view I wish we had the time to use SPI as our means of communication between devices because I think that there would be more work split between the members of our group such that we could cooperate more than we have done.<\/p>\n\n\n\n<p><strong>Data (Danial):<\/strong><\/p>\n\n\n\n<p>When the group first chose an arm to hand out cards, I thought it was completely impossible, but we took the challenge. During the whole process, we have been good at distributing tasks and have come a long way on our project. I think we have all learned different things that we can take further in our education. Now I see that we have come a long way and have a project that is almost completed. We made several of the components that our system consisted of and adapted them. Now that we have finished this process, we have learned a lot. I have had the pleasure of getting to know more about the code world and not least ROS. ROS is an ingenious system that is used by countless developers on a daily basis. There are constantly new upgrades that allow the system to maintain efficiency and increase functionality. I have learned how to use this system and how to set it up, as I have done this twice since my computer would not cooperate with the World Cup. VM can be a challenge to run on a Mac as different accesses are required, this I experienced both when I had to connect to an arduino and when I had to update the PC. This past week I have not done much more with the code, I have only waited to get the arm so I could add the correct values \u200b\u200bgiven which way we wanted to move the arm in. My main task was then delayed since the arm was not finished within the time.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/UiNwbuhY58NbEy4XPDjjzkpsGTXqCMrE24sKmCQg8avsmS8Fnfy0NZr6Qhf9c3p0sR5fbvmtyxsrSKTr6_skgnD8to3b7FUQkus3y26EB0rV-jF5I6qucIZnhXn9RiWtxsvKfYhY\" alt=\"\" width=\"300\" height=\"534\" \/><\/figure><\/div>\n\n\n\n<p><strong>Azim:<\/strong><\/p>\n\n\n\n<p>As mentioned we haven\u2019t been able to integrate the different subsystems mainly because the different parts we were missing, were purchased, printed and received the required hardware just this wednesday, the day before the deadline. Unfortunately, that meant we actually deploy object detection.<\/p>\n\n\n\n<p>Despite of this, me and Bj\u00f8rnar wanted to revisit the requirements we had set for our part of the project. For the first requirement: \u201c<strong>The system should identify the suit and rank of the card\u201d<\/strong>. I started working on learning about TensorFlow and object detection in week 2 because I had no previous experience with it. Me and Bj\u00f8rnar both really wanted to have this in our project by any means necessary, but as we progressed through the project and even up to this sprint, we realized that no matter how much we modified the model in terms of taking pictures, labeling them, using a different model to run on, the performance would leave a lot to be desired, both in terms of speed and reliability. That\u2019s why i started to work on the openCV script in parallel to Bj\u00f8rnar who kind of took over the TensorFlow responsibility, so that whatever happened we would have some sort of way to identify the suit and rank of the cards as the requirement suggests.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/p5j5nBNHDqIO_oxSy6rW4X_E28rblG4UhS7BtnFN_pbsFYy6vkeKCchcz4T-rujdtbmTh9CppHf_xC6zTaYJoZ6GFBpE4cesJjQ9jLgNRximIr7FSbHup2L9a5jXBKeirbhs0nod\" alt=\"\" width=\"190\" height=\"182\" \/><\/figure><\/div>\n\n\n\n<p>The second requirement was that \u201c<strong>the system should use the identified card to recommend decisions to the player\u201d.&nbsp; <\/strong>This, on the other hand, was not that difficult, as it consisted of coding the blackjack game and integrating it with openCV script for the card detection which we couldn\u2019t test in the final operational mode, but the script itself works successfully, and does as the requirement suggests which is recommending decisions to help the player during the blackjack game.<\/p>\n\n\n\n<p><strong>Data (Bj\u00f8rnar):<\/strong><\/p>\n\n\n\n<p>The pictures below are a quick summary of my last ditch effort in trying to improve our custom machine learning model. My last effort included taking over 100 pictures and by augmenting them, turning them into around 700 pictures. After researching online, it was suggested that maybe the disappointing performance of the model was due to a low amount of pictures for the model to learn from, so by doing this, I hoped it would improve the performance.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/Y8_K83Qt68361z0s1Gy3H2UVJ4k2lJaazmYGffTVpyI5_U8IgVNm7WIeK31_0MzjE0cS13ks0P8VHOMAjhtFlLWxdw7G6hOESF_csUAf7GUdQ_sCtgJZOzdNu8HaiQj0wSuFWYaV\" alt=\"\" width=\"430\" height=\"164\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/ZKKBWS9uQADt8i9juXHWmmwNz3J4slBNKI5XlIXcNv06bH1m4IJawh7ucIaEbj2y81YXD2-uIc9SBf_1ysLQEN31YUimNucE9JbJLO-zTNxqxQG6rkkiMwXh1JkzbhsEEykFJlRL\" alt=\"\" width=\"400\" height=\"276\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/3F276PplVfln3-RawS7uO7a_n43wC5uHh5vE1DGylnx-cJ2XKE7gx8pNoPIv_YQXglm2NMV_tpIDxhMhTDiz-nV5c1d0jz1asHQ1PyoQrk_gPVFUNS_uafWiGywVz3nHqPIne_be\" alt=\"\" width=\"391\" height=\"218\" \/><\/figure>\n\n\n\n<p>When we ran this model, it didn\u2019t perform better than the previous iteration of our custom model, surprisingly. Since we didn\u2019t have more time to modify the model, we put the machine learning efforts aside because I also had other tasks to finish. Furthermore, to finalize i continued to work on the code for the blackjack script as well as the app.<\/p>\n\n\n\n<p>Link to the code for our project is published at: <a href=\"https:\/\/github.com\/BjoBor\/RobotBlackjack?fbclid=IwAR3NoYgehbE1EvSxhn9OlfNrypGPPEu7rv1J4jsqqRxbRwolQ5dlQQGvAuc\">https:\/\/github.com\/BjoBor\/RobotBlackjack?fbclid=IwAR3NoYgehbE1EvSxhn9OlfNrypGPPEu7rv1J4jsqqRxbRwolQ5dlQQGvAuc<\/a><br><\/p>\n\n\n\n<p><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Felles: During this final week we are working to get the robot arm up and running. We\u2019ve encountered a problem with a lack of servo motors required for the arm to be fully functional. The servos we needed were \u201cTowerPro MG968\u201d and unfortunately they weren\u2019t available at campus. Luckily, we got a recommendation to visit [&hellip;]<\/p>\n","protected":false},"author":75,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4926","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/4926","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/users\/75"}],"replies":[{"embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4926"}],"version-history":[{"count":4,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/4926\/revisions"}],"predecessor-version":[{"id":4935,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/4926\/revisions\/4935"}],"wp:attachment":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4926"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4926"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4926"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}