Tuesday 30 April 2013

Lagtastic!

The project thus far has been moving along smoothly, however, we have encountered lag issues through our quality control department (Joey). The application itself is relatively stable but due to the numerous variables that must be held accountable the program should be optimized in order to reduce lag.

Before we can move onto the task of developing the simulation aspect of the application, we must address rework our code using the resource manager. Our next task is to test different build versions on different computers with varying specs to test the stability of our program for school use (as mentioned before is relatively slow) and for personal computers.

Other ideas to rework the application include allowing for a button that updates everything after event changes (text change, buttons click, i.e.).

At least we are making progress!

// CodeBusters! (╯°□°)╯︵ ┻━┻

P.S. Lag sucks.

Monday 29 April 2013

TODO:

Code:
Mechanical Panel Stuffs:
- Coding the interface and positioning the text boxes.

Electrical Panel Stuffs:
- Rework the colour codes in terms of blue wires as the black/grey is to similar.
- Positioning interface and text boxes.

General:

Simulation Panel Stuffs // more information to be added later
Physics Calculations


Graphics:
Edit Electrical Panel Stuffs
- Add motor to series circuit, change stroke colour to blue, export as png with background as transparent
- Fix Up parallel circuit, change stroke colour to blue, export as png with transparent background

Create Simulation Panel Stuffs:
- Use profile view of robot
- Create 3d Version of robot + top down view
- Red Vector arrow kit (Tip, Tail and Tile-able Middle)

Wednesday Discussion
- Remember to discuss what exactly do you wish to have displayed through the simulation pane.
    - Display the maximum velocity?
    - Does this have the capabilities to move a 1kg block and speed while moving it?
    - How do we display the movement in terms of the top down view. IF wheels or force is different it will
    spin.IF the wheels where identically moving at sme speed
    - Any other ideas of what to be displayed?

- Check the physics with Mr. Song.

// Code Busters OUT

Tuesday 23 April 2013

Meetings and milestones

         We are pleased to announce this week that we have reached a very important milestone on the long and sometimes arduous path of software development. As mentioned in the last post, a scheduled meeting was held with our client this morning, where our team was able to demonstrate a fully-functional build of the simulator, thus far. While we are pleased to report that our progress up to this point was received warmly by Mr. Song, there is still a lot of work to be done before we will arrive at any kind of final product.

             With that said, this week, the Codebusters Team are hunkered down (as always), putting the final touches on the graphical component of the simulator. Furthermore, a few members of the development team have been tasked with beginning the design of the simulation portion of the application—specifically the implementation of the many physics concepts and equations that will be used to model the properties and motion of the sumobot. As this software will be targeted towards an academic audience, we are striving to represent as accurately as possible all the physical forces that will have an impact on the performance of the robot, and while there are undoubtedly many technical and time-related obstacles to achieving this goal, our modestly-sized team are continuously striking a balance between efficiency and precision.

            Lastly, as we enter this critical stage of the development process, we have committed to increase the frequency of communications with the client in order to ensure that a quality product is delivered. Specifically, a weekly progress meeting has been established at the convenience of our client, and thus, we hope to accelerate the pace at which the project marches towards completion.

-The Codebusters Team

Thursday 18 April 2013

That GUI and some complications

The project is progressing well in fact we have finished the graphical user interface.  That is all the buttons are very pretty and click-able and the info pane has stuff on it.  All that is left to do is add the tab buttons (easy) and draw the electrical and simulation screens (a bit more involved but still relatively simple).

Now to problems at hand: unfortunately, as it turns out we structured the program in the wrong way.  The good news about this is that it was not a show-stopping error and will require only a quick bug-fix and a few man-hours of work to remedy.

The problem lies a couple of variable declarations at the beginning of the driver class.  What they do is allow us to access and modify all the declared variables relatively easily.  An error was made here because it was decided that the program would be designed such that it would be simple to commit changes to the code.

After careful consideration by our programming team, it was decided for the sake of optimization and reducing redundancies, that the program would be  restructured into a series of classes, each of which would represent a single attribute of the robot, and that the variables will be accessed from that .  This also means we will also need to slightly modify the XML read/write class in order to accommodate the new structure.

- The Codebusters Team  

Wednesday 17 April 2013

Everything is coming along swimmingly!

It seems that spring has finally come upon us here at our head office in Toronto. Now that the weather is particularly nice outside, the project is coming along swimmingly!  From the last post we have started to make the info box which will display all the robot's information.  We have also started making the program do stuff.  That is, the user can input values into text fields and modify the mechanical components of the robot.  Presently the user input is not yet being processed. However, we anticipate that this will change by the end of the day.

The deadline for the rough version of the application is next Monday and the following Tuesday we have a meeting with the client.  The way things are going right now guarantee that the deadlines will be met and our application will go over and beyond our client's expectations.

It's an exciting time here at Codebusters.

-The Codebusters Team

Thursday 11 April 2013

XML reader/write success

The XML reader/writer is complete!  This means that we will be able to load and save the users information.  Here is some of the code:

public class XMLRead {
   
     static double PSVolt, PSAmp = 0;                                    // Variables for the power supply
     static double MVolt, MAmp, MSpeed, MTorque, MDriveShaft = 0;        // Variables for the motor
     static double WiLen, WiOhm, WiArea, WiRes = 0;                        // Variables for the wire
     static double WhDiam, WhMu = 0;                                    // Variables for the wheel
     static double RWeight =  0;                                        // General variables for the robot
     static String WiCircuit = " ";                                        // Type of circuit
   
        public static void write(String name) {
       
             try{
                      DocumentBuilderFactory documentBuilderFactory =       DocumentBuilderFactory.newInstance();   
             DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
       
             // Makes the root element robot
             Document doc = documentBuilder.newDocument();
             Element rootElement = doc.createElement("robot");
             doc.appendChild(rootElement);
           
             // The next blocks of code are all children to the root element "robot".
             Element PSvoltage = doc.createElement("PSvoltage");
             PSvoltage.appendChild(doc.createTextNode(Double.toString(PSVolt)));
             rootElement.appendChild(PSvoltage);


 // Creates an instance of TransformerFactory so that a "real" XML file can be created
             TransformerFactory transformerFactory = TransformerFactory.newInstance();
             Transformer transformer = transformerFactory.newTransformer();
             DOMSource source = new DOMSource(doc);
             StreamResult result = new StreamResult(new File(name));
           
             // Exports the XML
             // To clarify:  this is when the XML file is made on the local hard drive. 
             transformer.transform(source, result);
        
    public static void read(String doc) throws IOException, SAXException, ParserConfigurationException{
       
         File file = new File(doc);                                                             
         DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();   
         DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
         Document document = documentBuilder.parse(file);                                       
       
         // Gets the info and makes it an double
         PSVolt = Double.parseDouble(document.getElementsByTagName("PSvoltage").item(0).getTextContent());   
            
    public static void main (String args []) throws IOException, SAXException,   ParserConfigurationException, DOMException, TransformerException {
   
         try{
             read("robot.xml");               
         }catch (FileNotFoundException e){
             System.err.println("file not found");
         }
       
         try{
             write("file.xml");
         }catch (NullPointerException e){
             e.printStackTrace();
         }
       
         System.out.println("done");


The complete code can be found in the drop box folder.  In fact, the code is already in a folder that can be downloaded and imported into eclipse to work on.

Tuesday 9 April 2013

Buttons, XMLs and Due Dates

Now that all the planning is done we need to set some deadlines.  Actually, to be more specific it is not us who necessarily set the deadlines but the class (this is project we are doing for a class).  So, Monday, April 22, we will have a working program.  Obviously, the application will not be fully functional but the plan is to be able to open and close projects.  That means we need to finish the GUI and the outline of the other classes including the XML reader/writer.

Right now we are working on getting the GUI working.  The idea right now is to make a button class.  All the other GUI objects will just be derivatives of that.  Since we are using slick2d to make our program we don't have to make these buttons from scratch.  Slick has some interfaces for graphical user interfaces.  Also, slick provides a textfiled class with will be useful to allow the user to input values.

At the same time we are working on XML reading and writing.  That's not too bad as we are using DOM. 

Saturday 6 April 2013

G and G: The two tales of Git and GUI

While playing with the git repository for the project I broke it (kind of).  In any case, it became kind of useless so I made a new one.  You can find it here:

https://github.com/soapy1/SumoBotSimulator2013

On to more exciting news: we have a GUI design!  Here is one of our images.

As you can tell, the GUI we have in mind is very minimalistic.  This is because the application has to be able to run on our school computers which as a matter of fact are not very good.  Also, because we want to keep the application very simple and elegant.

In terms of making the image, we used MS paint, however, we will build the application using nifty and slick2d.  This means the details will change but we aim to keep the general "feel" the same.

All the images we made can be found in our drop box folder and we also provided a neat little document about the design.  As always, there are two versions of the document, one  is .doc and the other is .odt. 

Thursday 4 April 2013

SRS and Feasibility

This post is much over due and it contains our feasibility study and software requirement specification.  The feasibility study just outlines if the application is possible to complete - it is.  The software requirement specification outline the requirements needed in out application.
In the near future there will most probably many more documents so we have a new drop box folder.  Here it is:

https://www.dropbox.com/sh/i7ink6qvkzwsw0g/4288GMmQxl

Tuesday 2 April 2013

First Post

As the title of the blog implies, we will be developing a sumo bot simulator.  To clarify, a sumo bot is a robot that you use to push another robot out of an arena.  If you want a much better definition and more information on sumo bots you can check this website.

http://robogames.net/rules/all-sumo.php

The goal of our sumo bot simulator is to allow people to virtually build a sumo bot.  Why?  Because, as part of our school's grade 12 physics course you need to make a sumo bot.  So, as a computer science project and as dedicated nerds we decided to make an application to virtually build a that glorious machine.

If you want to see our code as we develop the application, we have a GitHub repository at:

https://github.com/soapy1/SumoBots



More information will be coming soon.


                                                                                    Courtesy of Parallax Inc


-The Codebusters Team