## 3 Localisation of a City Bus with GNSS
### Hardware  
The used hardware consists of several components: a single-board computer, a CAN-USB adapter, two RTK GNSS receivers, and a GSM/LTE module. The general scheme of the system described in this section is presented in Figure 1.  
We decided to use UP Xtreme as the onboard computer, which is responsible for running the developed software and handling the data from the peripheral devices. The main tasks of this computer are processing the CAN messages, managing the data coming from the GNSS receivers, and handling the communication with the GNSS base station through the LTE module. During the docking manoeuvre, it also performs motion planning and control. The software running on this computer is described in more detail in Section 3.2. The main reason for the choice of this computer board is the x86 architecture Intel i5 CPU, which is more universal in terms of software installation than boards with ARM processors, such as Raspberry Pi or Odroid. The latter ones usually require a specific kernel and Linux version, while in the UP Xtreme case, we used the official Ubuntu 18.04 image as the operating system. What is more, the chosen board has a wide range of input voltage (12-60 V DC); thus, it can be powered directly from the bus without a need for any additional power supply units or DC-DC converters. The potential alternatives, that we considered, were the standard UP Board and UP Squared; however, their performance turned out to be significantly lower, which increased the time necessary to start the motion planner and GUI right before the manoeuvre. The CAN-USB adapter enables the connection to the CAN bus of a vehicle and is used to read its current state. The messages that we receive using the CAN bus include information about the steering angle, the velocity of a vehicle, and the state of the pantograph  
Figure 1: Hardware used in the ADAS system. The onboard computer performs all the calculations, the GNSS modules provide the position and heading of the bus, the CAN-USB adapter enables reading data from the sensors of a bus, the LTE module receives RTCM corrections over the network from the base station, and the LCD presents the system interface to the driver. (folded or raised). The first two variables are used to calculate the odometry of the bus, which is used by the motion planner in case of GNSS outage, while information about the pantograph state allowed us to confirm that the driver wants to dock to the charging station. The choice of CAN communication was dictated by the fact that all mentioned messages were already available on the CAN bus of the considered vehicle. The chosen CAN-USB adapter was produced by PEAK-System, and its advantage over different models is the galvanic isolation of the CAN connection, which assures that our system will not affect the normal operation of the bus in case of a failure. In the role of the RTK GNSS receivers, we use two u-blox ZED-F9P modules. The first of them, called _moving base_, provides the position of the bus, while the second one, called rover, is used to obtain information about its yaw angle (heading). That information is critical for our application, as it is used to determine the moment of system activation and also to plan the reference path that guides the driver during the whole manoeuvre. As GNSS modules require external antennas for the proper operation, they were mounted on the bus rooftop, as presented in Figure 2. This approach ensures that the antennas have a clear view of the sky and thus receive an undisturbed signal from the satellites. The first antenna was mounted 0.2 m ahead of the rear axle and is connected to the moving base receiver, while the second one is mounted 5 m in front of the first one and is connected to the rover module. The location of the GNSS antennas with respect to the coordinate system of the bus and synchronisation between the measurements from the GNSS and the internal bus sensors was obtained through offline calibration accomplished prior to the tests period.