terminate called after throwing an instance of ‘GeographicLib::GeographicErr‘

调试robot_localization,运行navsat_transform_node节点时遇到如下错误,大概意思是GPS的LLA坐标在转换为UTM数据的时候

调试robot_localization,运行navsat_transform_node节点时遇到如下错误,大概意思是GPS的LLA坐标在转换为UTM数据的时候,转换的结果超过了理论范围。

terminate called after throwing an instance of 'GeographicLib::GeographicErr'what():  Easting 59208.5km not in UTM range for N hemisphere [0km, 1000km]

原因:

排查了下GPS数据发现是正常的,于是去看了看robot_localization源码。发现有个配置参数use_local_cartesian默认是false。当use_local_cartesian=false时,会将LLA数据转换为UTM格式;当use_local_cartesian=true时,会将LLA数据转换为ENU格式。

解决方法:

很简单了,在相应的launch或yaml文件中将use_local_cartesian参数置为true即可。