Package Exports
- path-generator
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (path-generator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
PathGenerator Package
PathGenerator is a motion profile generator, which you can easily generat path for your robot to follow.
This package is based of Jaci's PathFinder with some improvements.
Usage
Without modifier
const { Waypoint, PathConfig, Path } = require('path-generator');
const waypoints = [
new Waypoint(0, 0, 0, 0, 2),
new Waypoint(1.5, 1.5, 90, 2, 2),
new Waypoint(3, 3, 0, 0, 0),
];
const pathConfig = new PathConfig(0.8, 3.5, 3);
const path = new Path(waypoints, pathConfig);
With modifier
const { Waypoint, PathConfig, Path, Modifier } = require('path-generator');
const waypoints = [
new Waypoint(0, 0, 0, 0, 2),
new Waypoint(1.5, 1.5, 90, 2, 2),
new Waypoint(3, 3, 0, 0, 0),
];
const pathConfig = new PathConfig(0.8, 3.5, 3);
const path = new Path(waypoints, pathConfig, Modifier.tank);
Modifier Options
Tank:
Modifier.tank
IModifier:
Modifier.IModifier
- Implements this interface to create your own modifier, Not tested on JS!
import { Modifier } from 'path-generator'; export default class ModifierName implements Modifier.IModifier<ModifyName> { modify(sourceSetpoints: Setpoint[], pathConfig: PathConfig): ModifyName { return new ModifyName(...); } } class ModifyName { ... }