+
+ // Calculate heading bug error normalized to +/- 180.0
+ double heading_bug = _heading_bug_node->getDoubleValue();
+ double diff = heading_bug - heading;
+
+ SG_NORMALIZE_RANGE(diff, -180.0, 180.0);
+ _heading_bug_error_node->setDoubleValue( diff );