Home Manual Reference Source Test Repository
public class | source

Mep

Proxy to custom require(), Log, Config, DriverManager & services.

Static Member Summary

Static Public Members
public static get

Access to current configuration

public static get

DriverManager: drivers.DriverManager: *

Provides an instance of the DriverManager.

public static get

Log: Log: *

Logging system

public static get

Motion: services.motion.MotionService: *

Reference to motion service

public static get

Position: services.position.PositionService: *

Provides an instance of the PositionService.

public static get

Scheduler: services.scheduler.SchedulerService: *

Provides an instance of the SchedulerService

public static get

Share: services.share.ShareService: *

Reference to share service

public static get

Telemetry logging system

public static get

Terrain: services.terrain.TerrainService: *

Provides an instance of the Terrain

Static Method Summary

Static Public Methods
public static

getDriver(driver: *): Object

Proxy to method Mep.DriverManager.getDriver(driver)

public static

async init()

Initialize necessary modules.

public static

require(library: String): Object

Global function to require library relative to src directory

Static Public Members

public static get Config: Config: * source

Access to current configuration

Return:

Config

Example:

Mep.Config.get('Drivers.MotionDriver.class');

See:

  • {@link https://www.npmjs.com/package/nconf|nconf}

public static get DriverManager: drivers.DriverManager: * source

Provides an instance of the DriverManager.

Return:

drivers.DriverManager

Example:

let laserDriver = Mep.DriverManager.getDriver('LaserDriver');

See:

  • drivers.DriverManager

public static get Log: Log: * source

Logging system

Return:

Log

Example:

Mep.Log.debug('Pathfinding', 'Start terrain finding for (x, y)');

See:

  • {@link https://www.npmjs.com/package/bunyan|bunyan}

public static get Motion: services.motion.MotionService: * source

Reference to motion service

Return:

services.motion.MotionService

Reference to motion service

Example:

Mep.Motion.go(new TunedPoint(100, 100));

See:

  • services.motion.MotionService

public static get Position: services.position.PositionService: * source

Provides an instance of the PositionService.

Return:

services.position.PositionService

Example:

Mep.Position.set(new TunedPoint(100, 100), { speed: 100 });

See:

  • services.position.PositionService

public static get Scheduler: services.scheduler.SchedulerService: * source

Provides an instance of the SchedulerService

Return:

services.scheduler.SchedulerService

Example:

let nextTask = Mep.Scheduler.recommendNextTask();

See:

  • services.scheduler.SchedulerService

public static get Share: services.share.ShareService: * source

Reference to share service

Return:

services.share.ShareService

Example:

Mep.Share.send('DOORS_ARE_CLOSED');
Mep.Share.on('message', (msg) => { console.log(msg); });

See:

  • services.share.ShareService

public static get Telemetry: Telemetry: * source

Telemetry logging system

Return:

Telemetry

Example:

Mep.Telemetry('PathFinding', 'finding', {x:0.0, y:0.0});

See:

public static get Terrain: services.terrain.TerrainService: * source

Provides an instance of the Terrain

Return:

services.terrain.TerrainService

See:

  • services.terrain.TerrainService

Static Public Methods

public static getDriver(driver: *): Object source

Proxy to method Mep.DriverManager.getDriver(driver)

Params:

NameTypeAttributeDescription
driver *

{String} - Driver name

Return:

Object

Instance of required driver

Example:

let servo = Mep.getDriver('ArmFirstAX12');

public static async init() source

Initialize necessary modules. Should be called only once during an application bootstrapping

public static require(library: String): Object source

Global function to require library relative to src directory

Params:

NameTypeAttributeDescription
library String

Path to library

Return:

Object

Required library

Example:

const Task = Mep.require('utils/Task');