I have been trying to find a way to do some simple math and send the data to cockpit. The simple math is adding the water depth plus the rangefinder distance to get the total water depth I used node red to grab the information and then send it to mavlink to open it into cockpit as a data display.
What I have managed to do is send the data to mavlink but Cockpit doesn’t seem to be able to access it. I have tried enabling pirate mode and Data lake but it still wont show up.
see the Node-red program I made below. Does anyone know what I am missing?
Eventually what i would also like to do is display a chart showing the total water depth and the ROV depth simultaneously.
This also would bee a nice feature if it was built in cockpit to allow using multiple data streams for simple math and data charts with multiple sources displaying various custom data.
Going further updating ping viewer to account for the ROV depth when displaying signal beam depth could be a neat feature.
Cockpit already has access to the MAVLink data - why not just add the values together with a compound data lake variable, after which you can display the value in an indicator, and/or a plotter?
I’m not sure what value Node-RED provides here, and I suspect it adds some non-negligible complexity and extra configuration.
I suggested something like that a few years ago, but we unfortunately haven’t got around to implementing it yet.
That’s already possible, just not yet on a single plotter widget. That said, in the upcoming Cockpit 1.18 it will be possible to set fixed axis bounds, in which case you could stack multiple plotters with transparent backgrounds (and the stats hidden) to have multiple plots compared with each other.
That solution could work, but it might be a little clunky. It would be much better if we could add multiple data sources to the y-axis, and have options for the x-axis so you could use the x-axis as either distance travelled from, say, the DVL, distance from home, time or any other variable, with the ability to set rules for min or max chart limits and of course some style/colour options
@CUIS I’ve prepared a chat here with some instructions on how to setup a generic websocket connection. I understand it’s not needed in your case since you already have the data in the MAVLink stream, but you can have it as a reference if you want to dig into other approaches in the future.
Keep in mind the Generic WebSocket Connections are a 1.18 feature, so they can only be found on Beta releases for now.