@gov.nasa.jpl.honeycomb/core
v0.0.6
Published
Framework for processing and displaying robotics telemetry.
Readme
Honeycomb
Core classes and helper to support instantiating a Honeycomb viewer with telemetry and drivers.
Utilities
Config
{
root: string | null,
title: string,
robots: Array< {
id: string,
type: null | string,
path: string,
options: Object
} >,
terrain: Array< {
id: string,
type: null | string,
path: null | string,
paths: null | Array<string>,
options: Object
} >,
telemetry: Array< {
id: string,
type: string,
path: null | string,
paths: null | Array<string>,
options: Object
} >,
drivers: Array< {
id: string,
type: string,
options: Object
} >,
charts: Array< {
animator: string,
units: string,
relative: boolean,
labels: Array<string>,
fields: Array<Array<string>>,
duration: number
} >,
options: {
renderer: Object,
up: string,
secondsFactor: number,
playbackSpeed: number,
displayAbsoluteTime: boolean,
baseTimeFormat: string,
settings: Array< {
label: string,
tag: string,
default: boolean,
shortcut: string,
lockable: boolean
} >
}
}load
load( path : string ) : Promise<Object>Loads an normalizes a Honeycomb config file from the given path. If the config inherits from a "root" path then the configs are recursively loaded and merged.
clean
clean( config : Object, basePath = '' : string ) : ObjectCleans the given config file and unpacks all file paths in the terrain, robots, and telemetry fields to be relative to the given basePath variable.
merge
merge( ...configs : Object ) : ObjectDeep merges the configs from left to right to apply config deltas on top of another. Objects are deep merged while arrays are concatenated.
Loaders
Registration functions for loading 3d models, telemetry, and drivers so files can be easily loaded and processed by external applications and the config files.
registerModelLoader
registerModelLoader(
extension : string | Array<string>,
cb : ( path : string, options : Object, manager : LoadingManager )
=> Promise<Object3D>
) : voidRegister a callback that will load, process, and return a 3d model file. The callback takes the url to the file, a set of options to load the file, and a LoadingManager which can be used to track dependent file loading.
loadModel
loadModel( path : string, options : Object, manager = null : LoadingManager ) : Promise<Object3D>Loads and parses the 3d model at the given path. Uses the file extension and picks the appropriate registered model loader.
registerTelemetryAnimatorLoader
registerTelemetryAnimatorLoader(
type : string | Array<string>,
cb : ( path : string, options : Object )
=> Promise<TelemetryAnimator | Object>
) : voidLike registerModelLoader but for TelemetryAnimators and telemetry files. A TelemetryAnimator is expected to be returned or an object od named TelemetryAnimators.
loadTelemetryAnimator
loadTelemetryAnimator( type : string, path : string, options : Object ) : Promise<TelemetryAnimator | Object>Parses the file at the given path using the loader registered for the type.
registerDriver
registerDriver( type : string, class : DriverClass ) : voidRegisters a Driver with a given name.
createDriver
createDriver( type : string, options : Object ) : DriverIntantiates and returns a Driver of the given type.
Core
ViewerMixin
.animator
animator : JoinedTelemetryAnimatorThe JoinedTelemetryAnimator that manages and keeps in sync all data animators.
.animators
animators : { [ key ] : TelemetryAnimator }The set of animators in animator. An alias to animator.animators.
.tags
tags : TagTrackerA tag manager that can be used to add and track tags for objects. Tags are automatically added for robots and terrain.
.isPlaying
isPlaying = false : BooleanWhether or not the animator is being animated.
.isLive
isLive = false : BooleanWhether or not the animator is displaying live data as it comes in.
.playbackSpeed
playbackSpeed = 1 : NumberThe playback for the animator.
addAnimator, getAnimator, removeAnimator
addAnimator( animator : Animator, id : string ) : void
getAnimator( id : string ) : void
removeAnimator( id : string ) : voidAPI for adding a removing an animator from the set of used telemetry.
addRobot, getRobot, removeRobot
addRobot( robot : URDFRobot, id : string ) : void
getRobot( id : string ) : void
removeRobot( id : string ) : voidAPI for adding and removing robots from the system.
addTerrain(terrain, id) / getTerrain(id) / removeTerrain(id)
addTerrain( terrain : Object3D, id : string ) : void
getTerrain( id : string ) : void
removeTerrain( id : string ) : voidAPI for adding and removing terrain from the system.
addDriver, getDriver, removeDriver
addDriver( driver : Driver, id : string ) : void
getDriver( id : string ) : void
removeDriver( id : string ) : voidAPI for adding and removing drivers.
play
play() : voidStart playing the animator. If isLive is true the time will always jump to the latest data.
pause
pause() : voidPauses the animator at the current time. Sets isLive and isPlaying to false.
stop
stop() : voidPauses the animator and sets it to the initial time of the animator.
LoadingManager
inherits from THREE.LoadingManager and EventDispatcher
Similar class to three.js' LoadingManager that can bubble item start, progress, load, and error calls up to a parent LoadingManager as well as dispatch events. start, complete, progress, and error events are dispatched.
manager
manager = null : LoadingManagerThe parent loading manager.
constructor
constructor( manager : LoadingManager, onStart, onProgress, onLoad, onError )Takes another manager which the item start and end calls are bubbled up to so child load managers can be tracked.
StateDiff
A class for tracking and checking the difference between two objects and whether or not a file path has changed.
initialObject
initialObject : null = falseupdate
update( from : Object, to : Object ) : voidUpdates the StateDiff object to store and check the differences between the two objects.
didChange
didChange( tokens : ...string ) : BooleanTakes a list of tokens representing the recursive object keys to test. If a field has been added, removed, or changed between the two objects being diffed then "true" will be returned.
Driver
The Driver class is the interpreter of data to visualizations. It takes a set of options and is attached to a viewer to add visualizations into. When data is changed the "update" function is called either from viewer or manually to update the display of the annotations.
options
options : ObjectThe set of options passed into the constructor used for updating the driver.
manager
manager : LoadingManagerThe manager passed into the constructor useful for resolving file paths for assets that need to be loaded.
viewer
viewer : ViewerThe viewer this driver has been attached to.
updateOrder
updateOrder : NumberThe order in which this driver will be updated relative to other drivers by the viewer.
constructor
constructor( options : Object = {}, manager : LoadingManager = new SubLoadingManager() ) : voidsetState
setState( state : Object, diff : StateDiff = ALL_CHANGED_DIFF ) : voidThe function to call when adjusting the state that should be visualized.
forceUpdate
forceUpdate( ) : voidThe function to call to force a rerun of "update" with a diff indicating everything in the state has changed. This can be used if member variables or options not represented in the state are adjusted and impact visualizations.
initialize
overrideable
initialize( ) : voidNot intended to be called manually. This function should be overridden by a Driver implementation and is called when a driver has been added to a Viewer.
update
overrideable
update( state : Object, diff : StateDiff ) : voidNot intended to be called manually. This function should be overridden by a Driver implementation and is called when a drivers state has been updated or a force update has been made.
dispose
overrideable
dispose( ) : voidNot intended to be called manually. This function should be overridden by a Driver implementation and is called when a viewer is being disposed of or the drive is removed from a viewer.
