Thursday, September 29, 2016

Thursday, September 22, 2016

Initial Project Planning

  1. Project Description and Merits

The project is to build a program that will allow a drone to navigate by itself by detecting obstacles or following a set of instructions or signals, such as colored lines. This project will advance STEM because it allows for further advancements in drones and can lead to autonomous drone tracking and it will allow the drone to think and make decisions, as well as corrections, itself. This can decrease drone accidents and make the controller’s lives easier, and will be more precise and is faster than a human input. Not just that, since the drone will be operating in an indoor environment, it will be essential for the drone to be able to "sense" or "map" the environment around itself. This could help our worldwide community in many ways, provide possible methods of deliveries into warehouses/factories/offices, rescue, and just overall, evaluating the environment around itself, especially if it is dangerous.

  1. Group/Team Communication
The only members of our group are me and Ayoush. We may need to work with group 2 (Jacob, Alan, and Ryan) because they are also working with drones, and coding as well. We will communicate with each other via Facebook Messenger, Hangouts, and other methods.

  1. Prior Work/Resource Inventory
  • Node.js - Node.js is a programming language that is essential for the coding of our drone. It will allow us to give the drone commands, control the drone, etc.
  • AR.Flight 2.4.10 - This app will allow us to experiment with the drone, especially its movements. Understanding the movements of the drone will be essential to how we code commands for the drone. 
  • Robot Operating System (ROS) - This website will provide us powerful programming tools that could help us program our drone. 
  • Line following code - This database will allow us to analyze the code used by the group from last year, and make improvements in the code, to make the drone operate with a better performance and efficiency. 
  • How to use Git and GitHub - We must learn how to use GitHub if we are to make improvements and corrections to our code and store our files safely for further use at home or school. 
  • There are many other tools that we can use in our Project Resource page, and more will later be specified. 

  1. Technology Analysis
We need coding and engineering. We need coding in order to code the drone to follow lines and other commands, and we also need to write a script for the drone to follow. We also need to program the drone to interpret the data. We need engineering in case something goes wrong or we need to fix something physically. We will also need to be able to navigate the drone, and as a result, we will need to use the camera of the drone to help with navigation. Since our main objective is to make the drone follow a colored line, it is essential that we use the camera, and develop code for image processing. This will allow the drone to process images and then follow the colored line. The drone should also be able to dodge obstacles or redirect its route based on the objects it sees ahead, or on its way. As a result, a code will be necessary for the drone to recognize a 3D entity, the object, and then redirect a route around it. As a result, there is still much we need to do, and many tasks ahead of us.

Examples of the technology we need are...
- Javascript
- Node.js module
- Felixge’s AR Drone module
- An IDE, one that can run programs too


  1. Competence
Again, the skill sets that we need are coding and engineering for the same reasons. We also need to be patient and accept failure and are persistent. We also need to be precise and run many trials.
Skill Sets: 
- advanced knowledge of Microsoft Word, and Powerpoint
- knowledge of Microsoft Excel (possible to become better through practice)
- knowledge of commands and modules in node.js
- advanced knowledge of computer
- basic skill in controlling drone through applications

More skills will be added over time. 

  1. Safety
Safety is not a concern, however there are possible safety issues such as:
- getting cut by the drone blades.
- getting hit by the drone
- the drone hitting a classmate, or student

To keep our fellow peers and ourselves safe, we will most likely conduct drone experiments far away from the drone but close enough for the drone to be in sight to observe any errors in the drone control. Also, we will most likely conduct these experiments in an open-enviornment like the corridors at times where students are not walking through the corridor often, such as afterschool, and in the morning. We could also possibly conduct experiments in the gym too, if empty, due to its extensive space. 

  1. Equipment, Materials & Budget
We will need the FreeFlight AR Drone, a Windows Laptop, and a Mac. There should be no software costs because we will be using free, open-source software. We will need to download Node.js, Felixge’s AR Drone module, and Sublime Text 3.

  1. Schedule
Our goals for next week is to continue experimenting with the code and trying different actions, like flips, rotating, revolving, etc. We will investigate deeper and look at last year’s code and blogs to see what trouble we may run into and how to resolve them. We will do more research and maybe try to do something with the sensors.

RE: Initial Project Planning

1) Missing title of the post.
2) In part 1, you can highlight the "indoor environment" aspect of your project. Since there is GPS support for outdoor environment, it is actually more difficult for drones to navigate autonomously in the indoor environment. You can also point out the potential indoor applications such mapping, evaluating dangerous environment, rescue, warehouse/factory/office indoor delivery, etc.
3) In prat 1, Javascript, Node.js module, and Felixge’s AR Drone module are implementation details. Normally, we don't put them in the project description.
4) In part 2, great to point out the collaboration with Team 2!
5) In part 3, "Prior Work/Resource Inventory" is NOT your personal experience. It is the inventory of what other people have done relevant to your topic. You need to do some preliminary search online to get the idea about this field, and record the links and valuable information through this exercise. You can start this exercise from your Project Resource page, and add new info to the page throughout the process. 
6) In part 4, you can add things like:
  • video acquisition
  • image processing (e.g., color space conversion, thresholding, line/circle detection, etc.)
  • drone navigation (distance/direction control)
  • path planning
  • obstacle avoidance
In other word, you need to identify technology in much more details. This is also the location for you to put those "Javascript, Node.js module, and Felixge’s AR Drone module", and any other languages/platforms.
7) In part 5, take an inventory of all the relevant technical skills in your group and put them into a list. You can also list possible/accessible skills in the class. 
8) In part 6, once listing the possible safety issues, develop a plan to address the issue.

Wednesday, September 21, 2016

Goal Overview

  1. Project Description and Merits


The project is to build a program using certain modules from Javascript utilising the Node.js module and Felixge’s AR Drone module. We will get the drone to navigate by itself by detecting obstacles or following a set of instructions or signals, such as colored lines. This project will advance STEM because it allows for further advancements in drones and can lead to autonomous drone tracking and it will allow the drone to think and make decisions, as well as corrections, itself. This can decrease drone accidents and make the controller’s lives easier, and will be more precise and is faster than human input.  


  1. Group/Team Communication
The only members in our group are me and Ayoush. We may need to work with group 2 (Jacob, Alan, and Ryan) because they are also working with drones. We will communicate with each other via Facebook Messenger.


  1. Prior Work/Resource Inventory
We have absolutely no experience with this. Our project resources are the web, youtube, and previous group’s work.


  1. Technology Analysis
We need coding and engineering. We need coding in order to code the drone to follow lines and other commands, and we also need to write a script for the drone to follow. We also need to program the drone to interpret the data. We need engineering in case something goes wrong or we need to fix something physically.


  1. Competence
Again, the skill sets that we need are coding and engineering for the same reasons. We also need to be patient and accept failure and are persistent. We also need to be precise and run many trials.


  1. Safety
Safety is not a concern, except maybe getting cut by the drone blades.


  1. Equipment, Materials & Budget
We will need the FreeFlight AR Drone, a Windows Laptop, and a Mac. There should be no software costs because we will be using free, open-source software. We will need to download Node.js, Felixge’s AR Drone module, and Sublime Text 3.


  1. Schedule
Our goals for next week is to continue experimenting with the code and trying different actions, like flips, rotating, revolving, etc. We will investigate deeper and look at last year’s code and blogs to see what trouble we may run into and how to resolve them. We will do more research and maybe try to do something with the sensors.

Monday, September 12, 2016

Notes on Video #15

Video Notes:

Video 15 of Node JS Tutorial, thenewboston
Video Name: Connect

- a server framework called "connect" - already contains many tools we can use to handle user requests
- to install the "connect" framework, type "npm install connect" into the terminal
- when you connect to the website, it will look to the code for how to handle the request
- the code that handles user requests is called "middleware", place that in the "use" method/command
- the function of "connect" is that you can stack the middleware
- whenever you have a stack of middleware, these functions can be executed one by one
- doFirst has a special third parameter called next where whenever the user makes a request, you can make the function next (called doSecond) happen, basically calls for the next function - could be a very useful function in the future
- eventually, we can inspect paths, what user requests are they making, etc.

var connect = require('connect');
var http = require('http');

var app = connect();

function doFirst(request, response, next){
    console.log("bacon")
    next();
}

function doSecond(request, response, next){
    console.log("tuna")
    next();
}

app.use(doFirst);
    app.use(doSecond);


    http.createServer(app).listen(8888);
console.log('Sever is now running.');
Code used above.

Sunday, September 11, 2016

Notes on Video # 14

Video Notes:

Video 14 of Node JS Tutorial, thenewboston
Video Name: Simple Web File Server

- instead of sending data back, we need to send files back
- function onRequest = a function that will listen for functions
- you should make an if statement, saying request.method
- get = standard method of connecting to a website
- request.url, if equal to a /, you are connecting to the home page
- use the command "response.writeHand (200, ("Content-Type": "text/html"});" to send a html file back
- we need to send back a readable stream
- the file could be any size, want to send it back as a stream - used for better performance
- the command "fs.createReadStream("./index.html").pipe(response);
- the pipe function is to write it out, for feed it out

I am having trouble finding a suitable program to use for writing code. For some reason, my node.js file does not work running on these programs like Atom and Webstorm. If there are any suggestions, please do tell me. 

Wednesday, September 7, 2016

Notes on Video # 13

Video Notes:

Video 13 of Node JS Tutorial, thenewboston
Video Name: Creating a Basic Server

- an http server
- javascript was made for the web browser
- node js = code that will be on a server, will make a request for information from the database, the server will look at the request, and send information back in response to the request
- call the http core module (built into nodejs)
- then write "http.createServer"
- server has to be listening for request
- whenever a user uses the server, we need to call a function such as "onRequest", therefore, you have to build this function
- needs two parameters
- one parameter is the request object - information about user's request, what info were they trying to get, etc.
- second parameter is response - object/data we can send back to them
- there are different status codes that signify whether the request was successful or not, etc.
- use "request.writeHead", has two parameters, status code, and header information = what type of data you are sending back to them
- whenever a user connects to your server, the browser sends a request looking for the page, and makes another request for the favicon

Code created by tutorial maker:
var http = require('http');

function onRequest(request, response){
  console.log("A user made a request" + request.url);
  response.writeHead(200, [Context-Type]: "text/plain");
  response.write("Here is some data");
  response.end();
}

http.createServer(onRequest).listen(8888);
console.log("Server is now running....");


Tuesday, September 6, 2016

Notes on Videos # 10, 11, 12

Video Notes:

Video 10 of Node JS Tutorial, thenewboston
Video Name: Shared State of Modules

- shared objects/modules
- whenever you use modules, the default behavior is to share the module among every other file that imports it

Video 11 of Node JS Tutorial, thenewboston
Video Name: Object Factories

- you need to export a function to create a new object
- object factory = object that creates another object
- can have their own custom copy

Video 12 of Node JS Tutorial, thenewboston
Video Name: Core Modules

- core modules are the modules already built into node.js
- there are a lot of them
- fs = file system module
- you don't use the /. in core modules, only custom modules, use only the name (node knows its a core module)
- allows you to read and write files, and delete them
- file system module has 3 parameters
- path module, works with paths, normalizes slashes,
- "setInterval" - can have a bit of code to run, runs repeatedly, similar to the process of "setTimeout" but repeats unlike "setTimeout"
- "dirname" - give directory name (full path)
- "filename" -give file name of whatever file is currently calling the code

Notes on Videos #5, 6, 7, 8, 9

Video Notes:

Video 5 of Node JS Tutorial, thenewboston
Video Name: Understanding References to Objects

- in node, everything is a reference
- everything is interconnected, as a reference
- == means it only compares the value
- === means it only compares type and value

Video 6 of Node JS Tutorial, thenewboston
Video Name: this

- "this" is a keyword
- used to refer to the thing that called it (can be an explicit object)
- a true or false situation
- if you make a function that does not belong to any object, it is global
- your entire program will then call it - refers to global

Video 7 of Node JS Tutorial, thenewboston
Video Name: Prototype

- can add cool methods or properties to objects in classes (a hierarchy system?)
- can add additional functions onto a user object
- every instance has access to new function
- use the command called "prototype"

Video 8 of Node JS Tutorial, thenewboston
Video Name: Modules

- files often can contain thousands of lines, as a result, it can get really messy, and unorganized
- code can be broken up into different files
- these files are called modules
- to make modules, you group similar code together
- ex: a streaming service like Netflix offers movies, TV shows, and more, the code could be broken up into modules, there would a module for movie-related code, and a module for TV show-related code
- modules, therefore, are more specific
- to do this, you would make a new file
- code can be specifically exported into the main app file
- "module.exports" is the command that determines what code will be exported, and when you type this keyword, you can tag on any variable in the code
- to import another module, you set it equal to a variable
- use the keyword "require" to simply state: we are requiring a module, or code from a file
- ex: ./movies - look in the same directory looking for the movies.js

Video 9 of Node JS Tutorial, thenewboston
Video Name: More on Modules

- there are more efficient ways to export code
- a default module.exports is always running behind the scenes, when you type an edited module.exports, it will look for the code you referenced, and then export it
- you can write your functions directly in this object, so all the code is directly and simultaneously exported