Applying for: Babelfish
We set out with no clear goal of using many programming languages. We knew we would be using Python for most of our backend code, and then a second language for our mobile app, but as our SmartHjelm developed we started using more programming languages. Here we will go through them and what we are using them for.
Python
Python is our main programming language. Most of the interaction with the Raspberry Pi happens through Python, and we have written APIs using Flask to communicate with our components such as the mobile app, and scripts to trigger events such as breaking light and sound.

Swift
Our mobile app for iOS is written in Swift. Our mobile app provides the rear view through the rear view camera, weather and speed info, and you can also turn on the turn signals integrated in the helmet using the app.

JavaScript
From the camera on the Raspberry Pi we get only raw images. To make a movie that is then sent to our iOS app, we use JavaScript. The script takes these raw images and converts them to an mpg video.

Bash
Google Assistant is integrated in our SmartHjelm. The client runs on the Raspberry Pi, and launching it directly via the terminal is rather cumbersome. We have therefore written a Bash script to ease launching Google Assistant.

Painless
Our final programming language is an obscure one. All our APIs provide data in SI units. This data is sent to Elasticsearch for storage, and shown in a Kibana dashboard which is hooked up to Elasticsearch. However, when looking at this data in the dashboard, looking at temperatures in Kelvin and pressures in Pascals is rather awkward. Temperatures and pressures are therefore converted to degrees C and bar. Much easier for us to read. This conversion is done at ingestion time in Elasticsearch through a script. Elasticsearch has its own scripting language called Painless, and the conversion code is written in this language. Not a lot of code, but makes our dashboard a lot more user friendly.

