BallAerospace / COSMOS

Ball Aerospace COSMOS
https://ballaerospace.github.io/cosmos-website/
Other
363 stars 129 forks source link

Processing data in COSMOS #824

Closed amodeo12 closed 6 years ago

amodeo12 commented 6 years ago

Hi everyone,

First of all, this is not an issue, just a newbie doubt. Assuming that I receive some kind of telemetry in COSMOS, I'd like to know how to process that data to plot it, extract conclusions...applying maths to the data as it is being received, in sum. Once done, among other things, I'd like to get a 3D visualization, which I think is possible using COSMOS too...

Thanks in advance

ghost commented 6 years ago

Please watch the intro video at http://cosmosrb.com/ and take a look at the datasheet. Once you've defined your target (the thing you want COSMOS to talk to) you can extract data using Telemetry Extractor into CSVs and process it however you'd like. We have a 3D visualization framework called OpenGL Builder which we've used to display various satellite models and which we've connected to live telemetry to animate. That kind of work requires creating a custom tool in our Qt / OpenGL framework which is beyond the scope of a simple Github issue.

kengregson commented 6 years ago

Realize you are probably all at SmallSat but wondering if you've got any tutorial information and/or examples of animating a 3D model based on telemetry?

ghost commented 6 years ago

The only real example is the OpenGlBuilder code: https://github.com/BallAerospace/COSMOS/blob/master/lib/cosmos/tools/opengl_builder/opengl_builder.rb

That code can easily display .STL files. Typically we start by loading a few STL files (one for each object that needs to move independently or be colored independently), add a Thread that uses tlm() or one of the other scripting methods to get telemetry values (typically angles), then set .rotation_x, .rotation_y, or .rotation_z on the STL object to rotate it in response to telemetry.

kengregson commented 6 years ago

Ryan,

This may be enough to get me going, I'm able to stream my telemetry data (magnetometer readings) in a script. I'm stuck though trying to get OpenGLBuilder to display even the moon scene/model. I'm running Ubuntu 16.04 native, ruby 2.4.2p198, NVidia-384 Accelerated Drivers.

I get File/View/Show/Help menu options when I (in irb for testing):

require 'cosmos' require 'cosmos/tools/opengl_builder/opengl_builder' bldr=Cosmos::OpenGLBuilder bldr.run

But nothing displays in the frame when I select Show->Show Moon/Earth (or add the diamond.stl file shape to the scene).

I verified the moon_scene is installed/present with: moon=Cosmos::GlScene.new => #<Cosmos::GlScene:0x000000000137fd10 @shapes=[], @bounds=#<Cosmos::GlBounds:0x000000000137fcc0 @x0=-5.0, @x1=5.0, @y0=-5.0, @y1=5.0, @z0=-5.0, @z1=5.0>, @zoom=1.0, @orientation=#<Cosmos::Quaternion:0x000000000137fbf8 @data=[0.0, 0.0, 0.0, 1.0]>, @center=[0.0, 0.0, 0.0], @projection=:PARALLEL> 2.4.2 :008 > moon.append(Cosmos::MoonModel.new(0.0,0.0,0.0)) => [#<Cosmos::MoonModel:0x00000000013719e0 @color=[0.5, 0.5, 0.5, 1.0], @base_color=[0.5, 0.5, 0.5, 1.0], @position=[0.0, 0.0, 0.0], @rotation_x=nil, @rotation_y=nil, @rotation_z=nil, @viewer=nil, @front_material=#<Cosmos::GlMaterial:0x00000000013716c0 @ambient=[0.2, 0.2, 0.2, 1.0], @diffuse=[0.8, 0.8, 0.8, 1.0], @specular=[1.0, 1.0, 1.0, 1.0], @emission=[0.0, 0.0, 0.0, 1.0], @shininess=30.0>, @back_material=nil, @tipText=nil, @dragable=true, @vdata=[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [-1.0, 0.0, 0.0], [0.0, -1.0, 0.0], [0.0, 0.0, 1.0], [0.0, 0.0, -1.0]], @tindices=[[0, 4, 1], [1, 4, 2], [2, 4, 3], [3, 4, 0], [1, 5, 0], [2, 5, 1], [3, 5, 2], [0, 5, 3]], @texture_filename="/home/kludge/.rvm/gems/ruby-2.4.2/gems/cosmos-4.2.4/data/moonmap1k.gif", @image=#, @image_data="KKK\xFFJJJ\xFFIII\xFFIII\

Any ideas?

Thanks, -Ken

On Thu, Aug 2, 2018 at 1:20 PM Ryan Melton notifications@github.com wrote:

The only real example is the OpenGlBuilder code:

https://github.com/BallAerospace/COSMOS/blob/master/lib/cosmos/tools/opengl_builder/opengl_builder.rb

That code can easily display .STL files. Typically we start by loading a few STL files (one for each object that needs to move independently or be colored independently), add a Thread that uses tlm() or one of the other scripting methods to get telemetry values (typically angles), then set .rotation_x, .rotation_y, or .rotation_z on the STL object to rotate it in response to telemetry.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BallAerospace/COSMOS/issues/824#issuecomment-410003577, or mute the thread https://github.com/notifications/unsubscribe-auth/ABF2FiZzvgpivMA9IM8RTMkAFaPvUWCvks5uMzTrgaJpZM4VAuRc .

kengregson commented 6 years ago

Switched to Intel video drivers and the moon scene displays as expected! Perhaps a known bug/issue with somewhere in the Ubuntu 16.04-Ruby2.4.2-NVidia384 stack?