Running S2017 Monster Winner java code with simulator

11 posts / 0 new
Last post
Iwan Nijs - de Boer
Running S2017 Monster Winner java code with simulator

Hi,

I just found out about Formula Pi a week ago and will probably give it a try to compete in the summer 2018 races.

To get a feeling for coding for Formula Pi, I have taken the code bases of 'monster', 'S2017-grand-pi-winner' and 'S2017-monster-winner'.
I've managed to get the python variants running, on my Windows 10 laptop, with the Simulator.

For the winning Monster code of last summer, which is written in java, I can't seem to find the 'SimulationFull.py' equivalent.
In the 'Formula.sh' file, the last line, which is commented out, looks like it is meant to be used to start in simulation mode.
When I try to start like that, the 'de.webtuples.formulapi.SimulationFull' can't be found.
However, I can't find that class or the java source in the code I have available.

What can I do to get this code started in simulation mode?

Kind regards,
Iwan

dinotoo
Running S2017 Monster Winner java code with simulator

Useless comment

dinotoo
Running S2017 Monster Winner java code with simulator

Hum, interresting, I think they didn't publish SimulationFull.java..... is it regular ?

Arron Churchill
Arron Churchill's picture
Code as submitted

The code on SourceForge is exactly as submitted for the final :)
I am guessing they stripped out anything unnecessary to keep things simple.

I have sent the lambda.p.racing team an email to see if they still have the file and are happy to share it.

dinotoo
cool code BTW ^^

//reboot while race ongoing?
File raceStartedFile = new File("/home/pi/formulapi/logs/raceStarted");
if (raceStartedFile.exists()){
logger.info("raceStarted-file detected");
Globals.setImageMode(ImageMode.FOLLOW_TRACK);
}
else {

Globals.setImageMode(WAIT_FOR_LIGHTS);
}

Thomas
Thanks. :) Was necessary...

Thanks. :) Was necessary...

jorgealvaro
jorgealvaro's picture
Thanks

Thanks! I hope we don't need it again, but in case we are restarted again I'm adding it.

Cheers!

Thomas
SimulationFull Class

I haven’t provided the SimulationFull Class because I have stopped using it after Race 3 I think. But I’ve mailed the latest version to Arron today.

Summer 2017:
Race 1: Python (Java not ready)
Race 2, Race 3: Java, but massive problems (see videos). I haven’t seen these problems in the simulation
Rest of season: Java

Winter 2018:
Challenge 1, Race 1: Python

My test setup after Race 3 (Summer 17): small method based tests and the final test with cam, PicoBorg Reverse and monitor playing the image-sequence video.

Further problems with the simulation:
- no collisions possible
- track is too clean. My stuck detection detects false positives
- reimplementation of FLIPPED not testable in simulation
- problem with current track position. There is a big gap between the simulation values and the real track (till now I didn’t investigate on this). Plan is to replace it completely in Summer 18.

I will provide slides in about 2 weeks with more information.

Iwan Nijs - de Boer
Thank you for the SimulationFull class and explanation

Hi Thomas,

thank you very much for getting back so quickly with the SimulationFull class and the explanation of the status of the code.

Kind regards,
Iwan

Arron Churchill
Arron Churchill's picture
Files checked in

I have checked the source files Thomas sent me into the SourceForge branch. If you checked out the code using git you should be able to grab the extra files using git pull.

I have had a brief look at the source and it seems easy enough too understand. Remember to correct the IP address on this line in SiimulationFull.java:

    public static String simulationIP = "10.0.1.5"; //Address of the machine running the simulation

Hopefully it will work as-is, but we have been warned that it has not been tested with that version of the code and may need some small changes :)

Iwan Nijs - de Boer
Happy the files have been made available

When I have some time, I will see if I can get the simulation going.

Thank you Arron.

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre>
  • Syntax highlight code surrounded by the <pre class="brush: lang">...</pre> tags, where lang is one of the following language brushes: bash, cpp, perl, python.
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Comment Images
Files must be less than 10 MB.
Allowed file types: png gif jpg jpeg.
Comment Attachments
Files must be less than 10 MB.
Allowed file types: txt pdf nfo doc docx rtf jpg png gif bmp zip tar gz csv xls.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.