Telemetry Graph not Plotting #4136
-
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
If it helps with reproducing it, here's my gitlab repository https://gitlab.com/Overloader/ksp-openmct/-/tree/dev |
Beta Was this translation helpful? Give feedback.
-
@Voreck Code looks good at first glance, nice job! Could you provide an example of the telemetry data that you receive over the websocket? Depending on how the data is structured, the |
Beta Was this translation helpful? Give feedback.
-
@akhenry Honestly kinda surprised that it looks good, pretty much the first time I do anything in JS
|
Beta Was this translation helpful? Give feedback.
-
OK, cool. So the problem is So! The simple solution is just to use |
Beta Was this translation helpful? Give feedback.
-
This works, thanks, I wish I knew it was that easy! |
Beta Was this translation helpful? Give feedback.
-
Hello all, going to convert this to a discussion as this could help out some others as well. Thanks! |
Beta Was this translation helpful? Give feedback.
OK, cool. So the problem is
Event.timeStamp
. It doesn't look like Telemachus provides timestamps associated with the telemetry values that it emits. You're usingEvent.timeStamp
instead, but this cannot be used for this purpose because it's an offset relative to the creation of the document. JavaScript represents time as an offset relative to the UNIX epoch. So, when your value is interpreted it evaluates to 5855 ms since January 1st 1970. If you were to set the time conductor to January 1st 1970 you would probably see your data.So! The simple solution is just to use
Date.now()
for the timestamp value, instead ofEvent.timestamp
.Date.now()
will give you a timestamp value relative to the…