-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfinal.html
287 lines (262 loc) · 17.4 KB
/
final.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Final Competition</title>
<link rel="shortcut icon" href="favicon-paper-plane.ico" />
<!-- Bootstrap Core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">
<link href="vendor/simple-line-icons/css/simple-line-icons.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/stylish-portfolio.min.css" rel="stylesheet">
</head>
<body id="page-top">
<!-- Navigation -->
<a class="menu-toggle rounded" href="#">
<i class="fas fa-bars"></i>
</a>
<nav id="sidebar-wrapper">
<ul class="sidebar-nav">
<li class="sidebar-nav-item">
<a class="js-scroll-trigger" href="index.html#page-top">Home</a>
</li>
<li class="sidebar-nav-item">
<a class="js-scroll-trigger" href="index.html#about">About</a>
</li>
<li class="sidebar-nav-item">
<a class="js-scroll-trigger" href="index.html#milestones">Milestones</a>
</li>
<li class="sidebar-nav-item">
<a class="js-scroll-trigger" href="index.html#labs">Labs</a>
</li>
</ul>
</nav>
<!-- Header -->
<header class="masthead d-flex">
<div class="container text-center my-auto">
<h1 class="mb-1">Final Competition</h1>
<h3 class="mb-5">
<em>The culmination of the semester</em>
</h3>
<a class="btn btn-primary btn-xl js-scroll-trigger" href="#about">Wanna know more?</a>
</div>
<div class="overlay"></div>
</header>
<section id="about" class="content-section">
<div class="container">
<h1>Objective</h1>
<p>This class was meant to help us all learn more about intelligent physical systems (i.e. robots that can make their own decisions) through making our own. Our robot is named Arduino Schwarznegger, and we wanted him to be able to do the following in time for the final competition:</p>
<ul>
<li>Follow a line</li>
<li>Avoid walls</li>
<li>Start on a 660Hz tone</li>
<li>Solve a maze</li>
<li>Display findings to a GUI</li>
<li>Avoid other robots</li>
<li>Detect treasures</li>
</ul>
<h1>Procedure</h1>
<p>Each week there was a new lab or milestone to finish that would help us achieve the objectives above.</p>
<ul>
<li><a href="lab1.html">Lab 1</a>:
<ul>
<li>Learn how to read digital and analog signals</li>
<li>Assemble the servos, to be used for the wheels</li>
<li>Build the original robot chassis</li>
</ul>
</li>
<li><a href="milestone1.html">Milestone 1</a>:
<ul>
<li>Have our robot follow a line</li>
<li>Improve upon that to have our robot follow a maze grid</li>
</ul>
</li>
<li><a href="lab2.html">Lab 2</a>:
<ul>
<li>Understand how to use an FFT with our Arduino</li>
<li>Detect a 660Hz acoustic signal</li>
<li>Detect a 6kHz IR signal</li>
</ul>
</li>
<li><a href="milestone2.html">Milestone 2:</a>
<ul>
<li>Add wall sensors to the robot</li>
<li>Implement a right-hand follow algorithm to solve the maze</li>
<li>Show that robot can detect other robots nearby through IR</li>
</ul>
</li>
<li><a href="lab3.html">Lab 3</a>:
<ul>
<li>Store maze information in a space-saving manner</li>
<li>Send information across via a radio transmitter on the Arduino to the base station radio receiver</li>
<li>Update a maze GUI with information about the robot's location and surroundings</li>
</ul>
</li>
<li><a href="milestone3.html">Milestone 3</a>:
<ul>
<li>*Actually* solve the maze using a depth-first search algorithm</li>
<li>Ensure the robot explores all nodes of the maze</li>
</ul>
</li>
<li><a href="lab4.html">Lab 4</a>:
<ul>
<li>Understand how to use an FPGA and camera</li>
<li>Use the camera to detect red vs blue color</li>
<li>Send that color detection to the Arduino</li>
</ul>
</li>
<li><a href="milestone4.html">Milestone 4</a>:
<ul>
<li>Detect shapes shown to the camera</li>
<li>Send color and shape information about tresures to the Arduino</li>
<li>Display and analyze that information accordingly on the GUI</li>
</ul>
</li>
</div>
</section>
<!-- Milestones -->
<section class="content-section bg-primary text-white text-center" id="milestones">
<div class="container">
<div class="content-section-heading">
<h2 class="mb-5">Let's Break it Down</h2>
</div>
<div class="row">
<div class="col-lg-3 col-md-6 mb-5 mb-lg-0">
<a href="#hardware" class="text-white text-center js-scroll-trigger">
<span class="service-icon rounded-circle mx-auto mb-3">
<i class="far fa-lightbulb"></i>
</span>
<h4>
<strong>Hardware</strong>
</h4>
<p class="text-faded mb-0"></p>
</a>
</div>
<div class="col-lg-3 col-md-6 mb-5 mb-lg-0">
<a href="#software" class="text-white text-center js-scroll-trigger">
<span class="service-icon rounded-circle mx-auto mb-3">
<i class="fas fa-screwdriver"></i>
</span>
<h4>
<strong>Software</strong>
</h4>
<p class="text-faded mb-0"></p>
</a>
</div>
<div class="col-lg-3 col-md-6 mb-5 mb-md-0">
<a href="#restructured" class="text-white text-center js-scroll-trigger">
<span class="service-icon rounded-circle mx-auto mb-3">
<i class="fas fa-toolbox"></i>
</span>
<h4>
<strong>Restructured</strong>
</h4>
<p class="text-faded mb-0"></p>
</a>
</div>
<div class="col-lg-3 col-md-6">
<a href="#result" class="text-white text-center js-scroll-trigger">
<span class="service-icon rounded-circle mx-auto mb-3">
<i class="fas fa-car-crash"></i>
</span>
<h4>
<strong>Result</strong>
</h4>
<p class="text-faded mb-0"></p>
</a>
</div>
</div>
</div>
</section>
<section class="content-section" id="hardware">
<div class="container">
<h1>Hardware</h1>
<h2>Arduino's Skeleton</h2>
<p>Arnold has a soldered IR receiving circuit and audio detection circuit that hand on top of his top chassis. That top chassis also has his IR emitting hat. In his middle chassis, he has a multiplexer that takes in signals from the wall sensors and line sensors. That mux is on a protoboard that simplifies the power and grounding for the mux, sensors, and motors. There are two inner ground rails that are shorted together with two outer power rails on the main protoboard. The mux sits on a carriage in the center of the board with the inputs going in as an ordered line for debugging purposes.</p>
<p>Arnolds bottom chassis contains two batteries, for the arduino and for the servos. It has one battery pushed forward to balance it and reduce the possibility of “jumping” in the GUI (it didn’t).</p>
</div>
</section>
<section id="software" class="content-section bg-primary text-white">
<div class="container">
<h1>Software</h1>
<h2>Bits and Bytes</h2>
<p>For each hardware element of our robot, there was a software component behind it. The full code can be found <a href="https://github.com/ece3400-team16" style="color:white;">here</a>, on our Github.</p>
<p>To start, Arduino used the acoustic circuit from <a href="lab2.html" style="color:white;">Lab 2</a> to detect a 660 Hz. As described in that lab, the acoustic signals were detected by the microphone in the circuit and run through an FFT, which put the strength of each signal at every frequency into a series of bins. To ensure that the FFT wouldn't cost our robot a lot of computing power and time, the bin that corresponded to the 660Hz signal was checked at the beginning of the competition and never checked again. The audio_detected function did this, and once it returned true, the robot was on its way through the maze.</p>
<p>For the actual maze traversal itself, once the 660Hz signal had been detected, our depth-first search (DFS) algorithm was called. This algorithm was described fully in <a href="milestone3.html" style="color:white;">Milestone 3</a>, but to give a high-level overview, it used a recursive function to proceed to every intersection within a specified-size maze. The movement of the robot was encoded into priorities, where moving forward took precedence (if there was no front wall of course), followed by turning left (if there was no left wall), and turning right (if there was no right wall). Since the function was recursive, if a path had been completely followed to visit all possible nodes along the way, the robot would then backtrack through the function stack. This was a more simplified final algorithm, but also one that required more complicated debugging along the way.</p>
<p>Something interesting that this algorithm required, especially when it came to backtracking, was keeping track of direction. North, south, east, and west were static while in the maze, but our robot was constantly turning and referencing front, right, and left instead. This meant that we had to store the global direction, as well as a local variable to reference the previous direction the robot had been if it had visited that node before, so as to fully understand which walls needed to be checked with respect to its original orientation.</p>
<p>This algorithm also ensured that there would be no collisions with other robots. As completed in <a href="lab2.html" style="color:white;">Lab 2</a>, there was a circuit built to detect IR signals at 6kHz. Unlike the acoustic FFT, this FFT was running constantly, costing us computing time but also making sure that we didn't run into our competition. To fully integrate this circuit within our robot, there was a robot_detected() function, which would check the bins relevant to 6kHz and return a boolean to indicate whether a robot was nearby. The circuit had a small range of detection due to the phototransistor, so it was pointed forward on our robot to check and see if it would run into any robots ahead. Our concern was instigating a crash, not necessarily generally participating in it, and it would be clear that we had caused the crash if we had run into another robot in front of us.</p>
<p>If a robot was detected, robot_reacted() would be called, a function we wrote to turn the robot around, proceed to the intersection it had just visited, and continue traversing through the maze as normal. It was essential that we continued with our recursive DFS implementation, even if a robot had been detected, because we needed to explore as much of the maze as possible and the backtracking aspect of our algorithm would allow us to do that.</p>
<p>All of this information had to be confirmed by an actual human, so, using our code from <a href="lab3.html" style="color:white;">Lab 3</a>, the location of the robot (stored using global variables that were updated in our DFS functions), the walls surrounding it (also updated from the DFS functions), and whether or not a robot had been detected were all transmitted in a compressed bit stream to our base station radio.</p>
</div>
</section>
<section id="restructured" class="content-section">
<div class="container">
<h1>Restructuring</h1>
<h2>Making Everything Look Good</h2>
<p>We made sure to keep our code organized and easy-to-understand. Throughout the semester, we accumulated many files, some of which were valuable, others not. Fortunately, we implemented a number of methods to help keep our code clean and our software easily-manageable.</p>
<p>We maintained our software with strict version control on both lab and milestone .ino files, via clearly labeled folder names and clear git commit messages on our GitHub repository. This basic filename convention was a simple start to our file management.</p>
<p>Our team also used GitHub effectively. We never had to deal with any git merges or other branch issues. This relied on effective communication between members when making changes, pulling, or pushing code when members wanted to separately test/debug software.</p>
<p>Thirdly, our team members effectively comment all of the code that we type, so as to make it easy for code to be passed between teammates and understood quickly (time was of the essence).</p>
<p>Lastly, after we finished our final code, we spent time writing separate header (.h) and C++ (.cpp) files to import into a main file, to make our program shorter, simpler, and easier to read. Although we could have refractored even further, we ended up creating four different classes for four crucial systems on our robot.</p>
<p>The first class, Locomotion, imports the Servo library, instantiates the servos for the wheels, and has functions that write to individual wheels. One instance of Locomotion is created in our dfs_main file.</p>
<p>The second class, Radio, imports several libraries used for radio communication between our robot and our base-station Arduino. It defines a single function, pingOut; since several other radio-functions used variables from dfs_main, we found it simple to leave those functions in dfs_main. One instance of Radio is created in our dfs_main file.</p>
<p>The third class, ToneDetect, imports the FFT library, and contains two functions: audio_detected() and robot_detected(). These are, quite obviously, used for detecting 660 Hz sound and 6 kHz IR light. One instance of ToneDetect is created in our dfs_main file.</p>
<p>The fourth class, WallSensor, is used to contain the code for reading wall sensor information and detecting if a wall is present. Three instances of WallSensor (for the front, left, and right wall sensors) are created in dfs_main.</p>
<p>The rest of dfs_main contains mostly algorithms and functions for traversing the maze according to the DFS algorithm.</p>
</div>
</section>
<section id="result" class="content-section bg-primary text-white">
<div class="container">
<h1>Result</h1>
<h2>The Final Product</h2>
<p>Arduino Schwarznegger was by no means the best robot out there, but it was a robot that we are proud of in what it could do and what it accomplished during the final competition. We hope you enjoy our work; we’ve had a heck of a time creating it!</p>
<div class="row no-gutters">
<div class="col-lg-6">
<a class="portfolio-item">
<img class="img-fluid" src="img/final/arnold.jpg" alt="">
</a>
</div>
</div>
</div>
</section>
<!-- Map -->
<!-- POINT TO PHILLIPS -->
<section id="contact" class="map">
<iframe width="100%" height="100%" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?q=phillips%20hall%2C%20ithaca&t=&z=13&ie=UTF8&iwloc=&output=embed"></iframe>
<br/>
<small>
<a href="https://www.google.com/maps/place/Phillips+Hall/@42.4445807,-76.4842416,17z/data=!4m7!3m6!1s0x89d0818c816cffe3:0xfd9ee07ff22c5aa4!8m2!3d42.4445768!4d-76.4820529!9m1!1b1"></a>
</small>
</section>
<!-- Footer -->
<footer class="footer text-center">
<div class="container">
<ul class="list-inline mb-5">
<li class="list-inline-item">
<a class="social-link rounded-circle text-white" href="https://github.com/ece3400-team16">
<i class="icon-social-github"></i>
</a>
</li>
</ul>
<p class="text-muted small mb-0">Copyright © ECE 3400 2018</p>
</div>
</footer>
<!-- Scroll to Top Button-->
<a class="scroll-to-top rounded js-scroll-trigger" href="#page-top">
<i class="fas fa-angle-up"></i>
</a>
<!-- Bootstrap core JavaScript -->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Plugin JavaScript -->
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<!-- Custom scripts for this template -->
<script src="js/stylish-portfolio.min.js"></script>
</body>
</html>