Skip to content

Commit

Permalink
fix: More explicit jogging deactivation
Browse files Browse the repository at this point in the history
  • Loading branch information
evrys committed Sep 20, 2024
1 parent 76e2bce commit ff9dfd5
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/components/jogging/JoggingStore.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
import type {
CoordinateSystem,
JoggerConnection,
MotionGroupSpecification,
RobotTcp,
} from "@wandelbots/wandelbots-js"
import { tryParseJson } from "@wandelbots/wandelbots-js"
import keyBy from "lodash-es/keyBy"
import uniqueId from "lodash-es/uniqueId"
import {
Expand All @@ -6,13 +13,6 @@ import {
runInAction,
type IReactionDisposer,
} from "mobx"
import type {
CoordinateSystem,
JoggerConnection,
MotionGroupSpecification,
RobotTcp,
} from "@wandelbots/wandelbots-js"
import { tryParseJson } from "@wandelbots/wandelbots-js"

const discreteIncrementOptions = [
{ id: "0.1", mm: 0.1, degrees: 0.05 },
Expand Down Expand Up @@ -177,6 +177,15 @@ export class JoggingStore {
await websocket.closed()
}

// Closing websocket sometimes isn't enough to stop interference
try {
await this.jogger.nova.api.motionGroupJogging.stopJogging(
this.jogger.motionGroupId,
)
} catch (err) {
console.error(err)
}

if (opts.requireManualReactivation) {
runInAction(() => {
this.manualActivationRequired = true
Expand Down

0 comments on commit ff9dfd5

Please sign in to comment.