Velocidad y rumbo para tractores de patio: ¿calcular en el rastreador o después de que lleguen los datos?
Traducido del English por IA ·
Operamos 14 tractores de patio que mueven remolques por la planta. Cada uno tiene una caja que mandé fabricar: Arduino Mega, SIM800L, u-blox NEO-6M. Envía latitud y longitud cada 30 segundos por GPRS a Hermetry, y la tarjeta del mapa se ve muy bien.Ahora logística quiere velocidad (tenemos un límite de 15 km/h en el patio) y sentido de marcha. Mi contratista dice «hacedlo en la nube a partir de puntos consecutivos». El otro contratista dice «hacedlo en la caja». Tengo que pagarle a uno de los dos. ¿Cuál tiene razón?
We run 14 yard tractors moving trailers around the plant. Each has a box I had built: Arduino Mega, SIM800L, u-blox NEO-6M. It sends lat and lng every 30 seconds over GPRS to Hermetry and the map card looks great.
Now logistics wants speed (we have a 15 km/h yard limit) and direction of travel. My contractor says «do it in the cloud from consecutive points». The other contractor says «do it on the box». I have to pay one of them. Which is right?
Traducido del English por IA ·
¿Desde dos puntos es simplemente distancia entre tiempo? Fórmula de Haversine, con 30 s de diferencia. Parece fácil de hacer en cualquier lugar.
From two points it’s just distance over time? Haversine formula, 30 s apart. Seems easy to do anywhere.
Traducido del English por IA ·
¿Enviar más valores cuesta más datos? Nuestro plan de SIM para los sensores de aparcamiento es muy pequeño.
Does sending more values cost more data? Our SIM plan for the parking sensors is tiny.
Traducido del English por IA ·
Ni lo uno ni lo otro, más o menos. El NEO-6M ya te proporciona ambos. La sentencia $GPRMC incluye la velocidad sobre el suelo (en nudos) y el rumbo sobre el suelo, y el receptor obtiene la velocidad a partir del efecto Doppler, que es mucho mejor que restar dos posiciones tomadas con 30 s de diferencia. Dos posiciones separadas 30 s mostrarán un tractor que fue y volvió por un pasillo como si estuviera detenido.Con TinyGPS++ son dos líneas:
float kmh = gps.speed.kmph(); // already converted from knots
float hdg = gps.course.deg();
snprintf(buf, sizeof buf,
"{"lat":%.6f,"lng":%.6f,"speed_kmh":%.1f,"course_deg":%.0f}",
gps.location.lat(), gps.location.lng(), kmh, hdg);
Envíalos como números en el mismo mensaje que lat/lng. Mismo mensaje, mismo coste, así que para @roberts.r son unos bytes más, no otro mensaje. Luego una regla de alarma sobre speed_kmh > 15 con un debounce de 2 lecturas para que un solo salto del GPS no la dispare.Si alguna vez necesitas algo calculado a posteriori (distancia por turno, por ejemplo), eso va en el flujo raíz antes de Save telemetry como clave derivada.
Neither contractor, sort of. The NEO-6M already gives you both. The $GPRMC sentence has speed over ground (in knots) and course over ground, and the receiver gets speed from Doppler, which is far better than differencing two fixes 30 s apart. Two fixes 30 s apart will show a tractor that went down and back an aisle as standing still.
With TinyGPS++ it’s two lines:
float kmh = gps.speed.kmph(); // already converted from knots
float hdg = gps.course.deg();
snprintf(buf, sizeof buf,
"{"lat":%.6f,"lng":%.6f,"speed_kmh":%.1f,"course_deg":%.0f}",
gps.location.lat(), gps.location.lng(), kmh, hdg);
Send them as numbers in the same message as lat/lng. Same message, same cost, so @roberts.r it’s a few bytes more, not another message. Then an alarm rule on speed_kmh > 15 with a debounce of 2 readings so one GPS jump doesn’t fire it.
If you ever do need something computed after the fact (distance per shift, say), that goes in the root flow before Save telemetry as a derived key.
Traducido del English por IA ·
No pagué nada, mi técnico de mantenimiento lo hizo en una tarde con tu snippet. El rumbo es inestable por debajo de 2 km/h, así que solo lo mostramos cuando speed_kmh > 2. Primera semana: 6 alarmas, todas del mismo conductor. Logística está contenta.
Paid neither, my maintenance tech did it in an afternoon with your snippet. Course is jumpy below 2 km/h so we only show it when speed_kmh > 2. First week: 6 alarms, all the same driver. Logistics is happy.
Traducido del English por IA ·
TIL: el GPS hace Doppler. Mucho más inteligente que mi idea con haversine.
TIL the GPS does Doppler. Way smarter than my haversine idea.
- Debes estar registrado para responder a este debate.
Únete a la conversación
Inicia sesión para preguntar y responder, dar me gusta a las publicaciones útiles y marcar la respuesta que resolvió tu problema. Cada aportación suma puntos y niveles.

