correcao final eixos imu, incluido retries no envio de dados can
This commit is contained in:
parent
d7ad726102
commit
69e87c3f20
|
|
@ -531,6 +531,11 @@
|
||||||
this.label36 = new System.Windows.Forms.Label();
|
this.label36 = new System.Windows.Forms.Label();
|
||||||
this.txtMomento = new System.Windows.Forms.TextBox();
|
this.txtMomento = new System.Windows.Forms.TextBox();
|
||||||
this.btnPlay = new System.Windows.Forms.Button();
|
this.btnPlay = new System.Windows.Forms.Button();
|
||||||
|
this.pnlOrientacaoDados = new System.Windows.Forms.Panel();
|
||||||
|
this.label146 = new System.Windows.Forms.Label();
|
||||||
|
this.label147 = new System.Windows.Forms.Label();
|
||||||
|
this.txtImuFrontal = new System.Windows.Forms.TextBox();
|
||||||
|
this.txtImuLateral = new System.Windows.Forms.TextBox();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.trbMomento)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.trbMomento)).BeginInit();
|
||||||
this.panel1.SuspendLayout();
|
this.panel1.SuspendLayout();
|
||||||
this.tabControl4.SuspendLayout();
|
this.tabControl4.SuspendLayout();
|
||||||
|
|
@ -584,6 +589,7 @@
|
||||||
this.pnlUltrassom.SuspendLayout();
|
this.pnlUltrassom.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.picRobo)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.picRobo)).BeginInit();
|
||||||
this.tabOrientacao.SuspendLayout();
|
this.tabOrientacao.SuspendLayout();
|
||||||
|
this.pnl3D.SuspendLayout();
|
||||||
this.tabSonar.SuspendLayout();
|
this.tabSonar.SuspendLayout();
|
||||||
this.tabControl3.SuspendLayout();
|
this.tabControl3.SuspendLayout();
|
||||||
this.tabSonarRGB.SuspendLayout();
|
this.tabSonarRGB.SuspendLayout();
|
||||||
|
|
@ -610,6 +616,7 @@
|
||||||
this.panel6.SuspendLayout();
|
this.panel6.SuspendLayout();
|
||||||
this.pnlInformacoesOperacao.SuspendLayout();
|
this.pnlInformacoesOperacao.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.picCameraCaminho)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.picCameraCaminho)).BeginInit();
|
||||||
|
this.pnlOrientacaoDados.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// trbMomento
|
// trbMomento
|
||||||
|
|
@ -4117,6 +4124,7 @@
|
||||||
//
|
//
|
||||||
// pnl3D
|
// pnl3D
|
||||||
//
|
//
|
||||||
|
this.pnl3D.Controls.Add(this.pnlOrientacaoDados);
|
||||||
this.pnl3D.Location = new System.Drawing.Point(5, 5);
|
this.pnl3D.Location = new System.Drawing.Point(5, 5);
|
||||||
this.pnl3D.Margin = new System.Windows.Forms.Padding(2);
|
this.pnl3D.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.pnl3D.Name = "pnl3D";
|
this.pnl3D.Name = "pnl3D";
|
||||||
|
|
@ -5908,6 +5916,51 @@
|
||||||
this.btnPlay.UseVisualStyleBackColor = true;
|
this.btnPlay.UseVisualStyleBackColor = true;
|
||||||
this.btnPlay.Click += new System.EventHandler(this.btnPlay_Click);
|
this.btnPlay.Click += new System.EventHandler(this.btnPlay_Click);
|
||||||
//
|
//
|
||||||
|
// pnlOrientacaoDados
|
||||||
|
//
|
||||||
|
this.pnlOrientacaoDados.Controls.Add(this.txtImuLateral);
|
||||||
|
this.pnlOrientacaoDados.Controls.Add(this.txtImuFrontal);
|
||||||
|
this.pnlOrientacaoDados.Controls.Add(this.label147);
|
||||||
|
this.pnlOrientacaoDados.Controls.Add(this.label146);
|
||||||
|
this.pnlOrientacaoDados.Location = new System.Drawing.Point(1, 362);
|
||||||
|
this.pnlOrientacaoDados.Name = "pnlOrientacaoDados";
|
||||||
|
this.pnlOrientacaoDados.Size = new System.Drawing.Size(150, 150);
|
||||||
|
this.pnlOrientacaoDados.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// label146
|
||||||
|
//
|
||||||
|
this.label146.AutoSize = true;
|
||||||
|
this.label146.Location = new System.Drawing.Point(3, 16);
|
||||||
|
this.label146.Name = "label146";
|
||||||
|
this.label146.Size = new System.Drawing.Size(39, 13);
|
||||||
|
this.label146.TabIndex = 1;
|
||||||
|
this.label146.Text = "Frontal";
|
||||||
|
//
|
||||||
|
// label147
|
||||||
|
//
|
||||||
|
this.label147.AutoSize = true;
|
||||||
|
this.label147.Location = new System.Drawing.Point(3, 71);
|
||||||
|
this.label147.Name = "label147";
|
||||||
|
this.label147.Size = new System.Drawing.Size(39, 13);
|
||||||
|
this.label147.TabIndex = 2;
|
||||||
|
this.label147.Text = "Lateral";
|
||||||
|
//
|
||||||
|
// txtImuFrontal
|
||||||
|
//
|
||||||
|
this.txtImuFrontal.Location = new System.Drawing.Point(6, 32);
|
||||||
|
this.txtImuFrontal.Name = "txtImuFrontal";
|
||||||
|
this.txtImuFrontal.Size = new System.Drawing.Size(100, 20);
|
||||||
|
this.txtImuFrontal.TabIndex = 1;
|
||||||
|
this.txtImuFrontal.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
|
||||||
|
//
|
||||||
|
// txtImuLateral
|
||||||
|
//
|
||||||
|
this.txtImuLateral.Location = new System.Drawing.Point(6, 87);
|
||||||
|
this.txtImuLateral.Name = "txtImuLateral";
|
||||||
|
this.txtImuLateral.Size = new System.Drawing.Size(100, 20);
|
||||||
|
this.txtImuLateral.TabIndex = 3;
|
||||||
|
this.txtImuLateral.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
|
||||||
|
//
|
||||||
// frmResultadosOperacao
|
// frmResultadosOperacao
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
|
@ -6007,6 +6060,7 @@
|
||||||
this.pnlUltrassom.ResumeLayout(false);
|
this.pnlUltrassom.ResumeLayout(false);
|
||||||
((System.ComponentModel.ISupportInitialize)(this.picRobo)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.picRobo)).EndInit();
|
||||||
this.tabOrientacao.ResumeLayout(false);
|
this.tabOrientacao.ResumeLayout(false);
|
||||||
|
this.pnl3D.ResumeLayout(false);
|
||||||
this.tabSonar.ResumeLayout(false);
|
this.tabSonar.ResumeLayout(false);
|
||||||
this.tabSonar.PerformLayout();
|
this.tabSonar.PerformLayout();
|
||||||
this.tabControl3.ResumeLayout(false);
|
this.tabControl3.ResumeLayout(false);
|
||||||
|
|
@ -6042,6 +6096,8 @@
|
||||||
this.pnlInformacoesOperacao.ResumeLayout(false);
|
this.pnlInformacoesOperacao.ResumeLayout(false);
|
||||||
this.pnlInformacoesOperacao.PerformLayout();
|
this.pnlInformacoesOperacao.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.picCameraCaminho)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.picCameraCaminho)).EndInit();
|
||||||
|
this.pnlOrientacaoDados.ResumeLayout(false);
|
||||||
|
this.pnlOrientacaoDados.PerformLayout();
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
this.PerformLayout();
|
this.PerformLayout();
|
||||||
|
|
||||||
|
|
@ -6527,5 +6583,10 @@
|
||||||
private System.Windows.Forms.Label lblVentilacaoRLOUT;
|
private System.Windows.Forms.Label lblVentilacaoRLOUT;
|
||||||
private System.Windows.Forms.Label lblVentilacaoRLIN;
|
private System.Windows.Forms.Label lblVentilacaoRLIN;
|
||||||
private System.Windows.Forms.Label lblVentilacaoTemperatura;
|
private System.Windows.Forms.Label lblVentilacaoTemperatura;
|
||||||
|
private System.Windows.Forms.Panel pnlOrientacaoDados;
|
||||||
|
private System.Windows.Forms.TextBox txtImuLateral;
|
||||||
|
private System.Windows.Forms.TextBox txtImuFrontal;
|
||||||
|
private System.Windows.Forms.Label label147;
|
||||||
|
private System.Windows.Forms.Label label146;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1169,6 +1169,8 @@ namespace AgroBase.Forms.Operacoes
|
||||||
|
|
||||||
AtualizarInformacoesSonar();
|
AtualizarInformacoesSonar();
|
||||||
|
|
||||||
|
AtualizarInformacoesIMU();
|
||||||
|
|
||||||
AtualizarInformacoesCPU();
|
AtualizarInformacoesCPU();
|
||||||
|
|
||||||
AtualizarInformacoesComandos();
|
AtualizarInformacoesComandos();
|
||||||
|
|
@ -1666,6 +1668,13 @@ namespace AgroBase.Forms.Operacoes
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void AtualizarInformacoesIMU()
|
||||||
|
{
|
||||||
|
var imu = LogsIMU[idxMomentoAtual];
|
||||||
|
txtImuFrontal.Text = imu.PitchSeguro.ToString("0.00");
|
||||||
|
txtImuLateral.Text = imu.RollSeguro.ToString("0.00");
|
||||||
|
}
|
||||||
|
|
||||||
private void AtualizarInformacoesCameraCaminho()
|
private void AtualizarInformacoesCameraCaminho()
|
||||||
{
|
{
|
||||||
double? CalcularErroLateralPctImagem(int width, List<double?[]> centrosCorredor)
|
double? CalcularErroLateralPctImagem(int width, List<double?[]> centrosCorredor)
|
||||||
|
|
|
||||||
|
|
@ -819,8 +819,8 @@ namespace AgroBase.Models.Operacoes
|
||||||
Imu = new OperacaoSensoriamentoLogImuModel
|
Imu = new OperacaoSensoriamentoLogImuModel
|
||||||
{
|
{
|
||||||
Iniciado = sen?.IMU?.Iniciado ?? false,
|
Iniciado = sen?.IMU?.Iniciado ?? false,
|
||||||
InclinacaoFrontal = sen?.IMU?.RollSeguro ?? 0,
|
InclinacaoFrontal = sen?.IMU?.PitchSeguro ?? 0,
|
||||||
InclinacaoLateral = sen?.IMU?.PitchSeguro ?? 0,
|
InclinacaoLateral = sen?.IMU?.RollSeguro ?? 0,
|
||||||
Rotacao = sen?.IMU?.YawSeguro ?? 0
|
Rotacao = sen?.IMU?.YawSeguro ?? 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -926,8 +926,8 @@ namespace AgroBase.Models
|
||||||
{ TipoMovimentoDirecional.MovimentoLateral, 90 },
|
{ TipoMovimentoDirecional.MovimentoLateral, 90 },
|
||||||
{ TipoMovimentoDirecional.Diagnostico, 25 },
|
{ TipoMovimentoDirecional.Diagnostico, 25 },
|
||||||
};
|
};
|
||||||
public static double AnguloInclinacaoRollMax { get; set; } = 30.0; // Frontal 40 graus max
|
public static double AnguloInclinacaoRollMax { get; set; } = 22.0; // Lateral
|
||||||
public static double AnguloInclinacaoPitchMax { get; set; } = 22.0; // Lateral
|
public static double AnguloInclinacaoPitchMax { get; set; } = 30.0; // Frontal 40 graus max
|
||||||
public static string VozAlerta { get; set; } = "Microsoft Maria Desktop";
|
public static string VozAlerta { get; set; } = "Microsoft Maria Desktop";
|
||||||
public static bool Pronto => Variaveis.OperacaoEmAndamento?.Parametros?.Controle != null;
|
public static bool Pronto => Variaveis.OperacaoEmAndamento?.Parametros?.Controle != null;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -207,6 +207,7 @@ namespace AgroBase.Services
|
||||||
|
|
||||||
public bool ContabilizarTimeoutHealth { get; set; } = true;
|
public bool ContabilizarTimeoutHealth { get; set; } = true;
|
||||||
public bool MensagemDescoberta { get; set; } = false;
|
public bool MensagemDescoberta { get; set; } = false;
|
||||||
|
public int TentativasEnvio { get; set; } = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CanCommandFreqModel<T>
|
public class CanCommandFreqModel<T>
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,9 @@ namespace AgroBase.Services
|
||||||
private readonly ConcurrentDictionary<string, long> _timeoutsRespostaPorDispositivo = new ConcurrentDictionary<string, long>();
|
private readonly ConcurrentDictionary<string, long> _timeoutsRespostaPorDispositivo = new ConcurrentDictionary<string, long>();
|
||||||
private readonly ConcurrentDictionary<string, long> _timeoutsRespostaPorChave = new ConcurrentDictionary<string, long>();
|
private readonly ConcurrentDictionary<string, long> _timeoutsRespostaPorChave = new ConcurrentDictionary<string, long>();
|
||||||
|
|
||||||
|
private readonly List<T_Code> DispositivosRetries = new List<T_Code>() { T_Code.Oid, T_Code.Bat };
|
||||||
|
private const int MAX_TENTATIVAS_RETRIES = 2;
|
||||||
|
|
||||||
public Dictionary<string, long> TimeoutsRespostaPorId => _timeoutsRespostaPorId.ToDictionary(x => x.Key, x => x.Value);
|
public Dictionary<string, long> TimeoutsRespostaPorId => _timeoutsRespostaPorId.ToDictionary(x => x.Key, x => x.Value);
|
||||||
public Dictionary<string, long> TimeoutsRespostaPorDispositivo => _timeoutsRespostaPorDispositivo.ToDictionary(x => x.Key, x => x.Value);
|
public Dictionary<string, long> TimeoutsRespostaPorDispositivo => _timeoutsRespostaPorDispositivo.ToDictionary(x => x.Key, x => x.Value);
|
||||||
public Dictionary<string, long> TimeoutsRespostaPorChave => _timeoutsRespostaPorChave.ToDictionary(x => x.Key, x => x.Value);
|
public Dictionary<string, long> TimeoutsRespostaPorChave => _timeoutsRespostaPorChave.ToDictionary(x => x.Key, x => x.Value);
|
||||||
|
|
@ -575,6 +578,7 @@ namespace AgroBase.Services
|
||||||
|
|
||||||
msg.Enviado = true;
|
msg.Enviado = true;
|
||||||
msg.EnviadoEm = DateTime.Now;
|
msg.EnviadoEm = DateTime.Now;
|
||||||
|
msg.TentativasEnvio++;
|
||||||
_ultimoIdEnviado = msg.IdTx;
|
_ultimoIdEnviado = msg.IdTx;
|
||||||
_tokens -= 1;
|
_tokens -= 1;
|
||||||
sent++;
|
sent++;
|
||||||
|
|
@ -1076,6 +1080,18 @@ namespace AgroBase.Services
|
||||||
|
|
||||||
foreach (var item in timeouts)
|
foreach (var item in timeouts)
|
||||||
{
|
{
|
||||||
|
if (DispositivosRetries.Contains(item.Dispositivo) && item.TentativasEnvio < MAX_TENTATIVAS_RETRIES)
|
||||||
|
{
|
||||||
|
// Rearma a MESMA transação para um retry.
|
||||||
|
item.Enviado = false;
|
||||||
|
item.EnviadoEm = DateTime.MinValue;
|
||||||
|
|
||||||
|
MostrarLog($"Retry rápido OID | tentativa={item.TentativasEnvio + 1}/{MAX_TENTATIVAS_RETRIES} | {TimeoutChave(item)}", item.IdRx);
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Só chega aqui se realmente esgotou as tentativas.
|
||||||
RegistrarTimeoutResposta(item);
|
RegistrarTimeoutResposta(item);
|
||||||
MensagensPendentes.Remove(item);
|
MensagensPendentes.Remove(item);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ class CameraMultispectral:
|
||||||
nome_sensor=f"{self.modelo}_imu",
|
nome_sensor=f"{self.modelo}_imu",
|
||||||
modo=self.imu_modo,
|
modo=self.imu_modo,
|
||||||
gyro_unidade="deg_s",
|
gyro_unidade="deg_s",
|
||||||
referencial_robo="p,-y,-r",
|
referencial_robo="r,p,y",
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self.tem_imu = False
|
self.tem_imu = False
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,10 @@ class CameraIMU(ModuloDiagnosticoBase):
|
||||||
|
|
||||||
# Limites principais vindos do equipamento.
|
# Limites principais vindos do equipamento.
|
||||||
# No rover:
|
# No rover:
|
||||||
# roll = inclinação frontal
|
# roll = inclinação lateral
|
||||||
# pitch = inclinação lateral
|
# pitch = inclinação frontal
|
||||||
roll_max_default_deg=45.0,
|
roll_max_default_deg=25.0,
|
||||||
pitch_max_default_deg=25.0,
|
pitch_max_default_deg=45.0,
|
||||||
|
|
||||||
# Níveis derivados do limite máximo configurado.
|
# Níveis derivados do limite máximo configurado.
|
||||||
angulo_attention_factor=0.50,
|
angulo_attention_factor=0.50,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue