{"id":3653,"date":"2019-11-11T00:07:11","date_gmt":"2019-11-10T23:07:11","guid":{"rendered":"http:\/\/dronesonen.usn.no\/?p=3653"},"modified":"2019-12-05T08:22:14","modified_gmt":"2019-12-05T07:22:14","slug":"haptix-week-45","status":"publish","type":"post","link":"https:\/\/dronesonen.usn.no\/?p=3653","title":{"rendered":"Haptix Week 45"},"content":{"rendered":"\n<p><strong>Petter:<\/strong>&nbsp;<\/p>\n\n\n\n<p>I\u2019ve been working on the input system of the cube, first debating&nbsp;it\u2019s&nbsp;simplicity,&nbsp;intuitivity&nbsp;and scale, and from then I\u2019ve chosen to make the input based on a single press and it\u2019s angle compared to the side and block it touches, it will from then send the relevant data which will decide which way to make the cube rotate. I would have loved to create a more complex system which would have been multiple touch based, akin to real life, however with the&nbsp;rubix&nbsp;model I have already created and the expected time allotted and time spent already, I couldn\u2019t&nbsp; justify redoing it.&nbsp;<\/p>\n\n\n\n<p><strong>Daniel:<\/strong>&nbsp;<\/p>\n\n\n\n<p>For&nbsp;this&nbsp;week&nbsp;I have&nbsp;continued&nbsp;to&nbsp;work&nbsp;on&nbsp;the&nbsp;serial&nbsp;controller&nbsp;(Arduino.cs) and&nbsp;fingertip&nbsp;script.&nbsp;Where&nbsp;I have&nbsp;implemented&nbsp;threading&nbsp;with&nbsp;enqueueing&nbsp;and&nbsp;dequeuing.&nbsp;That&nbsp;way,&nbsp;the&nbsp;Unity&nbsp;application&nbsp;can&nbsp;communicate&nbsp;in an&nbsp;asynchronous&nbsp;way&nbsp;with&nbsp;the&nbsp;Arduino&nbsp;through&nbsp;the&nbsp;serial&nbsp;port.&nbsp;Before&nbsp;implementing&nbsp;the&nbsp;threading, I&nbsp;had&nbsp;tried&nbsp;to&nbsp;use&nbsp;coroutines&nbsp;in&nbsp;Unity.&nbsp;<\/p>\n\n\n\n<p>My&nbsp;approach&nbsp;to&nbsp;this&nbsp;was&nbsp;to&nbsp;include&nbsp;the&nbsp;System.Threading&nbsp;library&nbsp;in&nbsp;Unity&nbsp;and&nbsp;use&nbsp;Queue.Synchronized.&nbsp;Where&nbsp;I&nbsp;had&nbsp;2 different&nbsp;queue\u2019s,&nbsp;one&nbsp;for&nbsp;Unity&nbsp;to&nbsp;Arduino&nbsp;and vice versa. I have&nbsp;set&nbsp;the&nbsp;thread&nbsp;to run in&nbsp;the&nbsp;background.&nbsp;Which&nbsp;will&nbsp;then&nbsp;be looping&nbsp;through&nbsp;both&nbsp;the&nbsp;queue\u2019s,&nbsp;while&nbsp;checking&nbsp;if&nbsp;there\u2019s&nbsp;anything&nbsp;to&nbsp;dequeue&nbsp;from&nbsp;them. This is&nbsp;on&nbsp;the&nbsp;premise&nbsp;that&nbsp;there&nbsp;is&nbsp;something&nbsp;already&nbsp;enqueued. E.g. a&nbsp;function&nbsp;in&nbsp;the&nbsp;serial&nbsp;controller&nbsp;is&nbsp;checking&nbsp;if&nbsp;there\u2019s&nbsp;something&nbsp;to be&nbsp;read&nbsp;from&nbsp;the&nbsp;Arduino. If not,&nbsp;then&nbsp;the&nbsp;function&nbsp;will&nbsp;return&nbsp;null&nbsp;rather&nbsp;than&nbsp;enqueueing&nbsp;something.&nbsp;<\/p>\n\n\n\n<p>Furthermore, I will have to work a little more on the&nbsp;Arduino.cs&nbsp;script. As I do have some issues with both sending and receiving data.&nbsp;<\/p>\n\n\n\n<p><strong>William:<\/strong>&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"622\" height=\"1024\" src=\"http:\/\/dronesonen.usn.no\/wp-content\/uploads\/2019\/11\/image-11-622x1024.png\" alt=\"\" class=\"wp-image-3654\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2019\/11\/image-11.png 622w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2019\/11\/image-11-182x300.png 182w\" sizes=\"auto, (max-width: 622px) 100vw, 622px\" \/><\/figure>\n\n\n\n<p>I made a flow chart diagram back in October, where I described that I wanted to implement a pause menu (Pause Application marked in red).&nbsp; I have now made a \u201cpause menu\u201d in unity, where you can pause the game\/application by pressing the ESC-button on your keyboard (shown in C# screenshot).&nbsp;&nbsp;<\/p>\n\n\n\n<p>As well as continuing working on the User Interface, Even and I is also going to make a \u201cscoreboard\u201d that shows how many engagements or puzzles you have done with the Cube. The scoreboard system is going to be uploaded to a database.&nbsp;<\/p>\n\n\n\n<p><strong>Herman<\/strong><strong>&nbsp;&amp; Tom Erik<\/strong><strong>:<\/strong>&nbsp;<\/p>\n\n\n\n<p>The IMU is now hooked up to an Arduino and been tested to see if it works. When reading the serial monitor of the IMU one can see that there is a lot of information at once. So here I must take out and decide what information is needed and then also interoperate what that information represents in the real world. To test this, I have started assembly of a test glove by using an old single glove that I had laying around. Here I will monitor the movement of my hand when doing things like rotating a&nbsp;rubix&nbsp;cube, grab objects, move my hand and so on.&nbsp; Picture of the said output below, one can see a change in values as I shook the IMU.&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"893\" src=\"http:\/\/dronesonen.usn.no\/wp-content\/uploads\/2019\/11\/image-9-1024x893.jpeg\" alt=\"\" class=\"wp-image-3655\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2019\/11\/image-9.jpeg 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2019\/11\/image-9-300x262.jpeg 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2019\/11\/image-9-768x670.jpeg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>On the communication part I have somewhat finished the layout for how the microcontrollers are communicating but is yet to receive the microcontrollers, which are expected to arrive mid-week 46.\u00a0\u00a0\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Petter:&nbsp; I\u2019ve been working on the input system of the cube, first debating&nbsp;it\u2019s&nbsp;simplicity,&nbsp;intuitivity&nbsp;and scale, and from then I\u2019ve chosen to make the input based on a single press and it\u2019s angle compared to the side and block it touches, it will from then send the relevant data which will decide which way to make the [&hellip;]<\/p>\n","protected":false},"author":72,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[59,1],"tags":[],"class_list":["post-3653","post","type-post","status-publish","format-standard","hentry","category-haptix","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/3653","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\/72"}],"replies":[{"embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3653"}],"version-history":[{"count":1,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/3653\/revisions"}],"predecessor-version":[{"id":3656,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/3653\/revisions\/3656"}],"wp:attachment":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}