Libraries

20 posts / 0 new
Last post
jorgealvaro
jorgealvaro's picture
Libraries

Hi all,

I hope your code deals with cars stopped in the start line because I think that's what our car is going to do in test session 2 :p

We used some libraries in our code and we forgot to ask this before: What should we do to include some libraries? Can we request for them to be installed or should we include them as if they were part of our code?

Thanks,
RasPerras del Infierno

piborg
piborg's picture
Libraries

The standard code should try and drive around the obstacle, we will see if this works on race day :)

If you are including additional libraries not included in our standard SD card image then you have two options listed below.

As this is just a testing round we should be able to take a late submission from you as long as it is before Monday if you want to try and sort the libraries out.
If you do send us an email to info@formulapi.com to let us know we need to rebuild the SD card for your entry.

1. Include them in your code

If they can be placed in the ~/formulapi directory with the rest of the Race Code then they can be uploaded as a part of your code.

The easiest way to test this is to create a standard image following our Standard Formula Pi SD card image instructions.
Once you have done that copy your code into the ~/formulapi directory and check if everything works.

2. Send us a pre-setup SD card

If the libraries you are using need to be correctly setup or are very large it is probably better to setup your own SD card and mail it to us.
This will allow you to setup the SD card however you like :)

What we will do is overwrite the ~/formulapi directory with your FTP upload and empty the ~/formulapi/logs directory each round.
This allows you to still make changes even if you send us a custom SD card.

jorgealvaro
jorgealvaro's picture
Re: Libraries

Thanks! We have uploaded the new version which only adds the library as part of the code.

Let's hope it works :) See you later in the streaming!
RasPerras del Infierno

piborg
piborg's picture
Updated code

Okay, we have re-written the SD card with your new upload, we will see how everything goes later on :)

jorgealvaro
jorgealvaro's picture
Re: Updated code

Sorry again!

Please, please, use the recently uploaded version if possible! We had done some more tests and the neural network in the previous file was wrong :( I've recovered the one from the original submission.

Sorry for the inconvenience and thanks again!

piborg
piborg's picture
Re-uploaded :)

No problem, we have time to re-write the card again :)

I will let you know when it has been done.

jorgealvaro
jorgealvaro's picture
:)

:) Thanks!

piborg
piborg's picture
Updated SD card

Your latest FTP upload has now been written to the SD card.

jorgealvaro
jorgealvaro's picture
Possible alternative for dependencies?

Hi,

We are still fighting with including our libraries as part of the submission :-s

Would it be possible to send one "apt-get install a b c" command to run on our SD card?

Thanks,
Jorge

piborg
piborg's picture
Libraries

We could try making a custom SD card load for you here.
We cannot really make it part of the normal process as the SD card is imaged offline.

What was the apt-get line you need to run?

jorgealvaro
jorgealvaro's picture
python-scipy

This would do for us. The rest of the dependencies can be included in the zip file.

sudo apt-get install python-scipy

Thanks!
Jorge

piborg
piborg's picture
Custom SD card

Okay, I will setup a custom SD card for you with python-scipy installed.

Have you uploaded a version we can test to see if it works correctly?

jorgealvaro
jorgealvaro's picture
Test file uploaded

Hi,

We have uploaded a file just now. We really hope this one works if scipy is installed. We'll maybe update some update before the deadline, but the usage of the libraries shouldn't change much from now.

Thanks!
Jorge

piborg
piborg's picture
Test file

The test file is not decompressing properly:
gzip: stdin: invalid compressed data--format violated

Is it possible the file was uploaded in ASCII mode instead of binary mode?

jorgealvaro
jorgealvaro's picture
ooops

I uploaded again. It could be the binary setting, I forgot it before. Today filezilla decided not to connect to the ftp server, and we reviewed the file manually so we didn't use the fpi-upload script.

Sorry about that :(
Jorge

piborg
piborg's picture
Success

That version unpacked and ran successfully :)

Cannot wait to see how it does on race day.

jorgealvaro
jorgealvaro's picture
Good!

Finally! Thanks so much!

Now it's time to optimize the neural network and so on. We have lots of work to do there too!

Cheers,
Jorge

Geoff Riley
Geoff Riley's picture
Neural nets... Wow!!

Good luck Jorge... I'm really looking forward to seeing how your car performs with a neural net as the driving force: that should be awesome!

Geoff

jorgealvaro
jorgealvaro's picture
It didn't go so well :(

If you saw the race: we have lots of work to do. We think the current version takes too long per image and that makes it turn too much... In the simulator and running in a laptop (faster than the pi zero) it worked fine though.

Let's see if it gets better in the next races!

Geoff Riley
Geoff Riley's picture
Not right back to the drawing board...

Hi Jorge,

Yes I saw the race, and I think that most of us saw unexpected happenings as we gazed at those heats.

I might have done apparently well on my heat, but working through the logs and image captures that I got back I realised that my car had come to a premature halt because it thought that it had completed 23 laps! Extra laps occur particularly when a collision with another vehicle happens: anything that causes the camera to tilt down towards the track has the start line detection picking up the red track as a false start line. I did get enough information to know that some of the algorithms I was trying to use were definately bad choices, so there's be quite a few changes before the next round.

As for your neural nets, have you tried running some timing trials on a PiZero to check what sort of time you're getting? I have to admit that it did cross my mind to wonder how you were achieving a good turn around, because when I've modelled any nets they generally get pretty intensive in the calculations. I'm guessing that you're creating the actual net in Python and using the SciPy library functions for the number crunching.

If it needs speeding up, have you considered implementing the full net processing in Fortran or C?

Purely a suggestion made out of ignorance! :-)

Good luck to everyone!

Kind regards,
Geoff

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.