Skip to content

Commit 7633d9e

Browse files
committed
Monitors/NavError: Added consume of VehicleState and decreased GpsFix acceptance threashold.
1 parent be3a9e2 commit 7633d9e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Monitors/NavError/Task.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,12 @@ namespace Monitors
8080
.description("Ignore start maneuver for DistTotal calculations.")
8181
.defaultValue("true");
8282

83+
setEntityState(IMC::EntityState::ESTA_NORMAL, Status::CODE_ACTIVE);
84+
8385
bind<IMC::DesiredPath>(this);
8486
bind<IMC::GpsFix>(this);
8587
bind<IMC::VehicleMedium>(this);
88+
bind<IMC::VehicleState>(this);
8689
}
8790

8891
//! Reserve entity identifiers.
@@ -108,6 +111,13 @@ namespace Monitors
108111
m_last_medium = *msg;
109112
}
110113

114+
void
115+
consume(const IMC::VehicleState* msg)
116+
{
117+
if(msg->op_mode == IMC::VehicleState::VS_CALIBRATION)
118+
m_distTotal.value = 0;
119+
}
120+
111121
void
112122
consume(const IMC::DesiredPath* msg)
113123
{
@@ -164,7 +174,7 @@ namespace Monitors
164174
// Check if we have valid Horizontal Accuracy index.
165175
if (msg->validity & IMC::GpsFix::GFV_VALID_HACC && msg->hacc > 20)
166176
return;
167-
else if (msg->hdop > 4)
177+
else if (msg->hdop > 2.5)
168178
return;
169179

170180
if(m_init)

0 commit comments

Comments
 (0)