This project generates
/gnss_posefrom GNSS/NMEA data, transforms it into the map frame, and can be integrated with modules such asndt_matching.
- Subscribes:
/nmea_sentence(from serial GNSS receiver) - Publishes:
/gnss_pose(geometry_msgs/PoseStamped, frame =map) - Key modifications:
- Supports GNRMC messages and integrates
yaw_(heading). - Supports plane selection (Plane 13 = NTUT Ningxin Park in Taipei).
- Supports GNRMC messages and integrates
- Subscribes:
/fix(sensor_msgs/NavSatFix) - Publishes:
/gnss_pose - Function: Converts GNSS Fix directly into pose in the map frame.
Converts latitude/longitude (WGS84) → local Cartesian coordinates (x,y,z).
-
geo_pos_conv_SPIE.cpp- Implements the complete Transverse Mercator projection (rigorous mathematical formulas for converting from the Earth ellipsoid to a planar Cartesian coordinate system).
- High accuracy, suitable for large-area use.
-
geo_pos_conv_mydicoor.cpp- Uses a linear approximation:
m_x = (m_lat - m_PLato) * 110773.52... m_y = (m_lon - m_PLo) * 100914.35... m_z = 0
- Suitable for small local areas (e.g., campus/test field), with lower computation cost.
- Limitation: Errors increase with distance from the origin.
- Uses a linear approximation:
Recommendation:
- Large-scale, multi-location tests → use
SPIE - Small-area quick demos →
mydicooris sufficient
- CMake 3.10+
- C++17 compiler
- (For ROS1 build)
roscpp,sensor_msgs,geometry_msgs,tf,nmea_msgs
⚠️ Note: Please rename the correspondingCMakeLists.*.txtfile toCMakeLists.txtbefore building.
mv CMakeLists.catkin.txt CMakeLists.txt # rename
# package.xml must also be placed in the root directory
cd ~/catkin_ws/src
ln -s /path/to/GNSS-Localizer .
cd ..
catkin_make
source devel/setup.bash
rosrun gnss_localizer nmea2tfposemv CMakeLists.cmake.txt CMakeLists.txt # rename
mkdir -p build && cd build
cmake ..
make -j
./gnss_localizer-
- Launch the Serial GNSS node that publishes
/nmea_sentence. - Launch the
nmea2tfposenode with parameterplane: 13(Ningxin Park). - In
ndt_matching:- Set the initial pose (
initial_pos) tognss. - Adjust the
fitness_scorethreshold to 1.0 (default 500 is not suitable for RTK-GPS precision).
- Set the initial pose (
- Use
rqt_tf_treeto verify the TF structure.
- Launch the Serial GNSS node that publishes
GNSS-Localizer/
├── .gitattributes
├── .gitignore
├── LICENSE
├── CMakeLists.catkin.txt
├── CMakeLists.cmake.txt
├── package.xml
├── images
│ └── rqt_graph.png
├── gnss/
│ ├── geo_pos_conv_mydicoor.cpp # Simplified local coordinate conversion
│ └── geo_pos_conv_SPIE.cpp # Accurate projection-based conversion
└── gnss_localizer/
├── fix2tfpose/
│ └── fix2tfpose.cpp # GNSS Fix → TF Pose
└── nmea2tfpose/
└── nmea2tfpose_core_SPIE.cpp # NMEA Sentence → Pose