GithubHelp home page GithubHelp logo

Comments (5)

dmccomas avatar dmccomas commented on June 19, 2024

Your question made me realize I don't have the COSMOS-to-cFS command flow documented in a single concise place. Good topic for a future video! Hopefully I can string the pieces together in a meaningful way here.

  1. Binary packets are transferred between COSMOS and KIT_CI (Command Ingest) which is an app running in the cFS. The term cFS is used to refer to all of the FSW running. The binary packet format is defined on slide 5 in the following Software Bus slides.
    https://github.com/OpenSatKit/OpenSatKit/blob/master/cosmos/cfs_kit/tutorials/cfe/training/OSK-T02-1-cFE-SB.pdf
    The same CCSDS packet format used between ground and flight is used onboard.

  2. The first 2 bytes of the message is the ID so in your example KIT_CI tried to interpret 'he' as the message ID which corresponds to the 0x6865 in the event message. 0x68 = ASCII 'h' and 0x65 = ASCII 'e'

  3. COSMOS takes care of creating the binary command packet when you send a command from either a screen or from a COSMOS script that is run from the script runner or test runner tool. COSMOS creates the binary packet using the command definitions that are defined in "targets". Every FSW app has COSMOS target that defines the app's command and telemetry packets. For example the following directory contains KIT_CI's command and telemetry definitions: https://github.com/OpenSatKit/OpenSatKit/tree/master/cosmos/config/targets/KIT_CI/cmd_tlm

  4. Here's KIT_CI's NOOP command in the COSMOS Command Sender tool. The CCSDS fields correspond to the diagram in the SB slides I mentioned above.

KIT_CI-NOOP

  1. When you send a command the Command Sender captures the COSMOS script command which looks like this for the KIT_CI NOOP and this is the syntax a script can use.
    cmd("KIT_CI NOOP with CCSDS_STREAMID 7936, CCSDS_SEQUENCE 49152, CCSDS_LENGTH 1, CCSDS_CHECKSUM 0, CCSDS_FUNCCODE 0")

  2. The Runtime Environment App video may also be helpful. It describes parts of this as well
    https://www.youtube.com/watch?v=p3RrovUyLOs

Let me know if have more questions.

from opensatkit.

pitachan23 avatar pitachan23 commented on June 19, 2024

Thank you for the explanation. That helps clear up some of my confusion.

In number 5, when you mentioned "this is the syntax a script can can use." Which script are you referring to here?

Is there a way I can use the command below without having to do it through the GUI, but running it from a script instead?

 cmd("KIT_CI NOOP with CCSDS_STREAMID 7936, CCSDS_SEQUENCE 49152, CCSDS_LENGTH 1, CCSDS_CHECKSUM 0, CCSDS_FUNCCODE 0")

Thank you

from opensatkit.

pitachan23 avatar pitachan23 commented on June 19, 2024

What I'm hoping to achieve is sending a command from my web application to cFS. I'm just not sure which would be the best way to do it. At first I thought I would be able to send a command directly to cFS through UDP socket but it seems that I still have to translate the command to binary CCSDS format, which is handled by COSMOS. I'm not looking to reproduce something that is already done by COSMOS, but I'm wondering if it will be possible for me to write a ruby script that utilizes some COSMOS libraries to create a binary command packet and send to cFS without having to use any GUI tool (e.g. script runner or test runner tool)?

from opensatkit.

dmccomas avatar dmccomas commented on June 19, 2024

COSMOS scripts are run in either the Script Runner or Test Runner. For now stick with Script Runner because Test Runner involves a framework that will be helpful when you're ready to write tests but it adds a layer you don't need yet. The COSMOS scriptng guide is at https://cosmosrb.com/docs/v4/scripting. COSMOS has added a lot of methods like cmd() on top of Ruby.

I started Sript Runner from the Launcher and pasted the KIT_CI NOOP command and hit start and it executed it. Ignore the yellow warning about bit definitions in the Script Runer output box, I'm working that issue.

ScreenHunter 109

Here's an example OSK script that demos some File Manager app features that you can run in Script Runner

https://github.com/OpenSatKit/OpenSatKit/blob/master/cosmos/config/targets/FM/procedures/demo_fm_features.rb

As a heads up, OSK adds a thin layer on top of COSMOS's scripting API. For example the FM script contains lines like the one below. These run methods that do common processing like verify a valid command counter in telemetry after a command is sent. You don't have to use OSK's layer and the OSK/cosmos/lib code serves as the documentation at the moment.

Osk::flight.send_cmd("FM","SEND_DIR_PKT with DIRECTORY #{Osk::FLT_SRV_DIR}, DIR_LIST_OFFSET 0")

from opensatkit.

pitachan23 avatar pitachan23 commented on June 19, 2024

Hi David,

Thank you so much for your help. I have what I need now.

Thank you,
Pita

from opensatkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.