## 3 Localisation of a City Bus with GNSS
### Software  
In terms of software, we utilise Ubuntu 18.04 and the ROS (Robot Operating System), which is a popular set of open-source libraries and tools used in many robotic applications. Its main advantage is flexibility, as every component of our system has a dedicated package that can be started and stopped independently when required. The architecture of the developed system is presented in Figure 3. All software components are implemented as ROS nodes, which enables easy communication between different packages. The first component is an NTRIP (Networked Transport of RTCM via Internet Protocol) client ([[https://github.com/LORD-MicroStrain/ntrip_client](https://github.com/LORD-MicroStrain/ntrip_client)]([https://github.com/LORD-MicroStrain/ntrip_client](https://github.com/LORD-MicroStrain/ntrip_client)), accessed on 3 July 2022), which is used to receive the RTCM correction using the LTE module connected to the onboard computer. As mentioned in Section 3.1, these corrections are received from an ASG-EUPOS internet-based service that provides the data from multiple GNSS base stations located in Poland. The NTRIP client task is therefore to connect to that service, receive the corrections, and then share that data with the GNSS driver. At the same time, the GNSS driver sends the RTCM messages to the _moving_base_ receiver so that it can enter the RTK mode. The driver is also responsible for reading the position and heading of the bus, which is sent by _moving_base_ and _rover_ modules accordingly. On the software level, it consists of two ROS packages that were modified for our purposes: _nunea_nvast_driver_ ([[https://github.com/ros-drivers/nunea_nvast_driver](https://github.com/ros-drivers/nunea_nvast_driver)]([https://github.com/ros-drivers/nunea_nvast_driver](https://github.com/ros-drivers/nunea_nvast_driver)), accessed on 3 July 2022) and _ublox_ ([[https://github.com/KumarRobotics/ublox](https://github.com/KumarRobotics/ublox)]([https://github.com/KumarRobotics/ublox](https://github.com/KumarRobotics/ublox)), accessed on 3 July 2022). The frequency of GNSS data is equal to 10 Hz for both position and heading, which is more than sufficient for the application of localisation in urban traffic. The CAN bridge reads the current state of the bus's internal sensors and then converts this information to ROS messages so that it can be easily used by the pose estimation and motion-planning packages. Our implementation is based on the _ros_canopen_ ([[https://github.com/ros-industrial/ros_canopen](https://github.com/ros-industrial/ros_canopen)]([https://github.com/ros-industrial/ros_canopen](https://github.com/ros-industrial/ros_canopen)), accessed on 3 July 2022) interface and uses the proprietary CAN messages provided by Solaris Bus & Coach S. A. The data obtained via the CAN interface are used to calculate the odometry of the bus and to determine the state of the pantograph. The localisation node calculates the bus pose relative to the charger based on the data from the GNSS driver and the predetermined global pose of the charger. As the position provided by the GNSS receivers is expressed in the form of (latitude, longitude, altitude) coordinates, we perform their conversion to the UTM (Universal Transverse Mercator) system with Cartesian coordinates.