---
# System prepended metadata

title: RBFunc Challenge

---

# RBFunc Challenge
## Intro


For a smooth human-robot interaction, our team has developed a web interface. This is used during setup, maintenance and manual operation (remote control, error recovery, etc. ) of the robot.

**In this challenge, we would like you to implement a minimal version of our web interface**. Therefore, we provide you with a file containing real world robot data as well as some preimplemented rest-apis. For better understanding, you can find a visualization of the data [here]().

### Data
The data has the following structure
```js
{
    "data":[
        {
        "timestamp":1655898078.2488487,
        "pose":{
            "localisationScore":0.9909538626670837,
            "theta":-3.1413986682891846,
            "x":10.839167594909668,
            "y":3.1504876613616943
            },
        "laserfront":[
                {"x":3.5312788486480713,"y":-0.8318172693252563},
                ...
            ],
        "laserrear":[
                {"x":3.5312788486480713,"y":-0.8318172693252563},
                ...
            ]
        },
        ...
    ]
}
```
1. `timestamp` is in seconds since epoch
1. `x`, `y` are in meters
1. `theta` is in radians
1. `pose` is in the global coordinate system (CS)
1. `laserfront` & `laserrear` are in the CS of each respective sensor, therefore they have to be transformed in the global CS individually


The software should consist of two parts,
1. Front-End (Vue Js)
    - Connect to the backend and wait for data
    - Handle/Visualize incoming data
1. Backend (Python)
    - Serve front-end to the user
    - On connection, load data from file and stream it to the front-end in real time 
    - Provide any needed rest-apis for the front end
        - mounting positions of the laser sensors within the Robot-CS


Scanners and Robot-CS look like this 

![](https://i.ibb.co/5LHx0s3/image.png)

Please see the code below for an example of rest-apis to provide the mounting positions of the laser scanners in the Robot-CS. The values are the real position for the provided data:

```python
from flask import Flask
import json

app = Flask(__name__)


@app.route("/scanner_poses")
def get_scanner_poses():
    poses = {
        "pose_front": {'x': 0.3440000116825104, 'y': -0.3190000057220459, 'theta': 1.5707900524139404},
        "pose_rear": {'x': -0.3440000116825104, 'y': 0.3190000057220459, 'theta': -1.5707900524139404}
    }
    return json.dumps(poses)

@app.route("/robot_dimensions")
def get_dimensions():
    dim = {
        "length": 0.816,
        "width": 0.766
    }
    return json.dumps(poses)



app.run()
```


Your solution should ideally be implemented in Python and Vue. One working day may not be enough to accomplish everything in every detail. You are free to lay your focus as you like and to also skip some requirements or outline their solution in text. Finally, send your results via `.zip` or provide a link to an online location.
