Машинні та сенсорні вхідні дані (0,38)
Зчитувачі, які вводять інші приймачі, розв'язувачі та датчики в тип receiver-trust. Кожен із них лише читає: це чисті функції над байтами чи текстом, що повертають ту саму часову послідовність, яку повертають зчитувачі UBX, RINEX, Android і NMEA, пропускаючи й підраховуючи пошкоджені записи замість збою. Усе тут MODELLED: формати прочитано з публічної документації, і жоден результат не перевірено за зовнішнім оракулом, окрім того, що зазначено.
Консультативне програмне забезпечення. Не навігаційне обладнання із затвердженням типу. Відповідальність за безпечну навігацію судна залишається на операторі.
RTKLIB .pos (format = "rtklib-pos")#
Файл розв'язку, який записують rnx2rtkp і RTKPOST з RTKLIB. Зчитується: час (календарний yyyy/mm/dd hh:mm:ss.sss або тиждень GPS і секунди тижня), положення (широта й довгота в градусах з висотою або ECEF X/Y/Z, перетворені на геодезичні) і кількість супутників. Шкала часу із заголовка стовпця (GPST, UTC, JST) переноситься в мітку. Файли в градусах-хвилинах-секундах відхиляються. Рядки, що починаються з %, є рядками заголовка.
NovAtel OEM7 (format = "novatel")#
Журнали ASCII (#BESTPOSA,...*crc) і двійкові (заголовок AA 44 12), які можна довільно змішувати. Структури відповідають публічній документації OEM7 (docs.novatel.com): заголовки повідомлень, 32-бітний CRC і таблиці полів трьох журналів. Записи, чий CRC не збігається, пропускаються й підраховуються.
| Журнал | ID | Використовується |
|---|---|---|
BESTPOS |
42 | статус розв'язку (визначення місця дає лише SOL_COMPUTED), широта, довгота, висота над середнім рівнем моря плюс ундуляція (висота визначення місця є еліпсоїдальною), використані супутники |
RANGE |
43 | C/No для кожного сигналу (dB-Hz); система з бітів 16–18 статусу відстеження, тип сигналу з бітів 21–25 |
RXSTATUS |
93 | біт 15 статусу приймача (виявлено джаммер) стає self_report епохи (глушіння 2 позначено, 1 ні; у RXSTATUS немає прапорця спуфінгу), порівнюється з тривогами Kshana через receiver-self-report; допоміжні біти джаммера 1 (RF1–RF6) повертаються в NovatelRead.status |
Процедуру CRC перевірено за CRC, який документація наводить для власного прикладу BESTPOSA (процитовано, не відтворено дослівно); тести використовують рядки, написані власноруч. Не зчитується: скорочений ASCII, інші журнали. Прапорець джаммера — це власне повідомлення приймача, а не висновок Kshana; збіг із моніторами Kshana не є незалежною перевіркою.
GNSS-SDR (format = "gnss-sdr")#
Див. integrations/gnss-sdr/README.md. Виходи NMEA та RINEX від GNSS-SDR уже зчитуються за допомогою nmea і rinex; потоки UDP Monitor і PVT-monitor (Protocol Buffers) ретранслюються в рядки JSON за допомогою relay.py і зчитуються за допомогою gnss-sdr.
IMU ([log.imu])#
format = "csv": a header row naming the columns, then one sample per row. Columns (any order,
names case-insensitive): t_s seconds on the receiver log's clock, gx, gy, gz angular rate
in rad/s, ax, ay, az specific force in m/s². format = "euroc": the EuRoC MAV imu0
data.csv layout (#timestamp [ns], w_RS_S_x/y/z [rad s^-1], a_RS_S_x/y/z [m s^-2]); the
first sample is t_s = 0. format = "ros2-csv": ROS 2 sensor_msgs/msg/Imu as ros2 topic echo --csv prints it (no header; 40 fields in message order; t_s is the stamp, seconds plus nanoseconds), so
a recorded or live ROS 2 topic is read with no bridge code. Rows that do not parse, and rows whose time does not increase, are
skipped. See RECEIVER-TRUST.md for how the gyro heading is used.
IMU live (kshana sensor-live --kind imu)#
my-imu-to-csv /dev/ttyUSB1 | kshana sensor-live --kind imu --format csv --from - --heading0 90
ros2 topic echo /imu/data sensor_msgs/msg/Imu --csv | kshana sensor-live --kind imu --format ros2-csv --from -
kshana sensor-live --kind imu --format euroc --from imu0/data.csv --follow
sensor-live reads the same two layouts a line at a time, from standard input, tcp:host:port or a
file (--follow waits for more lines), and prints one JSON line per sample: t_s, gyro, accel and
heading_deg, the gyro heading integrated from --heading0 (default 0; --z-up for a body z axis
pointing up). The line reader is the one [log.imu] uses, and the heading is summed in the same order as
the heading-course monitor sums it, so the live samples and headings equal a replay of the same file, bit
for bit (tests/clock_live.rs). A serial IMU is read through the tool that turns it into CSV lines; Kshana
opens no device.
NMEA 2000 from a CAN bus (kshana sensor-live --kind n2k)#
candump -L can0 | kshana sensor-live --kind n2k --from -
kshana sensor-live --kind n2k --from recorded-candump.log > vessel.nmea
Reads SocketCAN candump -l/-L lines (29-bit identifiers; 11-bit frames are not NMEA 2000 and are
passed over) and prints NMEA 0183 sentences: PGN 129025 (position, rapid update) gives $GPRMC with the
latest PGN 129026 course and speed; PGN 127250 (vessel heading) gives $HEHDT (true) or $HCHDM
(magnetic); PGN 126992 (system time) dates the sentences, otherwise the frame's capture time does. Values
marked "not available" are left empty. The layouts are the openly documented ones (canboat); the NMEA 2000
standard is not reproduced. Multi-frame (fast-packet) groups, such as GNSS position data, are not read yet.
The conversion is the same function over a live stream and over a recorded log (kshana::n2k::convert),
and the output is read by the NMEA reader unchanged (tests/clock_live.rs). USB-CAN gateways that present a
SocketCAN interface (slcan, gs_usb) work the same way; nothing is sent on the bus.
Timing and health of live inputs (clock-live, sensor-live)#
Every live reading line carries host_s: the host clock when the line arrived, minus the device's
latency (--latency-s, measured once against a common reference such as a PPS edge). The host clock is
the one chrony, PTP or PPS disciplines, so readings from several devices on one machine share one time
base whatever their own clocks report.
Each live command watches its sensor and prints events as JSON lines beside the readings (sensor-live --kind n2k prints them on standard error, since its output is NMEA):
| Flag | Event | When |
|---|---|---|
--stale-s <s> |
stale, then stale-cleared |
no reading for that long, then one again |
--frozen-n <n> |
frozen, then frozen-cleared |
the same value n times in a row, then a change |
--range <lo,hi> |
out-of-range, then in-range |
the value leaves [lo, hi], then returns |
--reconnect |
gap with from_s and host_s |
the device or connection ended or failed; it is opened again every second, and the time without input is reported when it is back |
The watched value is the kept offset for clock-live and the magnitude of the specific force for an IMU.
Each condition is reported once when it starts and once when it clears. A gap is marked, never filled: no
reading is made up for it. --sensor <name> names the sensor in events. tests/clock_live.rs checks a
TCP source dropped and brought back (the gap reported, the readings on both sides equal to the replay),
and the frozen and range events. What needs the bench (L8): two sensors on one PPS agreeing within a
pre-registered skew, and a real unplug and replug.
IMU у гібридних сценаріях і сценаріях злиття (kshana imu-fit)#
Сценарії hybrid і fusion (UKF із 17 станами) є симуляціями: вони приймають параметри шуму датчиків ([accel_quantum], [accel_classical]: bias, q_va, gyro_bias, q_arw, bias_instability), а не виміряний ряд. imu-fit зчитує ці параметри зі стаціонарного журналу IMU, тож сценарій можна запустити з датчиком, який у вас справді є:
kshana imu-fit still.csv --format csv --axis x --expected-mean 0 --id bench-imu # prints the TOML table
kshana imu-fit still.csv --axis z --expected-mean 9.80665 --json # whole report
Метод: перекривна девіація Аллана інтегрованого сигналу (allan::overlapping_adev_curve): q_va = (sigma(tau0) sqrt(tau0))^2, те саме для гіроскопа z (q_arw), bias і gyro_bias як середні, а bias_instability як мінімум кривої, коли після нього крива йде вгору. q_aa не підганяється (потрібен журнал значно довший за поріг). Звіт містить частоту та тривалість журналу й ранній нахил Аллана кожного каналу (близько -0.5, де домінує білий шум); журнал, що не є нерухомим, або надто короткий (менше 2000 відліків), або нерівномірно дискретизований, відхиляється або дає параметри, які нахили позначають. Походження таблиці називає SHA-256 журналу. MODELLED: оцінювач перевірено на синтетичних журналах білого шуму з відомими коефіцієнтами (відновлено в межах 10 %), а не за зовнішнім оракулом. Доступно в CLI, Python (imu_fit), WebAssembly (imu_fit), MCP (fit_imu_log) і в плагіні (/kshana-fit-imu).
RTCM 3 MSM4 і MSM7 (format = "rtcm3")#
Байтовий потік кадрів RTCM 3 (вихід спостережень базової станції або приймача). Зчитується: повідомлення MSM4 і MSM7 (GPS 1074/1077, GLONASS 1084/1087, Galileo 1094/1097, SBAS 1104/1107, QZSS 1114/1117, BeiDou 1124/1127, NavIC 1134/1137): епоха та відношення сигнал/шум несівної кожної комірки сигналу (MSM4: 6 біт, dB-Hz; MSM7: 10 біт, 1/16 dB-Hz), що потрібно моніторам C/N0. Поля псевдодальності та фази перестрибуються, а не використовуються, тож RTCM дає моніторам довіри C/N0 і більше нічого; у MSM немає положення. Кадри з поганим CRC-24Q пропускаються й підраховуються.
Звідки береться структура. Не зі стандарту RTCM (платний документ, не використовувався): з декодера з відкритим кодом pyrtcm 1.2.0, BSD 3-Clause, ліцензія та примітка якого містяться в NOTICE (рішення власника від 18 жовт. 2026: «використовувати відкриті декодери»). pyrtcm заявляє, що його таблиці відповідають RTCM 10403,3; Kshana спирається на опубліковані таблиці за ліцензією pyrtcm і не робить жодних тверджень щодо стандарту. Час: MSM не містить тижня, тому мітки читаються як GPS TOW <s>; епохи GLONASS (московський час) переводяться на час GPS із GPS-UTC = 18 s (значення з 2017-01-01).
Перевірено за: контрольним значенням каталогу CRC-24Q (123456789 дає 0xCDE703) і, одноразово під час розробки, власним декодером pyrtcm на тих самих самостійно написаних кадрах (той самий C/N0). Фікстури написано власноруч; жодного захоплення від реального приймача не робилося, тож зчитувач є MODELLED, доки не прочитає таке.