Replies: 1 comment 1 reply
|
Hi, This should be possible. The attached
The example uses no data tables: everything is sent as plain arrays from the frame parser, with the low-rate battery/temperature values cached and repeated into each row. Channel order is var lastTemperature = 0;
var lastBattery = 0;
function parse(frame) {
if (frame.length === 0)
return [];
var packet = JSON.parse(frame);
if (!packet.records)
return [];
var rows = [];
for (var i = 0; i < packet.records.length; ++i) {
var r = packet.records[i];
if (r.temperature !== undefined)
lastTemperature = r.temperature;
if (r.battery !== undefined)
lastBattery = r.battery;
if (r.accel_x !== undefined) {
rows.push([r.timestamp, r.accel_x, r.accel_y, r.accel_z,
lastTemperature, lastBattery]);
}
}
return rows;
}This should also work with your existing table-driven setup: add a dataset that carries the timestamp, point the X-axis source of your plots at it, and your Note: This works fine with monotonic timestamps. Non-monotonic data should probably still work with the X-axis configuration, but it might create artifacts from the interpolation (the curve is drawn in sample order). To run: extract the zip (keep both files in the same folder), open Let me know if this solves it for you! Also, I'd love to hear where the AI assistant fell short...I'm still building out its training data and skill files, and user feedback like yours is the best signal for where it needs reinforcing. Best, |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
My problem is easiest to explain with the IMU example.
I want to send frames containing multiple accelerometer samples, where each sample has its own timestamp:
{ "records": [ { "timestamp": 2.806, "accel_x": 0.2, "accel_y": 0.231, "accel_z": 10.286 }, { "timestamp": 2.826, "accel_x": 0.229, "accel_y": 0.229, "accel_z": 10.335 } ] }At a much lower rate, I send battery and temperature data:
{ "records": [ { "timestamp": 3.006, "temperature": 26.5, "battery": 3.7 } ] }I was able to get the low-rate battery/temperature messages working using
tableSetwith registers and virtual datasets.However, I can't figure out how to display the accelerometer samples using their individual timestamps. Since each frame contains multiple timestamped records, how should these be mapped so they appear correctly on the time axis?
AI assistant didn't help.
All reactions