Trying to add roll&pitch fields tracked in the App
-
I have roll and pitch data in my signalk data (I can see them in the data browser with path "navigation.attitude"), but I cannot find the dame in the list of field I can add for tracking in the app.
Have anyone tried that, any hints?
Thank you in advance
-
Actually navigation.attitude is composite field with 3 members ("yaw","pitch" and "roll").
I cant see any of them in the app as well. -
It is indeed because it is a composite value. Those need to be split up. You can do so with Node-RED, please install Node-RED plugin to Signal K (Detailed instructions in this video tutorial)
And then import this snippet (courtesy of Scott Bender of Signal K team) using the top right menu item.
[{"id":"03814fb729f94bf2","type":"signalk-subscribe","z":"1a65e795a2e4022a","name":"navigation.attitude","mode":"sendAll","flatten":true,"context":"vessels.self","path":"navigation.attitude","source":"","period":1000,"x":190,"y":200,"wires":[["aa303e3ca247371e","1be984c9b6dbe6d0","7ae5e956a921f72f"]]},{"id":"aa303e3ca247371e","type":"change","z":"1a65e795a2e4022a","name":"yaw","rules":[{"t":"move","p":"payload.yaw","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"navigation.attitudeflat.yaw","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":200,"wires":[["74ede648e6a55306"]]},{"id":"74ede648e6a55306","type":"signalk-send-pathvalue","z":"1a65e795a2e4022a","name":"","source":"","meta":"{\"units\": \"rad\" }","x":710,"y":200,"wires":[]},{"id":"1be984c9b6dbe6d0","type":"change","z":"1a65e795a2e4022a","name":"pitch","rules":[{"t":"move","p":"payload.pitch","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"navigation.attitudeflat.pitch","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":260,"wires":[["74ede648e6a55306"]]},{"id":"7ae5e956a921f72f","type":"change","z":"1a65e795a2e4022a","name":"roll","rules":[{"t":"move","p":"payload.roll","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"navigation.attitudeflat.roll","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":320,"wires":[["74ede648e6a55306"]]}]
It will create a flow like this:
When you deploy, it will give you explicit paths for
navigation.attitude.yaw
,navigation.attitude.pitch
andnavigation.attitude.roll
.At some point, Saillogger should decode composite values but there are many paths that have composite values and doing so in a smart way requires some thinking.
-
Thank you so much.
I'll try that.