nasa / fprime

F´ - A flight software and embedded systems framework
https://fprime.jpl.nasa.gov
Apache License 2.0
10.1k stars 1.32k forks source link

Tlm Packetizer build error #3032

Open garthwatney opened 1 week ago

garthwatney commented 1 week ago
F´ Version

v3.5.0 |Affected Component| |

Problem Description

When using the TlmPacketizer, the fprime-gds requires that all telemetry channels be fully qualified. However the build gives an error when using fully qualified names in the telemetry packetizer xml.

Packet XML parsing error: Channel Ref.cmdDisp.CommandsDispatched does not exist ## Context / Environment Execute `fprime-util version-check` and share the output. ``` Operating System: Linux CPU Architecture: x86_64 Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29 Python version: 3.8.10 CMake version: 3.23.1 Pip version: 20.0.2 Pip packages: fprime-tools==3.5.0 fprime-gds==3.5.0 fprime-fpp-*==2.2.0 --INSERT HERE-- ``` ## How to Reproduce 1. In fprime Ref, swap out the TlmChan with TlmPacketizer component 2. Add the fully qualified name 'Ref' to the first telemetry channel in RefPackets.xml 3. In Ref: fprime-util build ## Expected Behavior A description of the expected behavior.
bocchino commented 6 days ago

However the build gives an error when using fully qualified names in the telemetry packetizer xml.

This behavior is what I would expect, given the design of the XML packetizer. The XML packetizer is based on the XML topology, which does not support the concept of qualified instance names. I think the fix for this issue is to replace the packetizer, as described here:

https://github.com/nasa/fpp/issues/307

In the mean time, to use the XML packetizer, one can avoid defining instances with qualified names.

timcanham commented 6 days ago

Looks pretty straightforward... I'll take a look.

bocchino commented 6 days ago

I'm not sure it's straightforward. The packetizer uses the topology XML, which doesn't have any notion of qualified instance names. For example, given this model

module M {
  instance i: C
}

topology T {
  instance M.i
  ...
}

the topology XML uses the simple name i to represent the instance whose qualified name in the FPP model isM.i.

Perhaps one could write a channel name as M.i.c in the packetizer XML, and connect that name back to channel c of instance i in the topology XML. But this approach will run into problems if the qualification is needed to disambiguate the names. For example, instances M.i and N.i would both be represented as i in the topology XML.

bocchino commented 6 days ago

Another option might be to make the packetizer depend on the JSON dictionary, which does have the info about qualified instance names.

timcanham commented 6 days ago

@bocchino I'm not sure the dictionary is available yet in the build when this autocoder runs. @LeStarch?

timcanham commented 6 days ago

I'm updating the autocoder to use the assembly attribute in the topology XML, and it seems to compile OK. I'll try running it against the ground system. At least for the Ref example, just adding Ref. to the beginning seems to work for compiling.