BallAerospace / python-ballcosmos

Python Support for Ball Aerospace COSMOS v4
Other
18 stars 4 forks source link

get_packet is Commented Out #6

Closed nsmryan closed 4 years ago

nsmryan commented 4 years ago

I am writing a script where I would like to subscribe to a set of packets, and get their contents as parameters (not as binary data).

It looks like the 'get_packet_data' function exists, but the 'get_packet' function is commented out. It seems like 'get_packet' is the function I need, and I was wondering if there is a reason it is commented out?

I see the comment on get_packet_data, and my reading is that the Python side would have to do the packet parsing (reading in the telemetry config files and performing its own processing), which is not yet supported?

ghost commented 4 years ago

Config file parsing hasn't been implemented in Python. Would happily accept a pull request if you would like to implement. :)

There are actually quite a few files that would require porting. system.rb, target.rb, packet.rb, config_parser.rb, (and their dependencies).

We are currently implementing COSMOS 5, in which this will be way easier to implement, but that is still about a half year out.

nsmryan commented 4 years ago

It seems like the other option would be to support this on the Ruby side, correct? Is there something different about this function that prevents this? I imagine it has to do with the JSON RPC API?

ghost commented 4 years ago

Supporting on the ruby side is possible, but it would be a different API. It would also put the decommutation load onto the CmdTlmServer.

nsmryan commented 4 years ago

Got it. I shamefully admit that a PR is not likely from me in the near future, so I'll close the issue and get my decoded data some other way.

Thanks for being so quick with a response! I get a lot of good use from COSMOS, and I'm starting to wrap my own tools around it, which is where my question comes in.

nsmryan commented 4 years ago

I know I closed this issue, but I did end up working around this issue to some extent by pulling each packets parameters and using get_tlm_details. I then was able to use the Python Construct library to create Structs for each packet, and parse the data that way.

In other words, I didn't actually need to read the config files. The issue here is mostly DERIVED parameters, which I don't really know what to do with. In the worst case you need to actually run Ruby, in the best case maybe you could just evaluate simple snippets as Python expressions or with a library?