npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

signalk-racing-calculator

v0.3.1

Published

SignalK Node Server plugin to provide data relevant for sailboat racing

Downloads

16

Readme

SignalK Racing Calculator Plugin

This plugin provides a bare-bones set of racing related delta messages that can be used for beer can racing around fixed marks. All you need is a SignalK server with a GPS receiver that can provide updates for 3 paths: navigation.position, navigation.courseOverGroundTrue, and navigation.speedOverGround.

Based on this information, the following paths wil be computed by this plugin:

| Path | Units | Module | | ------------------------------------- | --------- | ------ | | navigation.racing.timeToStart | s | 1 | | navigation.racing.raceStatus | enum | 1 | | navigation.racing.distanceBoatEnd | m | 2 | | navigation.racing.distancePinEnd | m | 2 | | navigation.racing.distanceStartline | m | 2 | | navigation.racing.distanceToMark | m | 3 | | navigation.racing.bearingToMark | rad | 3 | | navigation.racing.cogToMark | rad | 3 | | navigation.racing.vmg | m/s | 3 | | navigation.racing.vmgToMark | m/s | 3 | | navigation.racing.markName | string | 3 |

The values of .raceStatus are as follows:

  1. setup – race is being set up and no countdown has started yet
  2. pre-start – race countdown is ongoing
  3. racing – race countdown has finished and the race started

The computed paths are split by module and to turn each module on, it is necessary to send a PUT request to an API endpoint. Each endpoint is described in detail in API.json.

Module 1: Racing timer

Start the timer by sending a PUT request to /startRaceCountdown with the JSON containing the value of seconds to set the countdown to. This will immediately begin the countdown in timeToStart and set the raceStatus to pre-start.

If the race start is postponed (AP flag) or there is a general recall, the race countdown can be cancelled by sending a PUT request to /cancelRace. This will have the effect of resetting the raceStatus to setup and cancelling the timer.

Module 2: Start line calculator

To mark the start line, send a PUT request to either /pingBoat or /pingPin when the boat passes by the corresponding mark. There is no way to unset these pings except by pinging again which will have the effect of updating the corresponding position.

Module 3: Race course setup and navigation

This module requires the most configuration to be done ahead of time. First, add the fixed mark names and positions to the configuration of the plugin in SignalK admin interface. Second, create named race courses: each course consists of a number of course legs, and each leg is defined by a mark (from among the ones defined previously) and an upwind or downwind general direction.

Windward-leeward course around 3 marks

Let's use this diagram of a windward-leeward course as an example. Make this course selectable in the plugin, you need:

  1. Enter the GPS coordinates of marks numbered #1, #2, and #9 as fixed marks.
  2. Add a race course consisting of 4 legs:
    1. Upwind leg to mark #1
    2. Downwind leg to mark #2
    3. Upwind leg to mark #9
    4. Downwind leg to mark #2

Once the above setup is complete, send a PUT request to /selectCourse with the JSON containing the string value equal to the name of the selected course. As long as the race status is setup or pre-start, this will update the current course, set the first leg as the current one, and start computing all module 3 paths. If the race status is already racing, this endpoint will return an error, so you should /cancelRace first, and only then select a new course.

Once the boat comes to within 30m of the mark position, the plugin will automatically advance the leg index to the next leg. You can modify far this happens in the plugin settings. Alternatively, you can manually advance through the race by sending a PUT request to /nextWaypoint: this works even if the race status is not racing and can be used to manually test your setup ahead of the race.