## 3 Localisation of a City Bus with GNSS
### Software
For that purpose, we utilise the _gps_common_ ([[https://github.com/swri-robotics/gps_umd/tree/master/gps_common](https://github.com/swri-robotics/gps_umd/tree/master/gps_common)]([https://github.com/swri-robotics/gps_umd/tree/master/gps_common](https://github.com/swri-robotics/gps_umd/tree/master/gps_common)), accessed on 3 July 2022)package along with the _Eigen_ ([[https://eigen.tuxfamily.org/index.php?title=Main_Page](https://eigen.tuxfamily.org/index.php?title=Main_Page)]([https://eigen.tuxfamily.org/index.php?title=Main_Page](https://eigen.tuxfamily.org/index.php?title=Main_Page)), accessed on 3 July 2022) library that allows us to perform all the required transformations between the local frames of a bus and to calculate its pose in relation to a charging station. That pose is further used by the system activation node, which starts the motion-planning system right before the docking manoeuvre, as described later in this section. The last software components are the path planner and feedback controller that generate the reference path and guide the driver to the charging station. Their principle of operation is described in more detail in Sections 4.3 and 4.4 accordingly. One of the important prerequisites for the ADAS supporting drivers of the public buses formulated by the bus fleet operator was that under no circumstances should the system require the driver's attention, such as by having to set or change any parameters. This requirement was motivated by safety considerations. Therefore, the system starts automatically when the driver turns on the ignition key of the bus. After the onboard computer boots up, it starts the GNSS localisation software that from this moment is running in the background. At this time, the monitor in the driver's cabin remains off in order not to distract the driver. When the bus approaches the selected location (during the tests at the Garbary PKM depot), at a distance of 55 m from the charger, the system launches another package that is responsible for the path planning and calculation of a steering angle. This package is launched slightly in advance so that the motion planner and graphical interface have enough time to start. In the meantime, the monitor for the driver turns on, and at the distance of 35 m, the system should be ready to use. As the position of a bus is calculated in relation to a charger, all these conditions, which are based on the distance, can be easily verified and tested. They can also be simply modified for different depots and charging stations when necessary. What is more, some additional checks are also performed in order to prevent undesired activation of a system, for example, when approaching the depot from the opposite side. From this point on, after all the packages are launched successfully, the driver can follow the displayed steering suggestions as described in more detail in Section 5. The system will turn off automatically when the bus stops under the charger and also if it detects that the driver is making another manoeuvre, such as driving the bus across the depot with no intention of docking. The system will also deactivate when the bus is more than 60 m from the charger, regardless of the manoeuvres taken by the driver. This condition is redundant; however, it assures that the system will be ready for operation during the next approach. Figure 3: The architecture of the developed system. The software components were implemented as the following ROS nodes: NTRIP client, GNSS driver, CAN bridge, localisation node, system activation node, path planner, and feedback controller.