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

@wyca-robotics/wyca-tour-svc

v0.0.8

Published

A simple AMR touring service

Downloads

9

Readme

Wyca Tour Service

A simple service to manage an AMR touring based on POIs sequence.

installation

npm i @wyca-robotics/wyca-tour-svc --save

Using in a web browser

You need an ApiClient to instantiate the TourSvc, a MockingClient is provided for testing purpose.

This MockingClient should be instantiated with an URI to a mapData.json file in an options dictionnary, other options a commented below :

import { MockingClient } from '@wyca-robotics/wyca-tour-svc/src/lib/MockingClient.js'
import { TourPoi } from '@wyca-robotics/wyca-tour-svc/src/lib/TourPoi.js'
import { TourSvc } from '@wyca-robotics/wyca-tour-svc'

// default options with a path to MapData
const options = {
    criticalFailure: false, // Should simulated failure be critical
    failOnInit: false, // Simulate a failure on Init
    failOnDock: false, // Simulate a failure on its way to the docking station
    failOnGoToCharge: false, // Simulate a failure when asking to go to dock
    failOnPoiId: -1, // Simulate a failure on its way to a POI'sid (-1 for none)
    failOnGotoPoiId: -1, // Simulate a failure when asking to go to a POI'sid (-1 for none)
    mapDataPath: "mock/map/map_data.json", // MapData json file to simulate the robot's current MapData
    etaRange: {min: 50, max: 75} // The ranged duration of goto (POI & Charge) actions'simulation.
}

document.addEventListener('DOMContentLoaded', onDocumentLoaded)

function onDocumentLoaded()
{
    const mc = new MockingClient(options)
    const svc = new TourSvc(mc)

    // Initialize the TourSvc with a list of TourPoi wich returns a Promise once the service is initialized
    let pois = []
    pois.push(new TourPoi(12, "POI 1", "img/poi_1.png", "video/poi_1.mp4"))
    pois.push(new TourPoi(13, "POI 2", "img/poi_2.png", "video/poi_2.mp4"))
    pois.push(new TourPoi(14, "POI 3", "img/poi_3.png", "video/poi_3.mp4"))
    // Of course ToutPoi id must match the MapData's pois id_poi otherwise it will be rejected

    svc.init(pois)
    .then(()=> {
        console.log("All's set, ready to go !")
    })
    .catch((failure) => {
        console.log("Uho ! Something went wrong.", failure)
    })
}

Once the service is initalized you can ask the AMR to go to its next destination, it will return a Promise that resolves with the readched POI or NULL if there is no more POI to go next and will go back to its docking station for charging.

svc.next()
.then((poi) => {
    console.log("Reached the POI, now i can play its video", poi.videoPath)
})
.catch((failure) => {
    if (failure.critical)
    {
        console.log("Oh no the Robot's got a problem, call a technician !")
    }
    else
    {
        console.log("Something's blocking the way, try again ? Or skip to next POI ?")
    }
})

if the failure wasn't critical you can ask to resume its interupted journey, a new promise is returned like the next method.

svc.resume()
.then((poi) => {
    console.log("Reached the POI, now i can play its video", poi.videoPath)
})
.catch((failure) => {
    console.log("Oh no ! Not again :(")
})

#Version 0.0.8