Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
77a8571
-Boilerplate project for command and messages tool
lorenzo-gomez-windhover Sep 9, 2020
3c3f749
-Started working on message implementation
lorenzo-gomez-windhover Sep 10, 2020
5001efa
-Deleted venv junk
lorenzo-gomez-windhover Sep 10, 2020
c32922e
-We have a functional implementation for telemetry, commands, events,…
lorenzo-gomez-windhover Sep 11, 2020
70a61c1
Added gitignore
lorenzo-gomez-windhover Sep 11, 2020
57b8a3a
Added requirements file for pip
lorenzo-gomez-windhover Sep 11, 2020
654440b
Added baseline docs
lorenzo-gomez-windhover Sep 11, 2020
7108c31
-Fixed readme
lorenzo-gomez-windhover Sep 14, 2020
4bbad1e
-Updated requirements
lorenzo-gomez-windhover Sep 16, 2020
33a5240
-Added merged yaml file
lorenzo-gomez-windhover Sep 17, 2020
1a967c9
-Updated script to adjust to the combined yaml file
lorenzo-gomez-windhover Sep 17, 2020
5a2a6cd
-Fixed configurations schema
lorenzo-gomez-windhover Sep 18, 2020
47c1294
-Documented schemas
lorenzo-gomez-windhover Sep 18, 2020
90ce89c
-Updated schemas
lorenzo-gomez-windhover Sep 18, 2020
e8bff86
-Updated tlm_cmd_merger for new schema without modules.
Sep 21, 2020
711a9bf
-Updated readme on symbols schema without modules
lorenzo-gomez-windhover Sep 23, 2020
d93f642
Merge branch 'develop' of https://github.com/WindhoverLabs/tlm_cmd_me…
lorenzo-gomez-windhover Sep 23, 2020
925a102
-Updated readme
lorenzo-gomez-windhover Sep 23, 2020
bca5eed
Updated readme
Sep 24, 2020
99877c4
-Added message_id to UNIQUE constraint on the commands tale
lorenzo-gomez-windhover Oct 1, 2020
b73ad27
-Updated yaml file
lorenzo-gomez-windhover Oct 1, 2020
8cbe685
-Updated yaml config file
lorenzo-gomez-windhover Oct 2, 2020
f1dd2ea
-Validated yaml file
lorenzo-gomez-windhover Oct 2, 2020
817ade3
-Removed old yaml file
lorenzo-gomez-windhover Oct 2, 2020
4ae0f3a
-Fixed yaml
lorenzo-gomez-windhover Oct 2, 2020
2cac627
-Updated readme
lorenzo-gomez-windhover Oct 2, 2020
c4b9c94
-Added support for cfe core modules
lorenzo-gomez-windhover Oct 2, 2020
57ab71b
-Fixed yaml file
lorenzo-gomez-windhover Oct 2, 2020
46f9244
-Added telemetry and commands for cfe modules
lorenzo-gomez-windhover Oct 2, 2020
e4cd45b
-Fixed issue when adding cfe telemetry
lorenzo-gomez-windhover Oct 2, 2020
69933e8
-Fixed issue when adding cfe telemetry
lorenzo-gomez-windhover Oct 2, 2020
2a82766
-Fixed bug when writing telemetry to database
lorenzo-gomez-windhover Oct 2, 2020
0ca6ef6
-tlm_cmd_merger is more modular now
lorenzo-gomez-windhover Oct 8, 2020
0b609ed
-Fixed elf paths
lorenzo-gomez-windhover Oct 8, 2020
f08e57d
-'Core' key is not necessary in our config files anymore
lorenzo-gomez-windhover Oct 9, 2020
1e1e28f
-Fixed bug when writing modules to database
lorenzo-gomez-windhover Oct 9, 2020
bf6ceb9
-Added pycache to gitignore
lorenzo-gomez-windhover Oct 9, 2020
b4bae74
-Updated config file for squeaky_weasel build
lorenzo-gomez-windhover Oct 13, 2020
1194fa0
-Added ICM module and elf to config file
lorenzo-gomez-windhover Oct 14, 2020
095f33a
-Fixed error in combined.yml
lorenzo-gomez-windhover Oct 15, 2020
d6607f2
-Event ids are written correctly to the database now
lorenzo-gomez-windhover Oct 15, 2020
13e5d15
-Event ids are written correctly to the database now
lorenzo-gomez-windhover Oct 15, 2020
bf182cd
-Fixed typo in LC_PASSIVE_FAIL_DBG_EID's event id
lorenzo-gomez-windhover Oct 15, 2020
f9496f3
-Event names are stored in the database now
lorenzo-gomez-windhover Oct 15, 2020
a81bacd
-Event names are stored in the database now
lorenzo-gomez-windhover Oct 15, 2020
d66d769
-Event macros are stored in the database now
lorenzo-gomez-windhover Oct 23, 2020
c4b704d
-Event macros are stored in the database now
lorenzo-gomez-windhover Oct 23, 2020
92a3bc3
-Event macros are stored in the database now
lorenzo-gomez-windhover Oct 23, 2020
5e894d3
-Event macros are stored in the database now
lorenzo-gomez-windhover Oct 23, 2020
eecf103
-Telemetry macros for airliner's core are written to the database now
lorenzo-gomez-windhover Oct 23, 2020
fcd0263
-Updated configuration to use bebop2/sitl build
lorenzo-gomez-windhover Oct 26, 2020
7909229
-Command macros are written to the database now
lorenzo-gomez-windhover Nov 6, 2020
f0d94f5
-Command macros are written to the database now
lorenzo-gomez-windhover Nov 6, 2020
702d5d8
-Added definition overrides to config files
lorenzo-gomez-windhover Nov 25, 2020
0a550be
-Updated docs
lorenzo-gomez-windhover Nov 25, 2020
0bb2983
Added additional error checking. (#10)
mbenson1 Jan 21, 2021
f25c5e9
-Recursive modules are included now (#11)
lorenzo-gomez-windhover Jan 21, 2021
8d44154
-Fixed telemetry for core (#13)
lorenzo-gomez-windhover Jan 21, 2021
d690a7c
-Updated gitignore (#14)
lorenzo-gomez-windhover Jan 29, 2021
e7dd32b
-Fixed commands key bug (#15)
lorenzo-gomez-windhover Jan 29, 2021
0692ee2
-Fixed edge case on configuration (#16)
lorenzo-gomez-windhover Feb 17, 2021
3122f8b
-Fixed edge case in configuration parsing
lorenzo-gomez-windhover Feb 19, 2021
27dbff5
-Fixed edge case in configuration parsing (#17)
lorenzo-gomez-windhover Feb 19, 2021
ffc78ab
-Added more user feedback
lorenzo-gomez-windhover Feb 24, 2021
89aca2b
Merge branch 'develop' into bug_fix
lorenzo-gomez-windhover Feb 24, 2021
7199582
-Added more user feedback (#18)
lorenzo-gomez-windhover Feb 24, 2021
0544104
Merge remote-tracking branch 'origin/develop' into bug_fix
lorenzo-gomez-windhover Mar 29, 2021
7669c94
-None message_id check
lorenzo-gomez-windhover Mar 29, 2021
878ff8d
Merge branch 'develop' into bug_fix
lorenzo-gomez-windhover Apr 26, 2021
82f5c68
-Events error-checking
lorenzo-gomez-windhover Apr 26, 2021
9007b8d
Merge branch 'bug_fix' of https://github.com/WindhoverLabs/tlm_cmd_me…
lorenzo-gomez-windhover Apr 26, 2021
3b26504
Bug fix (#19)
lorenzo-gomez-windhover Apr 26, 2021
e4a4228
Merge branch 'develop' into bug_fix
lorenzo-gomez-windhover Apr 26, 2021
4672ec0
Bug fix (#20)
lorenzo-gomez-windhover Apr 26, 2021
fab486e
Merge remote-tracking branch 'origin/develop' into bug_fix
lorenzo-gomez-windhover Apr 26, 2021
51f2907
Docs (#21)
lorenzo-gomez-windhover Oct 1, 2021
2c2edce
Docs (#22)
lorenzo-gomez-windhover Oct 5, 2021
8676bf1
Merge branch 'bug_fix' into develop
mbenson1 Dec 23, 2021
6b23882
Merge pull request #23 from WindhoverLabs/integration
mbenson1 Dec 23, 2021
1a30d93
-Add min_rate to database. Fixes #24.
lorenzo-gomez-windhover Nov 11, 2022
e488265
Merge branch '24_min_rate' into 'develop'
lorenzo-gomez-windhover May 10, 2023
6be5217
-Add algorithm tables to sqlite db.
lorenzo-gomez-windhover May 10, 2023
5b2f7b0
-Add algorithm inputs, outputs and triggers to sqlite db. WIP.
lorenzo-gomez-windhover May 10, 2023
48b866d
-Add algorithm inputs, outputs and triggers to sqlite db
lorenzo-gomez-windhover May 11, 2023
8a8b656
-Add use fully qualified name for algorithm script path.
lorenzo-gomez-windhover May 11, 2023
1650c73
-Update output_algorithms.
lorenzo-gomez-windhover May 11, 2023
56cdcec
-Update algorithm_triggers table.
lorenzo-gomez-windhover May 11, 2023
4092673
-Properly write fields to sqlite when creating new algorithms.
lorenzo-gomez-windhover May 12, 2023
07d7bff
-Algorithm outputs should work properly now.
lorenzo-gomez-windhover May 12, 2023
ef8133b
-Correctly use flat types for algorithm outputs.
lorenzo-gomez-windhover May 18, 2023
04317a3
-Cleanup
lorenzo-gomez-windhover May 19, 2023
198c2d0
-Make parameter_ref and output_name the same in database,
lorenzo-gomez-windhover May 19, 2023
b8d7156
Renamed PX4 to Airliner
mbenson1 Mar 27, 2024
5d29d15
Merge branch 'rename_px4_to_airliner' into develop
mbenson1 Mar 27, 2024
a08b956
-Do not skip empty MIDs. Set them to 0 instead.
lorenzo-gomez-windhover Apr 10, 2024
e83f1c4
-Do not ignore commands with empty MIDs
lorenzo-gomez-windhover Apr 11, 2024
66bae88
Added description fields to various tables.
mbenson1 Apr 14, 2024
6cab750
-Bug fixes for events table
lorenzo-gomez-windhover Apr 17, 2024
e7966b0
Removed creation of performance table.
mbenson1 Apr 17, 2024
ba61243
Merged in experimental branch.
mbenson1 Apr 17, 2024
6c5f9bf
Changes to support config docs.
mbenson1 Apr 18, 2024
f7cab01
-Update docs
lorenzo-gomez-windhover Sep 24, 2024
3e5f88f
-Update log error to warnings when skipping items.
lorenzo-gomez-windhover Nov 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
venv
src/__pycache__/*
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/cmd_msg_merger.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/tlm_cmd_merger.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

172 changes: 170 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,170 @@
# cmd_msg_merger
Internal tool to write airliner's messages and commands to a sqlite database.
# tlm_cmd_merger
This tool reads telemetry and commands from a yaml file. It then writes this data to sqlite database.
This tool is meant to complement juicer. It is assumed the SQLITE database is generated by juicer.

# Table of Contents
1. [Dependencies](#dependencies)
2. [How to install](#how_to_install)
3. [Schemas](#schemas)


## Dependencies <a name="dependencies"></a>
`python>=3.5.2`
`PyYAML>=5.3.1`


## How to install <a name="how_to_install"></a>
This is meant to be a development package, so it is intended to be used inside a virtual environment managed by a tool like `venv `

1. Clone the repo
```
git clone https://github.com/WindhoverLabs/cmd_msg_merger/tree/master
```
2. Start a virtual environment by running
```
python3 -m venv venv
```
3. Activate the virtual environment
```
source venv/bin/activate
```
4. Install it
```
pip install -r requiremets.txt
```

5. Run it
```
python3 src/tlm_cmd_merger.py --yaml_path [PATH_TO_YAML] --sqlite_path [PATH_TO_SQLITE]
```

**NOTE**: Beware that for now this is an internal tool written specifically for [airliner's](https://github.com/WindhoverLabs/airliner) ground system toolchain. The sqlite database is assumed to have been generated by [juicer](https://github.com/WindhoverLabs/juicer). The yaml file is assumed to have been generated by airliner. So this tool should *not* be executed by itself. As our toolchain evolves and matures we may add capability to run it in isolation, but for now you must run juicer before running this tool.


# Schemas <a name="schemas"></a>

## YAML Schema
The yaml file is expected to have a schema that looks like this:

```
modules:
AK8963:
short_name: ak8963
long_name: TBD
events:
AK8963_INIT_INF_EID:
id: 1
type: INFORMATION
AK8963_CMD_NOOP_EID:
id: 2
type: INFORMATION
telemetry:
AK8963_HK_TLM_MID:
msgID: 0x0cc1
struct: AK8963_HkTlm_t
AK8963_DIAG_TLM_MID:
msgID: 0x0cc5
struct: AK8963_DiagPacket_t
commands:
AK8963_CMD_MID:
msgID: 0x1cc4
commands:
Noop:
cc: 0
struct: CFE_SB_CmdHdr_t
Reset:
cc: 1
struct: CFE_SB_CmdHdr_t
SendDiag:
cc: 2
struct: CFE_SB_CmdHdr_t
SetCalibration:
cc: 3
struct: AK8963_SetCalibrationCmd_t
perfids:
AK8963_RECEIVE_PERF_ID:
id: 102
AK8963_SEND_PERF_ID:
id: 103
AK8963_MAIN_TASK_PERF_ID:
id: 104
config:
AK8963_SB_TIMEOUT:
name: AK8963_SB_TIMEOUT
value: CFE_SB_PEND_FOREVER
AK8963_MISSION_REV:
name: AK8963_MISSION_REV
value: 0
definition: "../apps/ak8963"
```
It is _highly_ recommended that all the entries in the yaml file be filled out. At the moment we do allow
partial records in the database, however, for easier usage(and to avoid things breaking down the road), we recommend having
all entries filled out in the yaml file to avoid partial records in the database.

## SQLITE Schema
This tool adds all necessary tables to the database(which is generated by juicer). After running `tlm_cmd_merger`
the sqlite database will have the following tables as part of its schema:

"*" = PRIMARY KEY
"+" = FOREIGN KEY

### commands
|id* | name | command_code | message_id | macro | symbol+ | module+ |
|---|---|---|---|---|---|---|
| INTEGER | TEXT | INTEGER | INTEGER |TEXT | INTEGER | INTEGER |

### configurations
|id* | name | value | macro | module+ |
|---|---|---|---|---|
| INTEGER | TEXT | INTEGER | TEXT | INTEGER

### elfs
| id* | name | checksum | date | little_endian |
| --- | --- | --- | --- | --- |
|INTEGER | TEXT | TEXT | DATETIME | BOOLEAN |

### enumerations
| symbol* | value* | name |
| --- | --- | --- |
| INTEGER | INTEGER | TEXT |

### events
| id* | event_id | macro |
| --- | --- | --- |
| INTEGER | INTEGER | TEXT

### fields
| id* | name | symbol+ | byte_offset | type+ | little_endian | bit_size | bit_offset |
| --- | --- | --- | ---| --- | --- | --- | --- |
| INTEGER | TEXT | INTEGER |INTEGER | INTEGER | BOOLEAN | INTEGER | INTEGER |

### dimension_lists
| id* | field_id+ | dim_order | upper_bound |
| ---| --- | --- | --- |
| INTEGER | INTEGER | TEXT | INTEGER

### modules
| id* | name |
| --- | --- |
| INTEGER | TEXT |

### perf_ids
| id* | name | perf_id | macro | module+ |
| --- | --- | --- | ---| --- |
| INTEGER | TEXT | INTEGER | TEXT | INTEGER |

### symbols
| id* | elf+ | name | byte_size |
| ---| --- |---| --- |
| INTEGER| INTEGER | TEXT | INTEGER|

### telemetry
| id* | name | message_id | macro | symbol+ | module+ |
| --- | --- | ---| ---| ---| ---|
| INTEGER | TEXT | INTEGER | TEXT | INTEGER | INTEGER|

**NOTE**: The column `type` in the `fields` table is pointing to another entry in the `symbols` table.

The tables **telemetry**, **perf_ids**, **events**, **configurations**, **commands** and **modules** are generated by `tlm_cmd_merger` so they do *not* have to exist prior to running the tool. The rest of the tables *must* exist prior to running this tool. These tables should be generated by juicer, which follows the schema described above.

Documentation updated on October 1, 2021.
Loading