@synapticon/motion-master-client 2.2.2 → 6.0.0-alpha.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/client.d.ts +20 -0
- package/dist/client.js +37 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +8 -0
- package/dist/generated/Api.d.ts +991 -0
- package/dist/generated/Api.js +614 -0
- package/dist/generated/data-contracts.d.ts +644 -0
- package/dist/generated/data-contracts.js +12 -0
- package/dist/generated/http-client.d.ts +60 -0
- package/dist/generated/http-client.js +171 -0
- package/dist/hex.d.ts +2 -0
- package/dist/hex.js +20 -0
- package/dist/index.d.ts +10 -7
- package/dist/index.js +16 -22
- package/dist/mmpd.d.ts +54 -0
- package/dist/mmpd.js +323 -0
- package/dist/sdo.d.ts +15 -0
- package/dist/sdo.js +212 -0
- package/dist/somanet.d.ts +5 -0
- package/dist/somanet.js +15 -0
- package/dist/web-socket-connection.d.ts +69 -0
- package/dist/web-socket-connection.js +206 -0
- package/package.json +29 -39
- package/.vscode/launch.json +0 -23
- package/README.md +0 -118
- package/box.config.json +0 -7
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -1433
- package/dist/cli.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/motion-master-client-web-socket-connection.d.ts +0 -43
- package/dist/motion-master-client-web-socket-connection.d.ts.map +0 -1
- package/dist/motion-master-client-web-socket-connection.js +0 -91
- package/dist/motion-master-client-web-socket-connection.js.map +0 -1
- package/dist/motion-master-client.d.ts +0 -105
- package/dist/motion-master-client.d.ts.map +0 -1
- package/dist/motion-master-client.js +0 -348
- package/dist/motion-master-client.js.map +0 -1
- package/dist/motion-master-notification-subscribe-data.d.ts +0 -8
- package/dist/motion-master-notification-subscribe-data.d.ts.map +0 -1
- package/dist/motion-master-notification-subscribe-data.js +0 -3
- package/dist/motion-master-notification-subscribe-data.js.map +0 -1
- package/dist/motion-master-notification-web-socket-connection.d.ts +0 -56
- package/dist/motion-master-notification-web-socket-connection.d.ts.map +0 -1
- package/dist/motion-master-notification-web-socket-connection.js +0 -115
- package/dist/motion-master-notification-web-socket-connection.js.map +0 -1
- package/dist/motion-master-notification.d.ts +0 -31
- package/dist/motion-master-notification.d.ts.map +0 -1
- package/dist/motion-master-notification.js +0 -44
- package/dist/motion-master-notification.js.map +0 -1
- package/dist/util.d.ts +0 -16
- package/dist/util.d.ts.map +0 -1
- package/dist/util.js +0 -24
- package/dist/util.js.map +0 -1
- package/licenses.format.json +0 -4
- package/motion-master-client.config.json +0 -7
- package/smm_data_dic.json +0 -1213
- package/src/cli.ts +0 -1361
- package/src/index.ts +0 -7
- package/src/motion-master-client-web-socket-connection.ts +0 -104
- package/src/motion-master-client.ts +0 -468
- package/src/motion-master-notification-subscribe-data.ts +0 -7
- package/src/motion-master-notification-web-socket-connection.ts +0 -143
- package/src/motion-master-notification.ts +0 -51
- package/src/util.ts +0 -22
- package/test.sh +0 -122
- package/tsconfig.json +0 -63
- package/tslint.json +0 -118
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { BehaviorSubject, Observable, Subject, Subscription } from 'rxjs';
|
|
2
|
-
import { isEqual } from 'lodash';
|
|
3
|
-
import { bufferCount, distinctUntilChanged, filter, map, timeout } from 'rxjs/operators';
|
|
4
|
-
import { webSocket, WebSocketSubject, WebSocketSubjectConfig } from 'rxjs/webSocket';
|
|
5
|
-
import { v4 } from 'uuid';
|
|
6
|
-
|
|
7
|
-
import { MotionMasterNotification } from './motion-master-notification';
|
|
8
|
-
import { IMotionMasterNotificationSubscribeData } from './motion-master-notification-subscribe-data';
|
|
9
|
-
import { MotionMasterMessage } from './util';
|
|
10
|
-
|
|
11
|
-
export class MotionMasterNotificationWebSocketConnection {
|
|
12
|
-
|
|
13
|
-
notification = new MotionMasterNotification();
|
|
14
|
-
|
|
15
|
-
readonly connected$ = new BehaviorSubject<boolean>(false);
|
|
16
|
-
readonly monitoringTimedout$ = new Subject<{ id: string, topic: string }>();
|
|
17
|
-
|
|
18
|
-
private decoder = new TextDecoder('utf-8');
|
|
19
|
-
|
|
20
|
-
private closeObserver = {
|
|
21
|
-
next: () => {
|
|
22
|
-
this.connected$.next(false);
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
private openObserver = {
|
|
27
|
-
next: () => {
|
|
28
|
-
this.connected$.next(true);
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
wssConfig: WebSocketSubjectConfig<ArrayBuffer> = {
|
|
33
|
-
binaryType: 'arraybuffer',
|
|
34
|
-
closeObserver: this.closeObserver,
|
|
35
|
-
deserializer: (e: MessageEvent) => e.data,
|
|
36
|
-
openObserver: this.openObserver,
|
|
37
|
-
url: this.wssUrl,
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
wss$: WebSocketSubject<any> = webSocket(this.wssConfig);
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Map the incoming array buffer to topic (string) and payload (encoded protobuf message).
|
|
44
|
-
*/
|
|
45
|
-
buffer$: Observable<[string, ArrayBuffer]> = this.wss$.pipe(
|
|
46
|
-
map((buffer: ArrayBuffer) => {
|
|
47
|
-
const end = new Uint8Array(buffer, 0, 1)[0] + 1; // topic length is the 1st byte (topic MUST be less than 255 bytes long)
|
|
48
|
-
const topic = this.decoder.decode(buffer.slice(1, end)); // topic starts from the 2nd byte
|
|
49
|
-
return [topic, buffer.slice(end)]; // the rest is the payload (encoded protobuf message)
|
|
50
|
-
}),
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Map request message ids to subscriptions.
|
|
55
|
-
*/
|
|
56
|
-
subscriptions: { [key: string]: Subscription } = Object.create(null);
|
|
57
|
-
|
|
58
|
-
constructor(
|
|
59
|
-
public wssUrl = `ws://${location.hostname}:63525`,
|
|
60
|
-
) { }
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Subscribe to a topic and optionally buffer messages.
|
|
64
|
-
* First subscription will open WebSocket connection.
|
|
65
|
-
* @param data subscribe data
|
|
66
|
-
* @returns subscription id
|
|
67
|
-
*/
|
|
68
|
-
subscribe(data: IMotionMasterNotificationSubscribeData) {
|
|
69
|
-
const { bufferSize = 1, distinct = false, id = v4(), topic, monitoringTimeoutDue } = data;
|
|
70
|
-
|
|
71
|
-
const sourceObservable = this.selectBufferByTopic(topic, true);
|
|
72
|
-
let observable = sourceObservable;
|
|
73
|
-
|
|
74
|
-
if (distinct) {
|
|
75
|
-
observable = observable.pipe(
|
|
76
|
-
// compare values only, ignore timestamps
|
|
77
|
-
distinctUntilChanged((x, y) => isEqual(
|
|
78
|
-
x?.status?.monitoringParameterValues?.deviceParameterValues?.parameterValues,
|
|
79
|
-
y?.status?.monitoringParameterValues?.deviceParameterValues?.parameterValues,
|
|
80
|
-
)),
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
const messages$ = observable.pipe(
|
|
85
|
-
bufferCount(bufferSize),
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
const subscription = messages$.subscribe((messages) => {
|
|
89
|
-
this.notification.input$.next({ topic, messages });
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
if (monitoringTimeoutDue) {
|
|
93
|
-
subscription.add(
|
|
94
|
-
sourceObservable.pipe(
|
|
95
|
-
timeout(monitoringTimeoutDue),
|
|
96
|
-
).subscribe({
|
|
97
|
-
error: () => this.monitoringTimedout$.next({ id, topic }),
|
|
98
|
-
}),
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
this.subscriptions[id] = subscription;
|
|
103
|
-
|
|
104
|
-
return id;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Unsubscribe from a previous subscription.
|
|
109
|
-
* WebSocket connection will close on last unsubscribe.
|
|
110
|
-
* @todo find a way to emit all buffered messages before unsubscribe.
|
|
111
|
-
* @param id message id related to previous subscription
|
|
112
|
-
*/
|
|
113
|
-
unsubscribe(id: string) {
|
|
114
|
-
if (this.subscriptions[id]) {
|
|
115
|
-
this.subscriptions[id].unsubscribe();
|
|
116
|
-
delete this.subscriptions[id];
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Unsubscribe from all previously subscribed topics.
|
|
122
|
-
*/
|
|
123
|
-
unsubscribeAll() {
|
|
124
|
-
Object.keys(this.subscriptions).forEach((id) => this.unsubscribe(id));
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Select incoming buffer by topic and optionally decode it to MotionMasterMessage.
|
|
129
|
-
* @param topic to filter incoming messages by
|
|
130
|
-
* @param decode to MotionMasterMessage or leave the content as Uint8Array
|
|
131
|
-
* @returns an observable of topic and depending on the value of decode argument: MotionMasterMessage when true, Uint8Array otherwise
|
|
132
|
-
*/
|
|
133
|
-
selectBufferByTopic<T extends boolean>(topic: string, decode: T): T extends true ? Observable<MotionMasterMessage> : Observable<Uint8Array> {
|
|
134
|
-
return this.buffer$.pipe(
|
|
135
|
-
filter((data) => data[0] === topic),
|
|
136
|
-
map((data) => decode
|
|
137
|
-
? MotionMasterMessage.decode(new Uint8Array(data[1]))
|
|
138
|
-
: new Uint8Array(data[1]),
|
|
139
|
-
),
|
|
140
|
-
) as any;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { from, Subject } from 'rxjs';
|
|
2
|
-
import { filter, map, pluck, switchMap } from 'rxjs/operators';
|
|
3
|
-
|
|
4
|
-
import { MotionMasterMessage } from './util';
|
|
5
|
-
|
|
6
|
-
export class MotionMasterNotification {
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Buffered messages by topic.
|
|
10
|
-
*/
|
|
11
|
-
readonly input$ = new Subject<{ topic: string, messages: MotionMasterMessage[] }>();
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Notification messages are system and device events.
|
|
15
|
-
*/
|
|
16
|
-
readonly notification$ = this.selectMessagesByTopic('notification').pipe(
|
|
17
|
-
switchMap((messages) => from(messages)),
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* An observable of system event status messages.
|
|
22
|
-
* Motion Master goes through several states until it gets to initialized.
|
|
23
|
-
*/
|
|
24
|
-
readonly systemEvent$ = this.notification$.pipe(
|
|
25
|
-
filter((message) => (message.status && 'systemEvent' in message.status) === true),
|
|
26
|
-
// tslint:disable-next-line: no-non-null-assertion
|
|
27
|
-
map((message) => message.status!.systemEvent!),
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* An observable of device event status messages.
|
|
32
|
-
*/
|
|
33
|
-
readonly deviceEvent$ = this.notification$.pipe(
|
|
34
|
-
filter((message) => (message.status && 'deviceEvent' in message.status) === true),
|
|
35
|
-
// tslint:disable-next-line: no-non-null-assertion
|
|
36
|
-
map((message) => message.status!.deviceEvent!),
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Select messages by topic.
|
|
41
|
-
* @param t topic to filter by
|
|
42
|
-
* @returns an observable of messages
|
|
43
|
-
*/
|
|
44
|
-
selectMessagesByTopic(t: string) {
|
|
45
|
-
return this.input$.pipe(
|
|
46
|
-
filter(({ topic }) => topic === t),
|
|
47
|
-
pluck('messages'),
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
}
|
package/src/util.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { motionmaster } from '@synapticon/motion-master-proto';
|
|
2
|
-
|
|
3
|
-
export import MotionMasterMessage = motionmaster.MotionMasterMessage;
|
|
4
|
-
export import IMotionMasterMessage = motionmaster.IMotionMasterMessage;
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Encode MotionMasterMessage to typed array.
|
|
8
|
-
* @param message an instance of MotionMasterMessage.
|
|
9
|
-
* @returns Uint8Array
|
|
10
|
-
*/
|
|
11
|
-
export function encodeMotionMasterMessage(message: IMotionMasterMessage) {
|
|
12
|
-
return MotionMasterMessage.encode(message).finish();
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Decode MotionMasterMessage from typed array.
|
|
17
|
-
* @param data Uint8Array to decode
|
|
18
|
-
* @returns MotionMasterMessage
|
|
19
|
-
*/
|
|
20
|
-
export function decodeMotionMasterMessage(data: Uint8Array) {
|
|
21
|
-
return MotionMasterMessage.decode(data);
|
|
22
|
-
}
|
package/test.sh
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
#
|
|
4
|
-
# Requests
|
|
5
|
-
#
|
|
6
|
-
|
|
7
|
-
DEBUG=* npx node ./dist/cli.js request pingSystem
|
|
8
|
-
DEBUG=* npx node ./dist/cli.js request getSystemVersion
|
|
9
|
-
DEBUG=* npx node ./dist/cli.js -f json request getSystemVersion
|
|
10
|
-
DEBUG=* npx node ./dist/cli.js -f yaml request getSystemVersion
|
|
11
|
-
DEBUG=* npx node ./dist/cli.js --output-format json request getSystemVersion
|
|
12
|
-
DEBUG=* npx node ./dist/cli.js --output-format yaml request getSystemVersion
|
|
13
|
-
DEBUG=* npx node ./dist/cli.js -c ./motion-master-client.config.json request getSystemVersion # using custom config
|
|
14
|
-
DEBUG=* npx node ./dist/cli.js request getDeviceInfo
|
|
15
|
-
DEBUG=* npx node ./dist/cli.js request getDeviceParameterInfo # default device at position 0
|
|
16
|
-
DEBUG=* npx node ./dist/cli.js -p 1 request getDeviceParameterInfo # device at position 1 short flag
|
|
17
|
-
DEBUG=* npx node ./dist/cli.js --device-position=1 request getDeviceParameterInfo # device at position 1 multi-word option
|
|
18
|
-
DEBUG=* npx node ./dist/cli.js -d 4020155199 request getDeviceParameterInfo # device serial number short flag
|
|
19
|
-
DEBUG=* npx node ./dist/cli.js --device-address=4020155199 request getDeviceParameterInfo # device serial number multi-word option
|
|
20
|
-
DEBUG=* npx node ./dist/cli.js request getDeviceParameterValues 0x607B:1 0x607B:2
|
|
21
|
-
DEBUG=* npx node ./dist/cli.js request getMultiDeviceParameterValues
|
|
22
|
-
DEBUG=* npx node ./dist/cli.js request setDeviceParameterValues 0x2705:0=5
|
|
23
|
-
DEBUG=* npx node ./dist/cli.js request setMultiDeviceParameterValues
|
|
24
|
-
DEBUG=* npx node ./dist/cli.js request getDeviceFileList
|
|
25
|
-
DEBUG=* npx node ./dist/cli.js request getDeviceFile config.csv
|
|
26
|
-
DEBUG=* npx node ./dist/cli.js request setDeviceFile tmp/heroes.json
|
|
27
|
-
DEBUG=* npx node ./dist/cli.js request deleteDeviceFile heroes.json
|
|
28
|
-
DEBUG=* npx node ./dist/cli.js request resetDeviceFault
|
|
29
|
-
DEBUG=* npx node ./dist/cli.js request stopDevice
|
|
30
|
-
DEBUG=* npx node ./dist/cli.js request startDeviceFirmwareInstallation
|
|
31
|
-
DEBUG=* npx node ./dist/cli.js request getDeviceLog
|
|
32
|
-
DEBUG=* npx node ./dist/cli.js request startCoggingTorqueRecording 1 # skipAutoTuning
|
|
33
|
-
DEBUG=* npx node ./dist/cli.js request getCoggingTorqueData
|
|
34
|
-
DEBUG=* npx node ./dist/cli.js request startOffsetDetection
|
|
35
|
-
DEBUG=* npx node ./dist/cli.js request startPlantIdentification 3 300 2 60 30 # durationSeconds, torqueAmplitude, startFrequency, endFrequency, cutoffFrequency
|
|
36
|
-
DEBUG=* npx node ./dist/cli.js request startSystemIdentification 3 300 2 60 # durationSeconds, torqueAmplitude, startFrequency, endFrequency
|
|
37
|
-
DEBUG=* npx node ./dist/cli.js request computeAutoTuningGains positionParameters 2 0.2 2.0 1 4 2 314 # controllerType, settlingTime, positionDamping, alphaMult, order, lb, ub
|
|
38
|
-
DEBUG=* npx node ./dist/cli.js request computeAutoTuningGains velocityParameters 100 100 # controllerType, velocityLoopBandwidth, velocityDamping
|
|
39
|
-
DEBUG=* npx node ./dist/cli.js request setMotionControllerParameters 1000
|
|
40
|
-
DEBUG=* npx node ./dist/cli.js request setMotionControllerParameters -- -1000
|
|
41
|
-
DEBUG=* npx node ./dist/cli.js request enableMotionController 0 0 # controllerType, filter
|
|
42
|
-
DEBUG=* npx node ./dist/cli.js request disableMotionController
|
|
43
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters velocitySineWave 500 1 0 # amplitude, frequency, repeat
|
|
44
|
-
DEBUG=* npx node ./dist/cli.js request startSignalGenerator
|
|
45
|
-
DEBUG=* npx node ./dist/cli.js request stopSignalGenerator
|
|
46
|
-
DEBUG=* npx node ./dist/cli.js request startMonitoringDeviceParameterValues some-topic 0x6064:0 0x230A:0
|
|
47
|
-
DEBUG=* npx node ./dist/cli.js request stopMonitoringDeviceParameterValues f02fbeda-c3e5-4d1e-a294-3f7e3b83be6b
|
|
48
|
-
DEBUG=* npx node ./dist/cli.js request getEthercatNetworkState
|
|
49
|
-
DEBUG=* npx node ./dist/cli.js request setEthercatNetworkState 1 # EtherCAT state
|
|
50
|
-
DEBUG=* npx node ./dist/cli.js request startNarrowAngleCalibration
|
|
51
|
-
DEBUG=* npx node ./dist/cli.js request setSystemClientTimeout 2000 # ms
|
|
52
|
-
DEBUG=* npx node ./dist/cli.js request getCirculoEncoderMagnetDistance 1 1
|
|
53
|
-
DEBUG=* npx node ./dist/cli.js request startCirculoEncoderNarrowAngleCalibrationProcedure 1 # encoderOrdinal
|
|
54
|
-
DEBUG=* npx node ./dist/cli.js request getDeviceCia402State
|
|
55
|
-
DEBUG=* npx node ./dist/cli.js request setDeviceCia402State 2
|
|
56
|
-
DEBUG=* npx node ./dist/cli.js request getSystemLog
|
|
57
|
-
DEBUG=* npx node ./dist/cli.js request startDeviceSiiRestore
|
|
58
|
-
DEBUG=* npx node ./dist/cli.js request startOpenLoopFieldControl 180 200 10000 50 100 # angle, velocity, acceleration, torque, torqueSpeed
|
|
59
|
-
DEBUG=* npx node ./dist/cli.js request computeFullAutoTuningGains 0 1 # tuningType, controllerType
|
|
60
|
-
DEBUG=* npx node ./dist/cli.js request startFullAutoTuning 0 1
|
|
61
|
-
DEBUG=* npx node ./dist/cli.js request stopFullAutoTuning
|
|
62
|
-
DEBUG=* npx node ./dist/cli.js request startCirculoEncoderConfiguration 1 # encoderOrdinal
|
|
63
|
-
DEBUG=* npx node ./dist/cli.js request stopCirculoEncoderNarrowAngleCalibrationProcedure 1 # encoderOrdinal
|
|
64
|
-
|
|
65
|
-
#
|
|
66
|
-
# Requests: Position Signal Generator
|
|
67
|
-
#
|
|
68
|
-
|
|
69
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters positionStepResponse 1334 500 # target, sustainTime
|
|
70
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters positionAdvancedStepResponse 1334 500 0 # target, sustainTime, repeat
|
|
71
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters positionAdvancedStepResponse 1334 500 1 # target, sustainTime, repeat
|
|
72
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters positionRamp 1000 500 1000 1000 500 # target, profileVelocity, profileAcceleration, profileDeceleration, sustainTime
|
|
73
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters positionTrapezoidal 1000 500 1000 1000 500 0 # target, profileVelocity, profileAcceleration, profileDeceleration, sustainTime, repeat
|
|
74
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters positionTrapezoidal 1000 500 1000 1000 500 1 # target, profileVelocity, profileAcceleration, profileDeceleration, sustainTime, repeat
|
|
75
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters positionBidirectional 1000 500 1000 1000 500 0 # target, profileVelocity, profileAcceleration, profileDeceleration, sustainTime, repeat
|
|
76
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters positionBidirectional 1000 500 1000 1000 500 1 # target, profileVelocity, profileAcceleration, profileDeceleration, sustainTime, repeat
|
|
77
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters positionSineWave 1000 1 0 # amplitude, frequency, repeat
|
|
78
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters positionSineWave 1000 1 1 # amplitude, frequency, repeat
|
|
79
|
-
|
|
80
|
-
#
|
|
81
|
-
# Requests: Velocity Signal Generator
|
|
82
|
-
#
|
|
83
|
-
|
|
84
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters velocityStepResponse 1000 500 # target, sustainTime
|
|
85
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters velocityAdvancedStepResponse 1000 500 0 # target, sustainTime, repeat
|
|
86
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters velocityAdvancedStepResponse 1000 500 1 # target, sustainTime, repeat
|
|
87
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters velocityRamp 1000 500 1000 1000 # target, profileVelocity, profileAcceleration, profileDeceleration, sustainTime
|
|
88
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters velocityTrapezoidal 1000 1000 1000 500 0 # target, profileAcceleration, profileDeceleration, sustainTime, repeat
|
|
89
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters velocityTrapezoidal 1000 1000 1000 500 1 # target, profileAcceleration, profileDeceleration, sustainTime, repeat
|
|
90
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters velocityBidirectional 1000 1000 1000 500 0 # target, profileAcceleration, profileDeceleration, sustainTime, repeat
|
|
91
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters velocityBidirectional 1000 1000 1000 500 1 # target, profileAcceleration, profileDeceleration, sustainTime, repeat
|
|
92
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters velocitySineWave 1000 1 0 # amplitude, frequency, repeat
|
|
93
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters velocitySineWave 1000 1 1 # amplitude, frequency, repeat
|
|
94
|
-
|
|
95
|
-
#
|
|
96
|
-
# Requests: Torque Signal Generator
|
|
97
|
-
#
|
|
98
|
-
|
|
99
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters torqueStepResponse 500 500 # target, sustainTime
|
|
100
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters torqueAdvancedStepResponse 500 500 0 # target, sustainTime, repeat
|
|
101
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters torqueAdvancedStepResponse 500 500 1 # target, sustainTime, repeat
|
|
102
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters torqueRamp 500 500 500 # target, torqueSlope, sustainTime
|
|
103
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters torqueTrapezoidal 500 500 500 0 # target, torqueSlope, sustainTime, repeat
|
|
104
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters torqueTrapezoidal 500 500 500 1 # target, torqueSlope, sustainTime, repeat
|
|
105
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters torqueBidirectional 500 500 500 0 # target, torqueSlope, sustainTime, repeat
|
|
106
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters torqueBidirectional 500 500 500 1 # target, torqueSlope, sustainTime, repeat
|
|
107
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters torqueSineWave 500 1 0 # amplitude, frequency, repeat
|
|
108
|
-
DEBUG=* npx node ./dist/cli.js request setSignalGeneratorParameters torqueSineWave 500 1 1 # amplitude, frequency, repeat
|
|
109
|
-
|
|
110
|
-
#
|
|
111
|
-
# Commands
|
|
112
|
-
#
|
|
113
|
-
|
|
114
|
-
DEBUG=* npx node ./dist/cli.js upload 0x6064:0 0x230A:0
|
|
115
|
-
DEBUG=* npx node ./dist/cli.js download 0x2705:0=1
|
|
116
|
-
DEBUG=* npx node ./dist/cli.js getDeviceFileContent config.csv
|
|
117
|
-
DEBUG=* npx node ./dist/cli.js getDeviceLogContent
|
|
118
|
-
DEBUG=* npx node ./dist/cli.js getCoggingTorqueData
|
|
119
|
-
DEBUG=* npx node ./dist/cli.js startCoggingTorqueRecording --skip-auto-tuning
|
|
120
|
-
DEBUG=* npx node ./dist/cli.js startOffsetDetection
|
|
121
|
-
DEBUG=* npx node ./dist/cli.js startPlantIdentification 3 300 2 60 30
|
|
122
|
-
DEBUG=* npx node ./dist/cli.js monitor some-topic 0x6064:0 0x230A:0
|
package/tsconfig.json
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
/* Basic Options */
|
|
4
|
-
// "incremental": true, /* Enable incremental compilation */
|
|
5
|
-
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
|
6
|
-
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
|
7
|
-
// "lib": [], /* Specify library files to be included in the compilation. */
|
|
8
|
-
// "allowJs": true, /* Allow javascript files to be compiled. */
|
|
9
|
-
// "checkJs": true, /* Report errors in .js files. */
|
|
10
|
-
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
|
11
|
-
"declaration": true, /* Generates corresponding '.d.ts' file. */
|
|
12
|
-
"declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
|
13
|
-
"sourceMap": true, /* Generates corresponding '.map' file. */
|
|
14
|
-
// "outFile": "./", /* Concatenate and emit output to single file. */
|
|
15
|
-
"outDir": "./dist", /* Redirect output structure to the directory. */
|
|
16
|
-
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
|
17
|
-
// "composite": true, /* Enable project compilation */
|
|
18
|
-
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
|
|
19
|
-
// "removeComments": true, /* Do not emit comments to output. */
|
|
20
|
-
// "noEmit": true, /* Do not emit outputs. */
|
|
21
|
-
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
|
22
|
-
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
|
23
|
-
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
|
24
|
-
|
|
25
|
-
/* Strict Type-Checking Options */
|
|
26
|
-
"strict": true, /* Enable all strict type-checking options. */
|
|
27
|
-
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
|
28
|
-
"strictNullChecks": true, /* Enable strict null checks. */
|
|
29
|
-
"strictFunctionTypes": true, /* Enable strict checking of function types. */
|
|
30
|
-
"strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
|
|
31
|
-
"strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
|
|
32
|
-
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
|
33
|
-
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
|
34
|
-
|
|
35
|
-
/* Additional Checks */
|
|
36
|
-
"noUnusedLocals": true, /* Report errors on unused locals. */
|
|
37
|
-
"noUnusedParameters": true, /* Report errors on unused parameters. */
|
|
38
|
-
"noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
|
39
|
-
"noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
|
40
|
-
|
|
41
|
-
/* Module Resolution Options */
|
|
42
|
-
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
|
43
|
-
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
|
44
|
-
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
|
45
|
-
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
|
46
|
-
// "typeRoots": [], /* List of folders to include type definitions from. */
|
|
47
|
-
// "types": [], /* Type declaration files to be included in compilation. */
|
|
48
|
-
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
|
49
|
-
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
|
50
|
-
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
|
51
|
-
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
52
|
-
|
|
53
|
-
/* Source Map Options */
|
|
54
|
-
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
|
55
|
-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
56
|
-
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
|
57
|
-
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
|
58
|
-
|
|
59
|
-
/* Experimental Options */
|
|
60
|
-
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
|
61
|
-
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
|
62
|
-
}
|
|
63
|
-
}
|
package/tslint.json
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"defaultSeverity": "error",
|
|
3
|
-
"extends": [
|
|
4
|
-
"tslint:recommended"
|
|
5
|
-
],
|
|
6
|
-
"jsRules": {},
|
|
7
|
-
"rules": {
|
|
8
|
-
"arrow-return-shorthand": true,
|
|
9
|
-
"callable-types": true,
|
|
10
|
-
"class-name": true,
|
|
11
|
-
"comment-format": [
|
|
12
|
-
true,
|
|
13
|
-
"check-space"
|
|
14
|
-
],
|
|
15
|
-
"curly": true,
|
|
16
|
-
"eofline": true,
|
|
17
|
-
"forin": true,
|
|
18
|
-
"import-blacklist": [
|
|
19
|
-
true
|
|
20
|
-
],
|
|
21
|
-
"import-spacing": true,
|
|
22
|
-
"indent": [
|
|
23
|
-
true,
|
|
24
|
-
"spaces"
|
|
25
|
-
],
|
|
26
|
-
"interface-over-type-literal": true,
|
|
27
|
-
"label-position": true,
|
|
28
|
-
"max-line-length": [
|
|
29
|
-
false,
|
|
30
|
-
140
|
|
31
|
-
],
|
|
32
|
-
"member-access": false,
|
|
33
|
-
"member-ordering": [
|
|
34
|
-
true,
|
|
35
|
-
{
|
|
36
|
-
"order": [
|
|
37
|
-
"static-field",
|
|
38
|
-
"instance-field",
|
|
39
|
-
"static-method",
|
|
40
|
-
"instance-method"
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
],
|
|
44
|
-
"no-arg": true,
|
|
45
|
-
"no-bitwise": true,
|
|
46
|
-
"no-console": [
|
|
47
|
-
true,
|
|
48
|
-
"debug",
|
|
49
|
-
"info",
|
|
50
|
-
"time",
|
|
51
|
-
"timeEnd",
|
|
52
|
-
"trace"
|
|
53
|
-
],
|
|
54
|
-
"no-construct": true,
|
|
55
|
-
"no-debugger": true,
|
|
56
|
-
"no-duplicate-super": true,
|
|
57
|
-
"no-empty": false,
|
|
58
|
-
"no-empty-interface": true,
|
|
59
|
-
"no-eval": true,
|
|
60
|
-
"no-inferrable-types": [
|
|
61
|
-
true,
|
|
62
|
-
"ignore-params"
|
|
63
|
-
],
|
|
64
|
-
"no-misused-new": true,
|
|
65
|
-
"no-non-null-assertion": true,
|
|
66
|
-
"no-shadowed-variable": true,
|
|
67
|
-
"no-string-literal": false,
|
|
68
|
-
"no-string-throw": true,
|
|
69
|
-
"no-switch-case-fall-through": true,
|
|
70
|
-
"no-trailing-whitespace": true,
|
|
71
|
-
"no-unnecessary-initializer": true,
|
|
72
|
-
"no-unused-expression": true,
|
|
73
|
-
"no-var-keyword": true,
|
|
74
|
-
"object-literal-sort-keys": false,
|
|
75
|
-
"one-line": [
|
|
76
|
-
true,
|
|
77
|
-
"check-open-brace",
|
|
78
|
-
"check-catch",
|
|
79
|
-
"check-else",
|
|
80
|
-
"check-whitespace"
|
|
81
|
-
],
|
|
82
|
-
"prefer-const": true,
|
|
83
|
-
"quotemark": [
|
|
84
|
-
true,
|
|
85
|
-
"single"
|
|
86
|
-
],
|
|
87
|
-
"radix": true,
|
|
88
|
-
"semicolon": [
|
|
89
|
-
true,
|
|
90
|
-
"always"
|
|
91
|
-
],
|
|
92
|
-
"triple-equals": [
|
|
93
|
-
true,
|
|
94
|
-
"allow-null-check"
|
|
95
|
-
],
|
|
96
|
-
"typedef-whitespace": [
|
|
97
|
-
true,
|
|
98
|
-
{
|
|
99
|
-
"call-signature": "nospace",
|
|
100
|
-
"index-signature": "nospace",
|
|
101
|
-
"parameter": "nospace",
|
|
102
|
-
"property-declaration": "nospace",
|
|
103
|
-
"variable-declaration": "nospace"
|
|
104
|
-
}
|
|
105
|
-
],
|
|
106
|
-
"unified-signatures": true,
|
|
107
|
-
"variable-name": false,
|
|
108
|
-
"whitespace": [
|
|
109
|
-
true,
|
|
110
|
-
"check-branch",
|
|
111
|
-
"check-decl",
|
|
112
|
-
"check-operator",
|
|
113
|
-
"check-separator",
|
|
114
|
-
"check-type"
|
|
115
|
-
]
|
|
116
|
-
},
|
|
117
|
-
"rulesDirectory": []
|
|
118
|
-
}
|