ajuste de erro lateral no mpc

This commit is contained in:
Diego Freitas 2025-09-24 12:14:59 -03:00
parent 8993003b31
commit c3f72fc7df
54 changed files with 290 additions and 136 deletions

Binary file not shown.

View File

@ -203,7 +203,7 @@ namespace AgroBase.Forms.IHM
tkbAnguloDirecional.Value = Math.Abs(Convert.ToInt32(_Sensoriamento.Controle.Angulo));
}
txtDistanciasEsqDir.Text = _Sensoriamento.Trajetoria.DistanciaEsquerda.ToString("0.00") + " / " + _Sensoriamento.Trajetoria.DistanciaDireita.ToString("0.00");
txtDistanciasEsqDir.Text = _Sensoriamento.Trajetoria.DistanciaEsquerda.ToString("0.00") + " / " + _Sensoriamento.Trajetoria.DistanciaDireita.ToString("0.00") + " (" + _Sensoriamento.Controle.ErroLateral.ToString("0.00" + ")");
txtDentroCorredor.Text = _Sensoriamento.Trajetoria.CorredorAtual.Dentro ? "Sim" : "Não";
txtMargemCorredor.Text = _Sensoriamento.Trajetoria.NaMargemDoCorredor ? "Sim" : "Não";
txtStatusCarro.Text = _Sensoriamento.Trajetoria.StatusCarro.ToString();

View File

@ -425,7 +425,8 @@ namespace AgroBase.Forms.Operacoes
try
{
double angulo = Variaveis.OperacaoEmAndamento.Sensoriamento.Gps.OrientacaoReal;
FuncoesGlobais.DesenharInclinacao((Panel)sender, e, (float)angulo, -90);
double angulo2 = Variaveis.OperacaoEmAndamento.Sensoriamento.Gps.AnguloCarroDefinido;
FuncoesGlobais.DesenharInclinacao((Panel)sender, e, (float)angulo, -90, (float)angulo2);
}
catch { }
}

View File

@ -444,9 +444,9 @@
this.label134 = new System.Windows.Forms.Label();
this.txtNaMargem = new System.Windows.Forms.TextBox();
this.label133 = new System.Windows.Forms.Label();
this.txtDistanciaDireita = new System.Windows.Forms.TextBox();
this.txtErroLateral = new System.Windows.Forms.TextBox();
this.label132 = new System.Windows.Forms.Label();
this.txtDistanciaEsquerda = new System.Windows.Forms.TextBox();
this.txtDistanciasLaterais = new System.Windows.Forms.TextBox();
this.label70 = new System.Windows.Forms.Label();
this.txtErvasIdentificadas = new System.Windows.Forms.TextBox();
this.lblPercentualRua = new System.Windows.Forms.Label();
@ -4902,9 +4902,9 @@
this.pnlInformacoesOperacao.Controls.Add(this.label134);
this.pnlInformacoesOperacao.Controls.Add(this.txtNaMargem);
this.pnlInformacoesOperacao.Controls.Add(this.label133);
this.pnlInformacoesOperacao.Controls.Add(this.txtDistanciaDireita);
this.pnlInformacoesOperacao.Controls.Add(this.txtErroLateral);
this.pnlInformacoesOperacao.Controls.Add(this.label132);
this.pnlInformacoesOperacao.Controls.Add(this.txtDistanciaEsquerda);
this.pnlInformacoesOperacao.Controls.Add(this.txtDistanciasLaterais);
this.pnlInformacoesOperacao.Controls.Add(this.label70);
this.pnlInformacoesOperacao.Controls.Add(this.txtErvasIdentificadas);
this.pnlInformacoesOperacao.Controls.Add(this.lblPercentualRua);
@ -4984,19 +4984,19 @@
this.label133.Location = new System.Drawing.Point(124, 120);
this.label133.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label133.Name = "label133";
this.label133.Size = new System.Drawing.Size(99, 13);
this.label133.Size = new System.Drawing.Size(57, 13);
this.label133.TabIndex = 79;
this.label133.Text = "Distancia da Direita";
this.label133.Text = "Erro lateral";
//
// txtDistanciaDireita
// txtErroLateral
//
this.txtDistanciaDireita.Location = new System.Drawing.Point(126, 136);
this.txtDistanciaDireita.Margin = new System.Windows.Forms.Padding(2);
this.txtDistanciaDireita.Name = "txtDistanciaDireita";
this.txtDistanciaDireita.ReadOnly = true;
this.txtDistanciaDireita.Size = new System.Drawing.Size(117, 20);
this.txtDistanciaDireita.TabIndex = 80;
this.txtDistanciaDireita.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.txtErroLateral.Location = new System.Drawing.Point(126, 136);
this.txtErroLateral.Margin = new System.Windows.Forms.Padding(2);
this.txtErroLateral.Name = "txtErroLateral";
this.txtErroLateral.ReadOnly = true;
this.txtErroLateral.Size = new System.Drawing.Size(117, 20);
this.txtErroLateral.TabIndex = 80;
this.txtErroLateral.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label132
//
@ -5004,19 +5004,19 @@
this.label132.Location = new System.Drawing.Point(2, 120);
this.label132.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label132.Name = "label132";
this.label132.Size = new System.Drawing.Size(114, 13);
this.label132.Size = new System.Drawing.Size(97, 13);
this.label132.TabIndex = 77;
this.label132.Text = "Distancia da Esquerda";
this.label132.Text = "Dist. Laterais (E/D)";
//
// txtDistanciaEsquerda
// txtDistanciasLaterais
//
this.txtDistanciaEsquerda.Location = new System.Drawing.Point(4, 136);
this.txtDistanciaEsquerda.Margin = new System.Windows.Forms.Padding(2);
this.txtDistanciaEsquerda.Name = "txtDistanciaEsquerda";
this.txtDistanciaEsquerda.ReadOnly = true;
this.txtDistanciaEsquerda.Size = new System.Drawing.Size(117, 20);
this.txtDistanciaEsquerda.TabIndex = 78;
this.txtDistanciaEsquerda.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.txtDistanciasLaterais.Location = new System.Drawing.Point(4, 136);
this.txtDistanciasLaterais.Margin = new System.Windows.Forms.Padding(2);
this.txtDistanciasLaterais.Name = "txtDistanciasLaterais";
this.txtDistanciasLaterais.ReadOnly = true;
this.txtDistanciasLaterais.Size = new System.Drawing.Size(117, 20);
this.txtDistanciasLaterais.TabIndex = 78;
this.txtDistanciasLaterais.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label70
//
@ -6092,9 +6092,9 @@
private System.Windows.Forms.Label label134;
private System.Windows.Forms.TextBox txtNaMargem;
private System.Windows.Forms.Label label133;
private System.Windows.Forms.TextBox txtDistanciaDireita;
private System.Windows.Forms.TextBox txtErroLateral;
private System.Windows.Forms.Label label132;
private System.Windows.Forms.TextBox txtDistanciaEsquerda;
private System.Windows.Forms.TextBox txtDistanciasLaterais;
private System.Windows.Forms.CheckBox chbMOV_Alimentacao_Mediana;
private System.Windows.Forms.CheckBox chbMOV_Alimentacao_Moda;
private System.Windows.Forms.CheckBox chbMOV_Alimentacao_Media;

View File

@ -1106,8 +1106,8 @@ namespace AgroBase.Forms.Operacoes
txtVelocidadeControle.Text = ((Log.Controle?.PercentualVelocidadeSP ?? 0) / VariaveisEquipamento.RPM_Max_Roda * 100).ToString() + " rpm";
txtErvasIdentificadas.Text = $"{totalAtuacoes}";
txtDistanciaEsquerda.Text = Log.Trajetoria.DistanciaEsquerda.ToString("0.00");
txtDistanciaDireita.Text = Log.Trajetoria.DistanciaDireita.ToString("0.00");
txtDistanciasLaterais.Text = Log.Trajetoria.DistanciaEsquerda.ToString("0.00") + " m / " + Log.Trajetoria.DistanciaDireita.ToString("0.00") + " m";
txtErroLateral.Text = Log.Controle.ErroLateral.ToString("0.00") + " m";
txtNaMargem.Text = Log.Trajetoria.NaMargemDoCorredor ? "Sim" : "Não";
lblPercentualOperacao.Text = $"Operação {Log.Trajetoria.ProgressoTrajeto.ToString("0.00")}%";

View File

@ -711,9 +711,9 @@
this.lblDistanciaLateral.Location = new System.Drawing.Point(11, 477);
this.lblDistanciaLateral.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblDistanciaLateral.Name = "lblDistanciaLateral";
this.lblDistanciaLateral.Size = new System.Drawing.Size(117, 13);
this.lblDistanciaLateral.Size = new System.Drawing.Size(171, 13);
this.lblDistanciaLateral.TabIndex = 23;
this.lblDistanciaLateral.Text = "Esq: 0,00 m Dir: 0,00 m";
this.lblDistanciaLateral.Text = "Esq: 0,00 m Dir: 0,00 m Err: 0,00 m";
//
// lblDistanciaFinal
//

View File

@ -132,7 +132,7 @@ namespace AgroBase.Forms
lblDirecao.Text = "Direção: " + Enum.GetName(typeof(DirecaoCarroRua), _Sensoriamento.Trajetoria.DirecaoCaminho);
lblDistanciaOperacao.Text = "Distância Operação: " + _Sensoriamento.Trajetoria.DistanciaPercorrida.ToString("0.00") + " m de " + _Sensoriamento.Trajetoria.DistanciaTotal.ToString("0.00") + " m";
lblDistanciaFinal.Text = "Distância Restante: " + _Sensoriamento.Trajetoria.DistanciaRestante.ToString("0.00") + " m";
lblDistanciaLateral.Text = "Esq: " + _Sensoriamento.Trajetoria.DistanciaEsquerda.ToString("0.00") + " m - Dir: " + _Sensoriamento.Trajetoria.DistanciaDireita.ToString("0.00") + " m";
lblDistanciaLateral.Text = "Esq: " + _Sensoriamento.Trajetoria.DistanciaEsquerda.ToString("0.00") + " m - Dir: " + _Sensoriamento.Trajetoria.DistanciaDireita.ToString("0.00") + " m " + Variaveis.OperacaoEmAndamento.Controle.ErroLateral.ToString("0.00") + " m";
lblRua.Text = "Corredor: " + (_Sensoriamento.Trajetoria.CorredorAtual.Dentro ? "Dentro" : "Fora");
lblMargem.Text = "Margem: " + (_Sensoriamento.Trajetoria.NaMargemDoCorredor ? "Sim" : "Não");
lblProximoPonto.Text = "Próximo Ponto: " + (_Sensoriamento.Trajetoria.ProximoPonto.idxPonto);

View File

@ -101,13 +101,15 @@ namespace AgroBase.Models
private async void _timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
((System.Timers.Timer)sender).Stop();
System.Timers.Timer tmr = sender as System.Timers.Timer;
if (VerificaDisposed()) return;
tmr.Stop();
if (_Ticking)
{
if (_state == TimerState.Running)
{
((System.Timers.Timer)sender).Start();
tmr.Start();
}
return;
}
@ -155,9 +157,9 @@ namespace AgroBase.Models
finally
{
_Ticking = false;
if (_state == TimerState.Running)
if (!VerificaDisposed() && _state == TimerState.Running)
{
((System.Timers.Timer)sender).Start();
tmr.Start();
}
}
}

View File

@ -1634,6 +1634,7 @@ namespace AgroBase.Models
public List<MPCSimulacaoModel> SimulacaoMPC { get; set; } = new List<MPCSimulacaoModel>();
public double Latencia { get; set; }
public double ErroLateral { get; set; } = 0.0;
public OperacaoControleModel Clone()
{
@ -1664,6 +1665,7 @@ namespace AgroBase.Models
ticks_sem_resposta = ticks_sem_resposta,
Latencia = Latencia,
EmFreio = EmFreio,
ErroLateral = ErroLateral
};
}
}

View File

@ -54,6 +54,7 @@ namespace AgroBase.Models.Operadores
public List<double[]> simulacao { get; set; }
public int heartbeat { get; set; }
public double latencia { get; set; }
public double erro_lateral { get; set; }
}
public class ManagerWorkerMessageResponseModulosPendentesModel

View File

@ -770,6 +770,7 @@ namespace AgroBase.Models
dictParams.TryGetValue("simulacao", out var _simulacao);
dictParams.TryGetValue("heartbeat", out var _heartbeat);
dictParams.TryGetValue("latencia", out var _latencia);
dictParams.TryGetValue("erro_lateral", out var _erro_lateral);
novoComando = new ManagerWorkerMessageResponseComandoModel()
{
angulo = Convert.ToDouble(_angulo),
@ -779,6 +780,7 @@ namespace AgroBase.Models
simulacao = JsonConvert.DeserializeObject<List<double[]>>((_simulacao ?? "").ToString()),
heartbeat = Convert.ToInt32(_heartbeat),
latencia = Convert.ToDouble(_latencia.ToString().Replace(".", ",")),
erro_lateral = Convert.ToDouble(_erro_lateral.ToString().Replace(".", ",")),
};
}
catch (Exception ex)
@ -789,7 +791,7 @@ namespace AgroBase.Models
DateTime agora = DateTime.Now;
var _Controle = Variaveis.OperacaoEmAndamento.Controle;
bool comandoMudou = (_Controle.Angulo != novoComando.angulo || _Controle.PercentualVelocidadeSP != novoComando.percentual_velocidade || _Controle.TipoMovimento != novoComando.tipo_movimento || _Controle.EmFreio != novoComando.em_freio);
bool comandoMudou = novoComando != null && (_Controle.Angulo != novoComando.angulo || _Controle.PercentualVelocidadeSP != novoComando.percentual_velocidade || _Controle.TipoMovimento != novoComando.tipo_movimento || _Controle.EmFreio != novoComando.em_freio);
bool mangerDestravou = (_Controle.ticks_sem_resposta.AddMilliseconds(min_ticks_sem_resposta) < agora && novoComando.heartbeat != _Controle.heartbeat);
if (novoComando != null && (comandoMudou || mangerDestravou))
{
@ -799,6 +801,7 @@ namespace AgroBase.Models
_Controle.EmFreio = novoComando.em_freio;
_Controle.SimulacaoMPC = novoComando.simulacao?.Select(x => new MPCSimulacaoModel() { latitude = x[0], longitude = x[1], orientacao = x[2] }).ToList() ?? new List<MPCSimulacaoModel>();
_Controle.Latencia = novoComando.latencia;
_Controle.ErroLateral = novoComando.erro_lateral;
Variaveis.OperacaoEmAndamento.AtualizaInformacoesControleOperacao();
}
@ -1224,7 +1227,7 @@ namespace AgroBase.Models
anguloProjetar2 += anguloAcrescentar;
anguloAcrescentar *= -1;
}
double percentualAcrescimoPontoAberturaCurva = 1.1;
double percentualAcrescimoPontoAberturaCurva = 0.8;
GPSModel UltimoPonto = GPSUtils.ProjetarPontoDeslocado(CorredorAtual.Last(), !ultimoCorredor ? (DistanciaProjecaoRua * percentualAcrescimoPontoAberturaCurva) : (DistanciaProjecaoRua * 2.0), anguloProjetar2);
PontoTrajetoriaModel PontoFinal = new PontoTrajetoriaModel(TipoPontoRua.LigacaoSaida)

View File

@ -150,7 +150,7 @@ namespace AgroBase.Services
// heading 2 antenas
$"config heading fixlength\r\n",
$"config heading tractor\r\n",
//$"config heading tractor\r\n",
$"config heading length {comprimento_antena} {tolerancia_antena}\r\n",
// (se precisar, existe 'config heading offset <azim_off> <pitch_off>')
@ -626,7 +626,7 @@ namespace AgroBase.Services
UltimaLeitura.TimestampOri.valor = Stopwatch.GetTimestamp() / (double)Stopwatch.Frequency;
UltimaLeitura.Momento = DateTime.Now;
UltimaLeitura.OrientacaoReal = InverterHeading ? GPSUtils.NormalizarAngulo(headingTrue + 180.0) : headingTrue;
UltimaLeitura.OrientacaoReal = InverterHeading ? GPSUtils.NormalizarAngulo(headingTrue - 180.0) : headingTrue;
UltimaLeitura.TipoOrientacao = status;
// ✅ Atualiza o ângulo unificado no GPSService
@ -950,7 +950,7 @@ namespace AgroBase.Services
return;
}
UltimasLeituras.Add(UltimaLeitura);
UltimasLeituras.Add(UltimaLeitura.Clone());
if (UltimasLeituras.Count > TaxaAmostragemHz) UltimasLeituras.Remove(UltimasLeituras.First());
DefinirOrientacaoMovimento();
@ -1163,9 +1163,9 @@ namespace AgroBase.Services
bool rtkFix = UltimaLeitura.QualidadeFix == TiposCorrecaoGPS.RTKFixo;
double angAnterior = UltimaLeitura.AnguloCarroDefinido;
//anguloFinal = GPSUtils.MisturarAngulosPorDistancia(anguloGPS, anguloGPSMovimento, distAnguloGPS, TrajetoriaMapaOperacaoModel.DistanciaMaximaEntreLeituras, 0.03, 0.3);
//anguloFinal = FundirHeadingComMovimento(heading, angMov, distJan, velPercent, rtkFix, angFundidoAnterior: angAnterior, alfaLowPass: 0.25);
anguloFinal = FundirHeadingComMovimento(heading, angMov, distJan, velPercent, rtkFix, angFundidoAnterior: angAnterior, alfaLowPass: 0.25);
anguloFinal = heading;
}
else if (imuIniciado)
{
@ -1178,7 +1178,7 @@ namespace AgroBase.Services
}
// Atualiza o ângulo final
UltimaLeitura.AnguloCarroDefinido = GPSUtils.NormalizarAngulo(anguloFinal + HeadingOffsetSimulador + HeadingOffsetCorrecao);
UltimaLeitura.AnguloCarroDefinido = anguloFinal; // GPSUtils.NormalizarAngulo(anguloFinal + HeadingOffsetSimulador + HeadingOffsetCorrecao);
}
public static double FundirHeadingComMovimento(
@ -1214,9 +1214,11 @@ namespace AgroBase.Services
double angMisto = MisturarAngulosCircular(headingDeg, angMovDeg, pesoHeading);
if (!double.IsNaN(angFundidoAnterior) && alfaLowPass > 0)
angMisto = LowPassAngle(angFundidoAnterior, angMisto, alfaLowPass);
angMisto = LowPassAngle0to360(angFundidoAnterior, angMisto, alfaLowPass);
else
angMisto = Normalize0To360(angMisto);
return GPSUtils.NormalizarAngulo(angMisto);
return angMisto;
// ---------- helpers locais ----------
double Norm(double v, double lo, double hi)
@ -1245,6 +1247,23 @@ namespace AgroBase.Services
double diff = GPSUtils.NormalizarAngulo(novoDeg - atualDeg);
return GPSUtils.NormalizarAngulo(atualDeg + alfa * diff);
}
double LowPassAngle0to360(double atualDeg, double novoDeg, double alfa)
{
double diff = NormalizeSigned180(novoDeg - atualDeg); // delta curto
return Normalize0To360(atualDeg + alfa * diff);
}
double NormalizeSigned180(double angDeg)
{
angDeg = (angDeg + 180.0) % 360.0;
if (angDeg < 0) angDeg += 360.0;
return angDeg - 180.0; // [-180, +180)
}
double Normalize0To360(double angDeg)
{
angDeg %= 360.0;
if (angDeg < 0) angDeg += 360.0;
return angDeg; // [0, 360)
}
}
public static void AtualizaDadosRedis()

View File

@ -477,12 +477,12 @@ namespace AgroBase.Services
}
case DadosLoRaParse.DadosPulverizador:
{
int _percentual_reservatorio = (int)dados[2];
int _pressao_linha = (int)dados[3];
int _ervas_identificadas = (int)dados[4];
int _herbicida_consumido = (int)dados[5];
int _herbicida_por_erva = (int)dados[6];
int _percentual_ervas_terreno = (int)dados[7];
int _percentual_reservatorio = dados.Length < 3 ? 0 : (int)dados[2];
int _pressao_linha = dados.Length < 4 ? 0 : (int)dados[3];
int _ervas_identificadas = dados.Length < 5 ? 0 : (int)dados[4];
int _herbicida_consumido = dados.Length < 6 ? 0 : (int)dados[5];
int _herbicida_por_erva = dados.Length < 7 ? 0 : (int)dados[6];
int _percentual_ervas_terreno = dados.Length < 8 ? 0 : (int)dados[7];
equipamento.Sensores.PercentualReservatorio = _percentual_reservatorio;
equipamento.Sensores.PressaoLinha = _pressao_linha;

View File

@ -29,5 +29,5 @@
"top_topics_and_observing_domains": [ ]
} ],
"hex_encoded_hmac_key": "40F346D3248C3AFDF2BEE1FE496DBD32F7CED6E5AE98B881ABC421AA7E7B5642",
"next_scheduled_calculation_time": "13403636820469509"
"next_scheduled_calculation_time": "13403636820469815"
}

View File

@ -1,3 +1,3 @@
2025/09/23-09:38:49.956 4b78 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/MANIFEST-000001
2025/09/23-09:38:49.966 4b78 Recovering log #3
2025/09/23-09:38:49.969 4b78 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/000003.log
2025/09/24-10:46:59.725 4b24 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/MANIFEST-000001
2025/09/24-10:46:59.737 4b24 Recovering log #3
2025/09/24-10:46:59.741 4b24 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/000003.log

View File

@ -1,3 +1,3 @@
2025/09/23-09:33:56.629 19b0 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/MANIFEST-000001
2025/09/23-09:33:56.643 19b0 Recovering log #3
2025/09/23-09:33:56.647 19b0 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/000003.log
2025/09/24-10:35:30.569 5054 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/MANIFEST-000001
2025/09/24-10:35:30.580 5054 Recovering log #3
2025/09/24-10:35:30.583 5054 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/000003.log

View File

@ -1 +1 @@
{"net":{"http_server_properties":{"servers":[{"alternative_service":[{"advertised_alpns":["h3"],"expiration":"13403189309995191","port":443,"protocol_str":"quic"}],"anonymization":["DAAAAAcAAABmaWxlOi8vAA==",false,0],"network_stats":{"srtt":10486},"server":"https://tile.openstreetmap.org","supports_spdy":true}],"supports_quic":{"address":"2804:d78:67d:1400:98be:836a:a20c:3874","used_quic":true},"version":5},"network_qualities":{"CAASABiAgICA+P////8B":"4G","CAESABiAgICA+P////8B":"4G","CAISABiAgICA+P////8B":"4G","CAYSABiAgICA+P////8B":"Offline"}}}
{"net":{"http_server_properties":{"servers":[{"alternative_service":[{"advertised_alpns":["h3"],"expiration":"13403281624997146","port":443,"protocol_str":"quic"}],"anonymization":["DAAAAAcAAABmaWxlOi8vAA==",false,0],"network_stats":{"srtt":16178},"server":"https://tile.openstreetmap.org","supports_spdy":true}],"supports_quic":{"address":"2804:d78:67d:1400:d0b1:309d:2180:66eb","used_quic":true},"version":5},"network_qualities":{"CAASABiAgICA+P////8B":"4G","CAESABiAgICA+P////8B":"4G","CAISABiAgICA+P////8B":"4G","CAYSABiAgICA+P////8B":"Offline"}}}

View File

@ -1 +1 @@
{"sts":[{"expiry":1790164822.419645,"host":"bWGAftl61rqoc0YzqPncsLvQQh/iC2Bdp3ejUeGC83w=","mode":"force-https","sts_include_subdomains":true,"sts_observed":1758628822.419655}],"version":2}
{"sts":[{"expiry":1790250106.627238,"host":"bWGAftl61rqoc0YzqPncsLvQQh/iC2Bdp3ejUeGC83w=","mode":"force-https","sts_include_subdomains":true,"sts_observed":1758714106.62724}],"version":2}

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,3 @@
2025/09/23-09:42:46.689 4b78 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/MANIFEST-000001
2025/09/23-09:42:46.691 4b78 Recovering log #3
2025/09/23-09:42:46.694 4b78 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/000003.log
2025/09/24-10:48:23.768 4b24 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/MANIFEST-000001
2025/09/24-10:48:23.769 4b24 Recovering log #3
2025/09/24-10:48:23.773 4b24 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/000003.log

View File

@ -1,3 +1,3 @@
2025/09/23-09:38:42.409 19b0 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/MANIFEST-000001
2025/09/23-09:38:42.410 19b0 Recovering log #3
2025/09/23-09:38:42.413 19b0 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/000003.log
2025/09/24-10:43:41.339 5054 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/MANIFEST-000001
2025/09/24-10:43:41.340 5054 Recovering log #3
2025/09/24-10:43:41.343 5054 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/000003.log

View File

@ -1,3 +1,3 @@
2025/09/23-09:38:49.884 2874 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/MANIFEST-000001
2025/09/23-09:38:49.887 2874 Recovering log #7
2025/09/23-09:38:49.887 2874 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/000007.log
2025/09/24-10:46:59.643 5da4 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/MANIFEST-000001
2025/09/24-10:46:59.646 5da4 Recovering log #7
2025/09/24-10:46:59.647 5da4 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/000007.log

View File

@ -1,3 +1,3 @@
2025/09/23-09:33:56.549 1c98 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/MANIFEST-000001
2025/09/23-09:33:56.551 1c98 Recovering log #7
2025/09/23-09:33:56.551 1c98 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/000007.log
2025/09/24-10:35:30.498 35a4 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/MANIFEST-000001
2025/09/24-10:35:30.500 35a4 Recovering log #7
2025/09/24-10:35:30.500 35a4 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/000007.log

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"Id":"1","Name":"CidadeJardimCerto","Length":18.438211678884382,"Dist1":18.438211678884382,"Dist2":0.0},"geometry":{"id":"0","type":"LineString","coordinates":[[-47.3952092235,-22.172566764333332],[-47.395214685166664,-22.172591648666668],[-47.395217691333336,-22.1726149115],[-47.39522120783333,-22.172638106166666],[-47.395224592333335,-22.172662264666666],[-47.395227536833332,-22.172683503833333],[-47.395231278833336,-22.172709659],[-47.3952341445,-22.1727307235]]}},{"type":"Feature","properties":{"Id":"2","Name":"CidadeJardimCerto","Length":18.304756653641313,"Dist1":18.438211678884382,"Dist2":0.0},"geometry":{"id":"1","type":"LineString","coordinates":[[-47.395219567666665,-22.172731676],[-47.3952166705,-22.172709694166667],[-47.395212956833333,-22.1726860135],[-47.395209649833333,-22.172662382166667],[-47.3952061285,-22.172638539666668],[-47.395203071333334,-22.172615091],[-47.395199642,-22.172589946333332],[-47.39519637716667,-22.172568656333333]]}},{"type":"Feature","properties":{"Id":"3","Name":"CidadeJardimCerto","Length":18.204085527823089,"Dist1":18.438211678884382,"Dist2":0.0},"geometry":{"id":"2","type":"LineString","coordinates":[[-47.395182856666665,-22.172571987333335],[-47.395186353666666,-22.172596904666666],[-47.3951894365,-22.1726195275],[-47.395192361833331,-22.172642871333334],[-47.3951957415,-22.1726662635],[-47.3951991415,-22.1726895815],[-47.395202583833331,-22.172713842],[-47.395205228833333,-22.172734196333334]]}},{"type":"Feature","properties":{"Id":"4","Name":"CidadeJardimCerto","Length":18.206275148810604,"Dist1":18.438211678884382,"Dist2":0.0},"geometry":{"id":"3","type":"LineString","coordinates":[[-47.3951911205,-22.172735722833334],[-47.395187572,-22.172712241833334],[-47.3951841675,-22.1726893895],[-47.395179907166664,-22.1726651245],[-47.3951765075,-22.172642284833334],[-47.395173248666666,-22.1726180985],[-47.395169798666664,-22.172594096166666],[-47.395167092166666,-22.172573705666668]]}},{"type":"Feature","properties":{"Id":"5","Name":"CidadeJardimCerto","Length":18.067139082589541,"Dist1":18.438211678884382,"Dist2":0.0},"geometry":{"id":"4","type":"LineString","coordinates":[[-47.395153470333334,-22.172576570833332],[-47.395156353166669,-22.172600550333332],[-47.395159992333333,-22.172624829333333],[-47.395162920833336,-22.172647923333333],[-47.39516644,-22.172671954333332],[-47.395169917833336,-22.1726952245],[-47.3951736845,-22.172721525666667],[-47.395175992333336,-22.172737516833333]]}}]}
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"Id":"1","Name":"CidadeJardimCerto","Length":18.438211678884382,"Dist1":18.438211678884382,"Dist2":0.0},"geometry":{"id":null,"type":"LineString","coordinates":[[-47.3952092235,-22.172566764333332],[-47.395214685166664,-22.172591648666668],[-47.395217691333336,-22.1726149115],[-47.39522120783333,-22.172638106166666],[-47.395224592333335,-22.172662264666666],[-47.395227536833332,-22.172683503833333],[-47.395231278833336,-22.172709659],[-47.3952341445,-22.1727307235]]}},{"type":"Feature","properties":{"Id":"2","Name":"CidadeJardimCerto","Length":18.304756653641313,"Dist1":18.438211678884382,"Dist2":0.0},"geometry":{"id":null,"type":"LineString","coordinates":[[-47.395219567666665,-22.172731676],[-47.3952166705,-22.172709694166667],[-47.395212956833333,-22.1726860135],[-47.395209649833333,-22.172662382166667],[-47.3952061285,-22.172638539666668],[-47.395203071333334,-22.172615091],[-47.395199642,-22.172589946333332],[-47.39519637716667,-22.172568656333333]]}},{"type":"Feature","properties":{"Id":"3","Name":"CidadeJardimCerto","Length":18.204085527823089,"Dist1":18.438211678884382,"Dist2":0.0},"geometry":{"id":null,"type":"LineString","coordinates":[[-47.395182856666665,-22.172571987333335],[-47.395186353666666,-22.172596904666666],[-47.3951894365,-22.1726195275],[-47.395192361833331,-22.172642871333334],[-47.3951957415,-22.1726662635],[-47.3951991415,-22.1726895815],[-47.395202583833331,-22.172713842],[-47.395205228833333,-22.172734196333334]]}},{"type":"Feature","properties":{"Id":"4","Name":"CidadeJardimCerto","Length":18.206275148810604,"Dist1":18.438211678884382,"Dist2":0.0},"geometry":{"id":null,"type":"LineString","coordinates":[[-47.3951911205,-22.172735722833334],[-47.395187572,-22.172712241833334],[-47.3951841675,-22.1726893895],[-47.395179907166664,-22.1726651245],[-47.3951765075,-22.172642284833334],[-47.395173248666666,-22.1726180985],[-47.395169798666664,-22.172594096166666],[-47.395167092166666,-22.172573705666668]]}},{"type":"Feature","properties":{"Id":"5","Name":"CidadeJardimCerto","Length":18.067139082589541,"Dist1":18.438211678884382,"Dist2":0.0},"geometry":{"id":null,"type":"LineString","coordinates":[[-47.395153470333334,-22.172576570833332],[-47.395156353166669,-22.172600550333332],[-47.395159992333333,-22.172624829333333],[-47.395162920833336,-22.172647923333333],[-47.39516644,-22.172671954333332],[-47.395169917833336,-22.1726952245],[-47.3951736845,-22.172721525666667],[-47.395175992333336,-22.172737516833333]]}}]}

View File

@ -17,7 +17,7 @@
<meta name="viewport" content="width=device-width,
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
#map_b5c20ec1e6bf396924dc4485751b4881 {
#map_8ba568814c3b3735ef0f7d202c8c9f5e {
position: relative;
width: 100.0%;
height: 100.0%;
@ -54,14 +54,14 @@
<body>
<div class="folium-map" id="map_b5c20ec1e6bf396924dc4485751b4881" ></div>
<div class="folium-map" id="map_8ba568814c3b3735ef0f7d202c8c9f5e" ></div>
</body>
<script>
var map_b5c20ec1e6bf396924dc4485751b4881 = L.map(
"map_b5c20ec1e6bf396924dc4485751b4881",
var map_8ba568814c3b3735ef0f7d202c8c9f5e = L.map(
"map_8ba568814c3b3735ef0f7d202c8c9f5e",
{
center: [0.0, 0.0],
crs: L.CRS.EPSG3857,
@ -77,6 +77,26 @@
var tile_layer_ae18c2d43f153eef1ccf5ccb4165855e = L.tileLayer(
"https://tile.openstreetmap.org/{z}/{x}/{y}.png",
{
"minZoom": 0,
"maxZoom": 19,
"maxNativeZoom": 19,
"noWrap": false,
"attribution": "\u0026copy; \u003ca href=\"https://www.openstreetmap.org/copyright\"\u003eOpenStreetMap\u003c/a\u003e contributors",
"subdomains": "abc",
"detectRetina": false,
"tms": false,
"opacity": 1,
}
);
tile_layer_ae18c2d43f153eef1ccf5ccb4165855e.addTo(map_8ba568814c3b3735ef0f7d202c8c9f5e);
</script>
<script>
@ -96,7 +116,7 @@
}
trajeto_json_add({"features": []});
trajeto_json.addTo(map_b5c20ec1e6bf396924dc4485751b4881);
trajeto_json.addTo(map_8ba568814c3b3735ef0f7d202c8c9f5e);
function adicionarGeometria(novaGeometria) {
trajeto_json.addData(novaGeometria);
@ -159,9 +179,9 @@
var marcadorEquipamento = L.marker([0, 0], {
icon: customIcon
}).addTo(map_b5c20ec1e6bf396924dc4485751b4881);
}).addTo(map_8ba568814c3b3735ef0f7d202c8c9f5e);
var marcadorBase = L.marker([0, 0], {}).addTo(map_b5c20ec1e6bf396924dc4485751b4881);
var marcadorBase = L.marker([0, 0], {}).addTo(map_8ba568814c3b3735ef0f7d202c8c9f5e);
var icon = L.AwesomeMarkers.icon(
{"extraClasses": "fa-rotate-0", "icon": "info-sign", "iconColor": "white", "markerColor": "red", "prefix": "glyphicon"}
);
@ -226,7 +246,7 @@
}
if (foco) {
map_b5c20ec1e6bf396924dc4485751b4881.setView(novaPosicao, map_b5c20ec1e6bf396924dc4485751b4881.getZoom());
map_8ba568814c3b3735ef0f7d202c8c9f5e.setView(novaPosicao, map_8ba568814c3b3735ef0f7d202c8c9f5e.getZoom());
}
}
@ -248,7 +268,7 @@
marcadorDinamico.setRotationAngle(angulo);
adicionarCoordenada("Tj", [novaLongitude, novaLatitude]);
map_b5c20ec1e6bf396924dc4485751b4881.setView(novaPosicao, map_b5c20ec1e6bf396924dc4485751b4881.getZoom());*/
map_8ba568814c3b3735ef0f7d202c8c9f5e.setView(novaPosicao, map_8ba568814c3b3735ef0f7d202c8c9f5e.getZoom());*/
});
function calcularOrientacao(P1latitude, P1longitude, P2latitude, P2longitude) {

View File

@ -17,7 +17,7 @@
<meta name="viewport" content="width=device-width,
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
#map_4d8eed9407dc7769ca15b0f680376c9e {
#map_e9b1b3ee64db174d6f4543ce38e0b5e1 {
position: relative;
width: 100.0%;
height: 100.0%;
@ -54,14 +54,14 @@
<body>
<div class="folium-map" id="map_4d8eed9407dc7769ca15b0f680376c9e" ></div>
<div class="folium-map" id="map_e9b1b3ee64db174d6f4543ce38e0b5e1" ></div>
</body>
<script>
var map_4d8eed9407dc7769ca15b0f680376c9e = L.map(
"map_4d8eed9407dc7769ca15b0f680376c9e",
var map_e9b1b3ee64db174d6f4543ce38e0b5e1 = L.map(
"map_e9b1b3ee64db174d6f4543ce38e0b5e1",
{
center: [-22.17265214058333, -47.39519380741667],
crs: L.CRS.EPSG3857,
@ -78,6 +78,26 @@
var tile_layer_507a582c5bc0aa807282907c2bc3275c = L.tileLayer(
"https://tile.openstreetmap.org/{z}/{x}/{y}.png",
{
"minZoom": 0,
"maxZoom": 19,
"maxNativeZoom": 19,
"noWrap": false,
"attribution": "\u0026copy; \u003ca href=\"https://www.openstreetmap.org/copyright\"\u003eOpenStreetMap\u003c/a\u003e contributors",
"subdomains": "abc",
"detectRetina": false,
"tms": false,
"opacity": 1,
}
);
tile_layer_507a582c5bc0aa807282907c2bc3275c.addTo(map_e9b1b3ee64db174d6f4543ce38e0b5e1);
var trajetosSelecionados = {};
@ -91,7 +111,7 @@
}*/
});
}
function geo_json_cdfc1fc555c70965b47aeaab833de403_onEachFeature(feature, layer) {
function geo_json_b7203db4da92fe2236826b29ddbfaf68_onEachFeature(feature, layer) {
layer.on({
@ -128,23 +148,23 @@
}*/
});
};
var geo_json_cdfc1fc555c70965b47aeaab833de403 = L.geoJson(null, {
onEachFeature: geo_json_cdfc1fc555c70965b47aeaab833de403_onEachFeature,
var geo_json_b7203db4da92fe2236826b29ddbfaf68 = L.geoJson(null, {
onEachFeature: geo_json_b7203db4da92fe2236826b29ddbfaf68_onEachFeature,
...{
}
});
function geo_json_cdfc1fc555c70965b47aeaab833de403_add (data) {
geo_json_cdfc1fc555c70965b47aeaab833de403
function geo_json_b7203db4da92fe2236826b29ddbfaf68_add (data) {
geo_json_b7203db4da92fe2236826b29ddbfaf68
.addData(data);
}
geo_json_cdfc1fc555c70965b47aeaab833de403_add({"features": [{"geometry": {"coordinates": [[-47.3952092235, -22.172566764333332], [-47.395214685166664, -22.172591648666668], [-47.395217691333336, -22.1726149115], [-47.39522120783333, -22.172638106166666], [-47.395224592333335, -22.172662264666666], [-47.39522753683333, -22.172683503833333], [-47.395231278833336, -22.172709659], [-47.3952341445, -22.1727307235]], "id": "0", "type": "LineString"}, "id": 0, "properties": {"Dist1": 18.438211678884382, "Dist2": 0.0, "Id": "1", "Length": 18.438211678884382, "Name": "CidadeJardimCerto"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.395219567666665, -22.172731676], [-47.3952166705, -22.172709694166667], [-47.39521295683333, -22.1726860135], [-47.39520964983333, -22.172662382166667], [-47.3952061285, -22.172638539666668], [-47.395203071333334, -22.172615091], [-47.395199642, -22.172589946333332], [-47.39519637716667, -22.172568656333333]], "id": "1", "type": "LineString"}, "id": 1, "properties": {"Dist1": 18.438211678884382, "Dist2": 0.0, "Id": "2", "Length": 18.304756653641313, "Name": "CidadeJardimCerto"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.395182856666665, -22.172571987333335], [-47.395186353666666, -22.172596904666666], [-47.3951894365, -22.1726195275], [-47.39519236183333, -22.172642871333334], [-47.3951957415, -22.1726662635], [-47.3951991415, -22.1726895815], [-47.39520258383333, -22.172713842], [-47.39520522883333, -22.172734196333334]], "id": "2", "type": "LineString"}, "id": 2, "properties": {"Dist1": 18.438211678884382, "Dist2": 0.0, "Id": "3", "Length": 18.20408552782309, "Name": "CidadeJardimCerto"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.3951911205, -22.172735722833334], [-47.395187572, -22.172712241833334], [-47.3951841675, -22.1726893895], [-47.395179907166664, -22.1726651245], [-47.3951765075, -22.172642284833334], [-47.395173248666666, -22.1726180985], [-47.395169798666664, -22.172594096166666], [-47.395167092166666, -22.172573705666668]], "id": "3", "type": "LineString"}, "id": 3, "properties": {"Dist1": 18.438211678884382, "Dist2": 0.0, "Id": "4", "Length": 18.206275148810604, "Name": "CidadeJardimCerto"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.395153470333334, -22.172576570833332], [-47.39515635316667, -22.172600550333332], [-47.39515999233333, -22.172624829333333], [-47.395162920833336, -22.172647923333333], [-47.39516644, -22.17267195433333], [-47.395169917833336, -22.1726952245], [-47.3951736845, -22.172721525666667], [-47.395175992333336, -22.172737516833333]], "id": "4", "type": "LineString"}, "id": 4, "properties": {"Dist1": 18.438211678884382, "Dist2": 0.0, "Id": "5", "Length": 18.06713908258954, "Name": "CidadeJardimCerto"}, "type": "Feature"}], "type": "FeatureCollection"});
geo_json_cdfc1fc555c70965b47aeaab833de403.setStyle(function(feature) {return feature.properties.style;});
geo_json_b7203db4da92fe2236826b29ddbfaf68_add({"features": [{"geometry": {"coordinates": [[-47.3952092235, -22.172566764333332], [-47.395214685166664, -22.172591648666668], [-47.395217691333336, -22.1726149115], [-47.39522120783333, -22.172638106166666], [-47.395224592333335, -22.172662264666666], [-47.39522753683333, -22.172683503833333], [-47.395231278833336, -22.172709659], [-47.3952341445, -22.1727307235]], "id": null, "type": "LineString"}, "id": 0, "properties": {"Dist1": 18.438211678884382, "Dist2": 0.0, "Id": "1", "Length": 18.438211678884382, "Name": "CidadeJardimCerto"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.395219567666665, -22.172731676], [-47.3952166705, -22.172709694166667], [-47.39521295683333, -22.1726860135], [-47.39520964983333, -22.172662382166667], [-47.3952061285, -22.172638539666668], [-47.395203071333334, -22.172615091], [-47.395199642, -22.172589946333332], [-47.39519637716667, -22.172568656333333]], "id": null, "type": "LineString"}, "id": 1, "properties": {"Dist1": 18.438211678884382, "Dist2": 0.0, "Id": "2", "Length": 18.304756653641313, "Name": "CidadeJardimCerto"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.395182856666665, -22.172571987333335], [-47.395186353666666, -22.172596904666666], [-47.3951894365, -22.1726195275], [-47.39519236183333, -22.172642871333334], [-47.3951957415, -22.1726662635], [-47.3951991415, -22.1726895815], [-47.39520258383333, -22.172713842], [-47.39520522883333, -22.172734196333334]], "id": null, "type": "LineString"}, "id": 2, "properties": {"Dist1": 18.438211678884382, "Dist2": 0.0, "Id": "3", "Length": 18.20408552782309, "Name": "CidadeJardimCerto"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.3951911205, -22.172735722833334], [-47.395187572, -22.172712241833334], [-47.3951841675, -22.1726893895], [-47.395179907166664, -22.1726651245], [-47.3951765075, -22.172642284833334], [-47.395173248666666, -22.1726180985], [-47.395169798666664, -22.172594096166666], [-47.395167092166666, -22.172573705666668]], "id": null, "type": "LineString"}, "id": 3, "properties": {"Dist1": 18.438211678884382, "Dist2": 0.0, "Id": "4", "Length": 18.206275148810604, "Name": "CidadeJardimCerto"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.395153470333334, -22.172576570833332], [-47.39515635316667, -22.172600550333332], [-47.39515999233333, -22.172624829333333], [-47.395162920833336, -22.172647923333333], [-47.39516644, -22.17267195433333], [-47.395169917833336, -22.1726952245], [-47.3951736845, -22.172721525666667], [-47.395175992333336, -22.172737516833333]], "id": null, "type": "LineString"}, "id": 4, "properties": {"Dist1": 18.438211678884382, "Dist2": 0.0, "Id": "5", "Length": 18.06713908258954, "Name": "CidadeJardimCerto"}, "type": "Feature"}], "type": "FeatureCollection"});
geo_json_b7203db4da92fe2236826b29ddbfaf68.setStyle(function(feature) {return feature.properties.style;});
geo_json_cdfc1fc555c70965b47aeaab833de403.addTo(map_4d8eed9407dc7769ca15b0f680376c9e);
geo_json_b7203db4da92fe2236826b29ddbfaf68.addTo(map_e9b1b3ee64db174d6f4543ce38e0b5e1);
</script>
@ -165,7 +185,7 @@
}
trajeto_json_add({"features": []});
trajeto_json.addTo(map_4d8eed9407dc7769ca15b0f680376c9e);
trajeto_json.addTo(map_e9b1b3ee64db174d6f4543ce38e0b5e1);
function adicionarGeometria(novaGeometria) {
trajeto_json.addData(novaGeometria);
@ -223,7 +243,7 @@
}
trajeto_dinamico_json_add({"features": []});
trajeto_dinamico_json.addTo(map_4d8eed9407dc7769ca15b0f680376c9e);
trajeto_dinamico_json.addTo(map_e9b1b3ee64db174d6f4543ce38e0b5e1);
function adicionarGeometriaDinamica(novaGeometria) {
trajeto_dinamico_json.addData(novaGeometria);
@ -276,9 +296,9 @@
var marcadorEquipamento = L.marker([0, 0], {
icon: customIcon
}).addTo(map_4d8eed9407dc7769ca15b0f680376c9e);
}).addTo(map_e9b1b3ee64db174d6f4543ce38e0b5e1);
var marcadorBase = L.marker([0, 0], {}).addTo(map_4d8eed9407dc7769ca15b0f680376c9e);
var marcadorBase = L.marker([0, 0], {}).addTo(map_e9b1b3ee64db174d6f4543ce38e0b5e1);
var icon = L.AwesomeMarkers.icon(
{"extraClasses": "fa-rotate-0", "icon": "info-sign", "iconColor": "white", "markerColor": "red", "prefix": "glyphicon"}
);
@ -360,7 +380,7 @@
}
if (foco) {
map_4d8eed9407dc7769ca15b0f680376c9e.setView(novaPosicao, map_4d8eed9407dc7769ca15b0f680376c9e.getZoom());
map_e9b1b3ee64db174d6f4543ce38e0b5e1.setView(novaPosicao, map_e9b1b3ee64db174d6f4543ce38e0b5e1.getZoom());
}
}
@ -377,7 +397,7 @@
function atualizarSelecaoRuas(selecionadas) {
selecionadas = JSON.parse(selecionadas);
RuasSelecionadas = Array.isArray(selecionadas) ? [...selecionadas] : [];
geo_json_cdfc1fc555c70965b47aeaab833de403.eachLayer(function (layer) {
geo_json_b7203db4da92fe2236826b29ddbfaf68.eachLayer(function (layer) {
if (RuasSelecionadas.includes(parseInt(layer.feature.id))) {
layer.setStyle({ color: 'blue' });
} else {

View File

@ -61,9 +61,85 @@ class ControladorMPC:
self._mpc_headroom_ms = 25.0 # respiro p/ IO/log/atuadores
self.debug_cost_vis = False
self._cl_xy = None # Nx2
self._seg_p0 = None # (N-1)x2
self._seg_v = None # (N-1)x2
self._seg_L = None # (N-1,)
self._seg_t_hat = None # (N-1)x2 unit tangent
self._seg_n_hat = None # (N-1)x2 unit normal (esquerda)
self._s_nodes = None # (N,)
self._mg_nodes = None # (N,)
self._precompute_centerline()
except Exception as e:
mostrar_log(f"Erro ao inicializar MPC: {e}")
def _precompute_centerline(self):
cl = np.array([p["xy"] for p in self.pontos_info], dtype=float) # N x 2
if cl.shape[0] < 2:
# linha degenerada
self._cl_xy = cl
self._seg_p0 = self._seg_v = self._seg_L = self._seg_t_hat = self._seg_n_hat = None
self._s_nodes = np.zeros((cl.shape[0],), float)
self._mg_nodes = np.array([p.get("distanciaMargem", 0.7) for p in self.pontos_info], float)
return
p0 = cl[:-1]
p1 = cl[1:]
v = p1 - p0
L = np.linalg.norm(v, axis=1) + 1e-12
t_hat = v / L[:, None]
n_hat = np.stack([-t_hat[:,1], t_hat[:,0]], axis=1) # normal à esquerda
# curvilinear abscissa s (acumulada por nó)
s_nodes = np.zeros((cl.shape[0],), float)
s_nodes[1:] = np.cumsum(L)
mg_nodes = np.array([p.get("distanciaMargem", 0.7) for p in self.pontos_info], float)
self._cl_xy = cl
self._seg_p0 = p0
self._seg_v = v
self._seg_L = L
self._seg_t_hat = t_hat
self._seg_n_hat = n_hat
self._s_nodes = s_nodes
self._mg_nodes = mg_nodes
def cross_track_error_point(self, x, y):
"""
Retorna:
e_lat -> erro lateral assinado (m; + à esquerda da tangente do segmento)
s_proj -> coordenada curvilínea ao longo da linha (m)
i_seg -> índice do segmento mais próximo usado na projeção
proj -> ponto projetado (2,)
theta_path -> orientação do caminho (rad) naquele segmento
margem_interp -> margem interpolada (m) naquele s
"""
if self._seg_p0 is None or self._seg_p0.shape[0] == 0:
return 0.0, 0.0, 0, np.array([x, y], float), 0.0, 0.7
P = np.array([x, y], float)
w = P - self._seg_p0 # (M,2)
L2 = (self._seg_L ** 2) # (M,)
t = np.clip(np.sum(w * self._seg_v, axis=1) / L2, 0.0, 1.0) # (M,)
proj = self._seg_p0 + t[:, None] * self._seg_v # (M,2)
d2 = np.sum((proj - P)**2, axis=1) # (M,)
i = int(np.argmin(d2))
# projeção escolhida
proj_i = proj[i]
e_lat = float(np.dot(P - proj_i, self._seg_n_hat[i])) # sinal pela normal esquerda
s_proj = float(self._s_nodes[i] + t[i] * self._seg_L[i])
theta_path = float(np.arctan2(self._seg_t_hat[i,0], self._seg_t_hat[i,1])) # 0=Norte se (x=E,y=N)
# margem interpolada entre nós i e i+1
mg0 = self._mg_nodes[i]
mg1 = self._mg_nodes[i+1] if (i+1) < self._mg_nodes.size else mg0
margem = float((1.0 - t[i]) * mg0 + t[i] * mg1)
return e_lat, s_proj, i, proj_i, theta_path, margem
def _ensure_luts(self, dados_matriz_custo, largura_equip, L):
if not dados_matriz_custo or dados_matriz_custo.get("Custo") is None:
return
@ -242,18 +318,7 @@ class ControladorMPC:
# UTILS
def _proximo_nao_visitado(self, visitados):
try:
for i, v in enumerate(visitados):
if not v:
return i
return len(visitados) - 1
except Exception as e:
mostrar_log(f"Erro ao consultar proximo ponto nao visitado: {e}")
def _corrigir_pontos_visitados(self, x, y, pontos_visitados: np.ndarray, idx_atual: int = -1,
limite_max_avanco: float = 5.0, # em METROS
limite_max_pontos: int = 10, velocidade: float = -1, dt: float = -1, look_ahead: bool = True):
def _corrigir_pontos_visitados_new(self, x, y, pontos_visitados: np.ndarray, idx_atual: int = -1, limite_max_avanco: float = 5.0, limite_max_pontos: int = 10, velocidade: float = -1, dt: float = -1, look_ahead: bool = True):
try:
p_xy, p_mg, p_s = self._p_xy, self._p_margem, self._p_s
N = p_xy.shape[0]
@ -285,7 +350,7 @@ class ControladorMPC:
margem2 = p_mg[sl] * p_mg[sl]
# --- (2) Opcional para fidelidade ao antigo: usar '<' em vez de '<=' ---
hits = dist2 <= margem2 # era <=
hits = dist2 < margem2 # era <=
if np.any(hits):
off = int(np.argmax(hits))
@ -311,7 +376,16 @@ class ControladorMPC:
except Exception:
return -1
def _corrigir_pontos_visitados_old(self, x, y, pontos_visitados, idx_atual=-1, limite_max_avanço=5.0):
def _proximo_nao_visitado(self, visitados):
try:
for i, v in enumerate(visitados):
if not v:
return i
return len(visitados) - 1
except Exception as e:
mostrar_log(f"Erro ao consultar proximo ponto nao visitado: {e}")
def _corrigir_pontos_visitados(self, x, y, pontos_visitados, idx_atual=-1, limite_max_avanco=5.0, limite_max_pontos: int = 10, velocidade: float = -1, dt: float = -1, look_ahead: bool = True):
if (idx_atual > -1):
for idx, ponto in enumerate(self.pontos_info):
if (idx < idx_atual):
@ -330,24 +404,25 @@ class ControladorMPC:
for i in range(idx + 1):
pontos_visitados[i] = True
return idx
if idx > 0 and not pontos_visitados[idx - 1] and idx >= limite_max_avanço:
if idx > 0 and not pontos_visitados[idx - 1] and idx >= limite_max_avanco:
break
return self._proximo_nao_visitado(pontos_visitados)
def _calcular_pesos_movimento(self, contexto, erro_ori_rad):
try:
peso_erro_pos = 1.2 # 0
peso_erro_ori = 1.0 # 1
peso_suavidade = 1.5 # 2
peso_fator_re = 0.2 # 3
peso_ideal = 0.4 # 4
CARRO = contexto.get("Carro", {})
status = StatusCarroMapa(CARRO.get("Status", StatusCarroMapa.Parado.value))
dentro = CARRO.get("DentroCorredor", False)
manobrando = CARRO.get("ManobrandoEntreRuas", False)
velocidade = CARRO.get("Velocidade", self.velocidade_min)
peso_erro_pos = 1.2 # 0
peso_erro_ori = 1.0 # 1
peso_suavidade = 1.5 # 2
peso_fator_re = 0.2 # 3
peso_ideal = 0.4 # 4
peso_lateral = 1.8 if dentro else 0.0 # 5
# Penalidade proporcional à velocidade
penalidade_por_velocidade = (velocidade / self.velocidade_max) / 10.0
erro_ori_deg = np.degrees(erro_ori_rad)
@ -366,7 +441,7 @@ class ControladorMPC:
custo_movimento[TipoMovimentoDirecional.MovimentoArco] += 0.0 if erro_ori_norm >= 0.4 else 1.0
custo_movimento[TipoMovimentoDirecional.RodasDianteiras] += 1.2 if erro_ori_norm >= 0.4 else 0.0
return (peso_erro_pos, peso_erro_ori, peso_suavidade, peso_fator_re, peso_ideal, custo_movimento)
return (peso_erro_pos, peso_erro_ori, peso_suavidade, peso_fator_re, peso_ideal, peso_lateral, custo_movimento)
except Exception as e:
mostrar_log(f"Erro ao calcular pesos de movimento: {e}")
@ -1154,6 +1229,8 @@ class ControladorMPC:
tipo_final = TipoMovimentoDirecional.RodasDianteiras
simulacao_latlon = []
erro_lateral = self.cross_track_error_point(x, y)[0]
_cmd = {
"enviar_comando": True,
"parada_necessaria": parada_necessaria,
@ -1161,7 +1238,8 @@ class ControladorMPC:
"latencia": pos_latencia,
"angulo": float(round(np.degrees(angulo_final), 2)),
"tipo": tipo_final.value,
"simulacao": simulacao_latlon
"simulacao": simulacao_latlon,
"erro_lateral": erro_lateral
}
# -------------------- Debug opcional da matriz de custo --------------------
@ -1210,7 +1288,8 @@ class ControladorMPC:
"latencia": latencia,
"angulo": comando_anterior.get("angulo", 0),
"tipo": comando_anterior.get("tipo", TipoMovimentoDirecional.RodasDianteiras.value),
"simulacao": []
"simulacao": [],
"erro_latreral": 0
}
return _cmd
@ -2040,10 +2119,11 @@ class ControladorMPC:
erro_pos = float(np.linalg.norm([x_sim - ponto_alvo_sim[0], y_sim - ponto_alvo_sim[1]]))
peso_erro_orientacao_caminho = 0.3 if (status_carro == StatusCarroMapa.CaminhandoRua and dentro_corredor) else 0.7
erro_ori_sim = self.gps_handler.erro_angular(orient_sim, theta_sim, angulo_caminho, peso_erro_orientacao_caminho)
erro_lateral = self.cross_track_error_point(x_sim, y_sim)[0]
# pesos dinâmicos
pesos = self._calcular_pesos_movimento(contexto, erro_ori_sim)
peso_erro_pos, peso_erro_ori, peso_suavidade, peso_fator_re, peso_movimento = pesos[0], pesos[1], pesos[2], pesos[3], pesos[5]
peso_erro_pos, peso_erro_ori, peso_suavidade, peso_fator_re, peso_ideal, peso_lateral, peso_movimento = pesos
# ângulo relativo ao alvo e suavidade
vetor_alvo = np.array(ponto_alvo_sim) - np.array([x_sim, y_sim])
@ -2059,11 +2139,14 @@ class ControladorMPC:
custo_tipo_movimento = float(peso_movimento[tipo])
erro_re = (1.0 - cos_angulo) if cos_angulo > 0 else cos_angulo
custo_re = -erro_re * erro_pos * peso_fator_re
custo_lateral = abs(erro_lateral) * peso_lateral
# soma local (heurística do visual + demais), e NORMALIZA por metro
custo_mapa = (custo_pos + custo_ori + custo_suavidade + custo_tipo_movimento + custo_re + custo_visual_worker)
custo_mapa = (custo_pos + custo_ori + custo_suavidade + custo_tipo_movimento + custo_re + custo_lateral + custo_visual_worker)
custo_total += custo_mapa * dist_sub # <<< custo POR METRO
#print(f"Angulo: {np.degrees(angulo_testado):.2f}, Tipo: {tipo.name}, Theta: {np.degrees(theta):.2f}, ep: {erro_pos:.4f}, eo: {erro_ori_sim:.4f}, er: {erro_re:.4f}, el: {erro_lateral:.4f}")
prev_ang = angulo_testado
prev_tipo = tipo

View File

@ -39,7 +39,8 @@ class ProcessadorEmAndamento(ProcessadorBase):
tipo_movimento=comando_dir.get("tipo"),
simulacao=comando_dir.get("simulacao"),
erro=comando_dir.get("erro", False),
latencia=comando_dir.get("latencia", 0.0)
latencia=comando_dir.get("latencia", 0.0),
erro_lateral=comando_dir.get("erro_lateral", 0.0)
)
except Exception as e:
print(f"Erro no processador EmAndamento: {e}")

View File

@ -3,7 +3,7 @@ from shared.enums import ModoOperacao, StatusOperacao
from manager_worker.config import mostrar_log
from shared.contexto_global_redis import ContextoGlobalRedis, CtxKey
def comando_controle(percentual_velocidade: float, frear: bool, angulo: float, tipo_movimento: int, simulacao = [], erro: bool = False, latencia: float = 0.0):
def comando_controle(percentual_velocidade: float, frear: bool, angulo: float, tipo_movimento: int, simulacao = [], erro: bool = False, latencia: float = 0.0, erro_lateral: float = 0.0):
hb_atual = ContextoGlobalRedis.get_controle().get("heartbeat", 0)
if erro == False:
try:
@ -20,7 +20,8 @@ def comando_controle(percentual_velocidade: float, frear: bool, angulo: float, t
em_freio=frear,
simulacao=simulacao,
heartbeat=hb_atual,
latencia=latencia
latencia=latencia,
erro_lateral=erro_lateral
)
return {
"velocidade_sp": percentual_velocidade,
@ -29,7 +30,8 @@ def comando_controle(percentual_velocidade: float, frear: bool, angulo: float, t
"tipo_movimento_direcional": tipo_movimento,
"simulacao": simulacao,
"heartbeat": hb_atual,
"latencia": latencia
"latencia": latencia,
"erro_lateral": erro_lateral
}
def comando_parado():