Next point button in freeboard vs KIP?

I'm a newbie and still learning my way around SK and plugins. I was trying to add a push button to a KIP display that would do the "Next point" action to move the current leg of a course to the next one (as is available on Freeboard). But in my test setup, I can see no paths that are available as a button for the KIP push button widget. Looking at debug from Feeboard, I see that clicking that button does a PUT /signalk/v2/api/vessels/self/navigation/course/activeRoute/pointIndex so that looks like it is calculating the next point itself and setting it as an absolute index into the route. So how would I go about making an API for a push button that would be visible to a KIP button widget? Are there any example I can look at of how to wire up a KIP push button? Once I know the basics, writing a little plugin to do the next point logic should be easy enough.
15 Replies
David Godin
David Godin2d ago
Hi @Gregw I'm in the process of updating the KIP AP widget (done with Windsteer which shares what same compass dial). It has a next waypoint button. Would that do it? Or are you using other AP hardware?
Gregw
GregwOP2d ago
I'm not using an AP. I'm setting up for racing and working on a plug-in that will give me TWA and AWA for the next leg. Ultimately it might need widget support, but I'm trying to work out if I can use standard kip widgets to drive it whilst I learn exactly how things work and what I want
David Godin
David Godin2d ago
Got it. How do you set your way points? If it's what you want to use for the math, you'll need to set it somehow. Will you use Freeboard? KIP widgets only send true/false, or a range with the slider. No widget supports sending user values But you could use a toggle to trigger a node-RED calculation and out put path data... Not super elegant but it could work in any case, look at the V2 course API in SK. It has the details. If not, ask in Plugins and Webapps channel maybe
AdrianP
AdrianP2d ago
@Gregw you can get the current route point index by sending GET request to /signalk/v2/api/vessels/self/navigation/course See the the Course API documentation or OpenAPI definition in Server Admin console
Gregw
GregwOP2d ago
@AdrianP yeah I can see how to do it programmatically, as that is obviously what freeboard does. But I was hoping to be able to mock up a UI using existing kip widgets before committing to a custom widget (graphical elegance is not my strong point). So my main question really is about how to use a kip push button to do anything, so I can focus on a server side plug-in whilst working out what I really want to do. @David Godin ah node-red! I've seen that mentioned a few times but don't yet know what that is. I'll investigate. Non super elegant will do whilst I'm working out how to get what really want ( which is ultimately to get sailracer app for functionality). Note that I'm currently defining waypoints and routes in openCPN and doing a GPX export/import. Now that's something that is screaming for better integration.... But at least it works for now (and my C skills are rustier than my JavaScript).
David Godin
David Godin2d ago
You'll find node-RED in the SK admin Apps - Installed by default I'm no expert on node-RED but there is a channel where you can ask questions. It's an automation/workflow solution and it has SK specific connectors you can get notified on path uipdates, R/W to paths and do stuff in between
Teppo Kurki
Teppo Kurki2d ago
@David Godin i think it would be a good investment to support the common course related operations, like +- 1/10 degs and ”advance to next point” explicitly in Kip. Instead of users fumbling for buttons and paths they could just add an Autopilot/course control widget
David Godin
David Godin2d ago
KIP has an AP widget that does all this
Teppo Kurki
Teppo Kurki2d ago
Hah, i almost added ”or is there one already” So the question is why would you need the button @Gregw
David Godin
David Godin2d ago
I'm in the process of updating it as we speak. It was not responsive. It was my first widget ;). This is a draft :
No description
David Godin
David Godin2d ago
I think Greg has a very specific usecase for when racing.
Gregw
GregwOP2d ago
For my usage, I'm not using an AP. I guess I could just use the AP widget if it has such a button, but I was hoping to be able to use the generic kip push button so that I can mock something up, as I think this will be useful for other mockups in want to do (e.g. ping start boat and pin). But if the AP widget has buttons that do this, then at least I can look for a code example to follow.
David Godin
David Godin2d ago
@Gregw there is no Pin - boat and upwind mark tagging feature yet. We talked about it last year but it was too far to code... You could use KIP toggle or plain Node-Red embed in KIP to tag those. Then do some math about Pin and boat favored end, etc. Try it out. In the end, you will need to "officialize" new paths to mark those down and log the math. Should probably go under performance.* path. Best to discuss it in #specification We will help
Teppo Kurki
Teppo Kurki2d ago
The course api/data is separate from autopilot. You can activate a route and advance next point etc, all without ap
Gregw
GregwOP2d ago
@David Godin I understand boat/pin functionality doesn't exit yet. I want to work on that, so I'm gathering ideas for how to do that development. Having simple buttons to mock up a UI would be useful.

Did you find this page helpful?