Monday, January 9, 2017

Back into the Grind

look, there's a snowflake on the table (Abby made that)


Hope everyone had a nice holiday break! This post will cover our pre-break and over-break advancements for our robot.

So What's new?

We've recently had a change in plans on communicating to our robot with an Android device. We have decided to use a wifi connection to send texts to our robot. Though, due to Augustana's strict wifi settings, our robot cannot connect to the wifi because a form of authentication is required. To combat that struggle, we decided to use our phone as a wifi hotspot to connect another phone and the our lego robot.

We have successfully sent a string of text to our robot to be displayed on its screen using socket connection class. The class declares a new socket object and uses an output stream writer to send text to the robot using a write() method and a flush() method.

hey look, it's some code. 


 The socket object requires an IP and port number to be passed in to be created.

Now that we can send text to the robot, a class has been created on the LeJos side that translates input Strings from an Android device to actually function the robot to move using its pilot object. How it's current set is default movement directions for front, back, left, and right to move a preset distance. There is also a new format for basic movement denoted with a F or B, followed by a speed and distance such as F1305, which moves the robot forward at a speed of 130, moving 5 units forward. 

 a snippet of our robot movement class in Eclipse

And in the future?

Our project alpha demos are coming fairly soon. We plan on having our phone have two activities, the first default one being a setup for a socket, asking the user to input an IP address and port number which has an intent that will start the main layout, with directional buttons for movements and fields for a movement of angle and distance. We are looking into creating a stop button - that may have to be on a separate threat, that will override and cease all function in the robot and clear its movement queue (for which we will use a vector data structure to mange all the move commands).
For our final version of our application, we are currently researching into voice recognition and video processing (with the phone mounted on the robot). Until then, stay tuned!

No comments:

Post a Comment