WGS84 to LV95 Converter Documentation¶
Link to module repo: wgs84_to_lv95
1. Overview¶
The WGS84 to LV95 Converter module is responsible for bridging the gap between raw global satellite navigation data (WGS84) and the local metric coordinate system used by the mobile robot (LV95). It subscribes to u-blox sensor data and publishes a standardized geometry_msgs/PoseStamped.
2. Coordinate Systems¶
2.1 WGS84 (Input)¶
The Global Positioning System (GPS) provides coordinates in the World Geodetic System 1984 (WGS84).
- Type: Spherical coordinates.
- Units: Degrees (Latitude, Longitude) and Meters (Altitude).
- Topic: /fix (sensor_msgs/NavSatFix).
2.2 LV95 (Output)¶
The robot operates in the Swiss Terrestrial Reference Frame 1995 (LV95).
- Type: Cartesian projection (Metric).
- Units: Meters (East, North, Height).
- Topic: /gnss_pose.
The projection uses the Approximate formulas for the transformation between Swiss projection coordinates and WGS84 provided by swisstopo.
Reference Point (Bern): - Easting (\(y\)): 2,600,000 m - Northing (\(x\)): 1,200,000 m
3. Orientation & Heading Logic¶
The u-blox ZED-F9P module (in moving base configuration) provides a precise relative heading vector. However, the coordinate conventions differ between the sensor and ROS 2 standard.
3.1 Frame Conversion¶
| System | 0° Reference | Rotation Direction | Frame Name |
|---|---|---|---|
| u-blox (Sensor) | North | Clockwise (CW) | NED (North-East-Down) |
| ROS 2 (Robot) | East | Counter-Clockwise (CCW) | ENU (East-North-Up) |
Conversion Formula: \(\theta_{ROS} = \frac{\pi}{2} - \theta_{u-blox}\)
3.2 Robustness Strategy (Signal Loss)¶
The node implements a "Last Known Value" strategy to handle temporary signal degradation:
1. Valid Signal: If the rel_pos_heading_valid flag is true, the internal heading state is updated.
2. Invalid Signal: If the flag is false (e.g., multipath error or occlusion), the node retains the last valid heading.
- This prevents the robot's orientation from snapping to 0° (East) during short signal dropouts.
- This ensures a continuous and stable control signal for downstream path followers.
4. Node Architecture¶
The node uses a decoupled Timer-based architecture rather than a purely event-driven one.
- Frequency: 20 Hz
- Behavior:
- Callbacks for
/fixand/ubx_nav_rel_pos_nedonly update internal member variables. - A dedicated timer loop constructs and publishes the
PoseStampedat a constant rate. - This acts as a Zero-Order Hold (ZOH) for the control loop, ensuring consistent data availability even if the sensor update rate fluctuates.
- Callbacks for