@wandelbots/wandelbots-js-react-components 5.4.1 → 5.4.2-pr.ci-pr-preview.586.f684aae

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.
Files changed (200) hide show
  1. package/dist/3d.cjs.js +1 -1
  2. package/dist/3d.d.ts +1 -1
  3. package/dist/3d.d.ts.map +1 -1
  4. package/dist/3d.es.js +1 -1
  5. package/dist/MotionGroupVisualizer-B-e22qXF.cjs +2 -0
  6. package/dist/MotionGroupVisualizer-B-e22qXF.cjs.map +1 -0
  7. package/dist/MotionGroupVisualizer-CIASsBC6.js +1433 -0
  8. package/dist/MotionGroupVisualizer-CIASsBC6.js.map +1 -0
  9. package/dist/Setup.d.ts +1 -1
  10. package/dist/Setup.d.ts.map +1 -1
  11. package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts +1 -1
  12. package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts.map +1 -1
  13. package/dist/components/3d-viewport/collider/ColliderCollection.d.ts.map +1 -1
  14. package/dist/components/AppHeader.d.ts +1 -1
  15. package/dist/components/AppHeader.d.ts.map +1 -1
  16. package/dist/components/ConsoleFilter.d.ts +1 -1
  17. package/dist/components/ConsoleFilter.d.ts.map +1 -1
  18. package/dist/components/CopyableText.d.ts.map +1 -1
  19. package/dist/components/CycleTimer/DefaultVariant.d.ts.map +1 -1
  20. package/dist/components/CycleTimer/SmallVariant.d.ts.map +1 -1
  21. package/dist/components/DataGrid.d.ts +1 -1
  22. package/dist/components/DataGrid.d.ts.map +1 -1
  23. package/dist/components/LoadingCover.d.ts.map +1 -1
  24. package/dist/components/LogPanel.d.ts +1 -1
  25. package/dist/components/LogPanel.d.ts.map +1 -1
  26. package/dist/components/LogViewer.d.ts +1 -1
  27. package/dist/components/LogViewer.d.ts.map +1 -1
  28. package/dist/components/ProgramControl.d.ts.map +1 -1
  29. package/dist/components/ProgramStateIndicator.d.ts.map +1 -1
  30. package/dist/components/RobotCard.d.ts.map +1 -1
  31. package/dist/components/RobotListItem.d.ts.map +1 -1
  32. package/dist/components/RobotSetupReadinessIndicator.d.ts.map +1 -1
  33. package/dist/components/SelectableFab.d.ts +1 -1
  34. package/dist/components/SelectableFab.d.ts.map +1 -1
  35. package/dist/components/TabBar.d.ts +1 -1
  36. package/dist/components/TabBar.d.ts.map +1 -1
  37. package/dist/components/ThemeSelect.d.ts +1 -1
  38. package/dist/components/ThemeSelect.d.ts.map +1 -1
  39. package/dist/components/Timer/TimerDefaultVariant.d.ts.map +1 -1
  40. package/dist/components/Timer/TimerSmallVariant.d.ts.map +1 -1
  41. package/dist/components/TransparentOverlay.d.ts +2 -2
  42. package/dist/components/TransparentOverlay.d.ts.map +1 -1
  43. package/dist/components/VelocitySlider.d.ts +1 -1
  44. package/dist/components/VelocitySlider.d.ts.map +1 -1
  45. package/dist/components/experimental/utils/AdornedSelect.d.ts +1 -1
  46. package/dist/components/experimental/utils/AdornedSelect.d.ts.map +1 -1
  47. package/dist/components/jogging/JoggingBlocked.d.ts +1 -1
  48. package/dist/components/jogging/JoggingBlocked.d.ts.map +1 -1
  49. package/dist/components/jogging/JoggingCartesianAxisControl.d.ts.map +1 -1
  50. package/dist/components/jogging/JoggingCartesianTab.d.ts.map +1 -1
  51. package/dist/components/jogging/JoggingFreedriveTab.d.ts.map +1 -1
  52. package/dist/components/jogging/JoggingJointLimitDetector.d.ts +1 -1
  53. package/dist/components/jogging/JoggingJointLimitDetector.d.ts.map +1 -1
  54. package/dist/components/jogging/JoggingJointTab.d.ts +2 -2
  55. package/dist/components/jogging/JoggingJointTab.d.ts.map +1 -1
  56. package/dist/components/jogging/JoggingJointValueControl.d.ts.map +1 -1
  57. package/dist/components/jogging/JoggingOptions.d.ts.map +1 -1
  58. package/dist/components/jogging/JoggingPanel.d.ts +1 -1
  59. package/dist/components/jogging/JoggingPanel.d.ts.map +1 -1
  60. package/dist/components/jogging/JoggingStore.d.ts +1 -1
  61. package/dist/components/jogging/JoggingStore.d.ts.map +1 -1
  62. package/dist/components/jogging/JoggingToggleButtonGroup.d.ts +1 -1
  63. package/dist/components/jogging/JoggingToggleButtonGroup.d.ts.map +1 -1
  64. package/dist/components/jogging/JoggingVelocitySlider.d.ts +1 -1
  65. package/dist/components/jogging/JoggingVelocitySlider.d.ts.map +1 -1
  66. package/dist/components/jogging/PoseCartesianValues.d.ts.map +1 -1
  67. package/dist/components/jogging/PoseJointValues.d.ts.map +1 -1
  68. package/dist/components/modal/NoMotionGroupModal.d.ts.map +1 -1
  69. package/dist/components/robots/DHLinearAxis.d.ts.map +1 -1
  70. package/dist/components/robots/DHRobot.d.ts.map +1 -1
  71. package/dist/components/robots/GenericRobot.d.ts +1 -1
  72. package/dist/components/robots/GenericRobot.d.ts.map +1 -1
  73. package/dist/components/robots/LinearAxisAnimator.d.ts +1 -1
  74. package/dist/components/robots/LinearAxisAnimator.d.ts.map +1 -1
  75. package/dist/components/robots/MotionGroupVisualizer.d.ts +2 -2
  76. package/dist/components/robots/MotionGroupVisualizer.d.ts.map +1 -1
  77. package/dist/components/robots/RobotAnimator.d.ts +1 -1
  78. package/dist/components/robots/RobotAnimator.d.ts.map +1 -1
  79. package/dist/components/robots/SupportedLinearAxis.d.ts.map +1 -1
  80. package/dist/components/robots/SupportedRobot.d.ts.map +1 -1
  81. package/dist/components/robots/robotModelLogic.d.ts.map +1 -1
  82. package/dist/components/safetyBar/ControllerTypeIndicator.d.ts +1 -1
  83. package/dist/components/safetyBar/ControllerTypeIndicator.d.ts.map +1 -1
  84. package/dist/components/safetyBar/IndicatorWithExplanation.d.ts +2 -1
  85. package/dist/components/safetyBar/IndicatorWithExplanation.d.ts.map +1 -1
  86. package/dist/components/safetyBar/OperationModeIndicator.d.ts +1 -1
  87. package/dist/components/safetyBar/OperationModeIndicator.d.ts.map +1 -1
  88. package/dist/components/safetyBar/SafetyBar.d.ts +1 -1
  89. package/dist/components/safetyBar/SafetyBar.d.ts.map +1 -1
  90. package/dist/components/safetyBar/SafetyStateIndicator.d.ts +1 -1
  91. package/dist/components/safetyBar/SafetyStateIndicator.d.ts.map +1 -1
  92. package/dist/components/utils/converters.d.ts +2 -2
  93. package/dist/components/utils/converters.d.ts.map +1 -1
  94. package/dist/components/utils/hooks.d.ts.map +1 -1
  95. package/dist/components/utils/interpolation.d.ts.map +1 -1
  96. package/dist/core.cjs.js +1 -1
  97. package/dist/core.es.js +2 -2
  98. package/dist/externalizeComponent.d.ts.map +1 -1
  99. package/dist/icons/DropdownArrowIcon.d.ts +1 -1
  100. package/dist/icons/DropdownArrowIcon.d.ts.map +1 -1
  101. package/dist/index.cjs.js +1 -1
  102. package/dist/index.es.js +3 -3
  103. package/dist/interpolation-BIB6FC35.cjs +198 -0
  104. package/dist/interpolation-BIB6FC35.cjs.map +1 -0
  105. package/dist/interpolation-lSTX6ZXZ.js +14559 -0
  106. package/dist/interpolation-lSTX6ZXZ.js.map +1 -0
  107. package/dist/lib/JoggerConnection.d.ts +1 -1
  108. package/dist/lib/JoggerConnection.d.ts.map +1 -1
  109. package/dist/themes/createDarkTheme.d.ts +1 -1
  110. package/dist/themes/createDarkTheme.d.ts.map +1 -1
  111. package/dist/themes/createLightTheme.d.ts +1 -1
  112. package/dist/themes/createLightTheme.d.ts.map +1 -1
  113. package/dist/theming-D_pShDEg.js +32236 -0
  114. package/dist/theming-D_pShDEg.js.map +1 -0
  115. package/dist/theming-L5E8VSae.cjs +84 -0
  116. package/dist/theming-L5E8VSae.cjs.map +1 -0
  117. package/package.json +4 -3
  118. package/src/3d.ts +2 -2
  119. package/src/Setup.tsx +2 -6
  120. package/src/components/3d-viewport/PresetEnvironment.tsx +1 -0
  121. package/src/components/3d-viewport/SafetyZonesRenderer.tsx +43 -23
  122. package/src/components/3d-viewport/TrajectoryRenderer.tsx +1 -1
  123. package/src/components/3d-viewport/collider/ColliderCollection.tsx +3 -2
  124. package/src/components/AppHeader.tsx +9 -12
  125. package/src/components/ConsoleFilter.tsx +1 -1
  126. package/src/components/CopyableText.tsx +4 -1
  127. package/src/components/CycleTimer/DefaultVariant.tsx +8 -5
  128. package/src/components/CycleTimer/SmallVariant.tsx +3 -1
  129. package/src/components/DataGrid.tsx +4 -1
  130. package/src/components/LoadingCover.tsx +4 -1
  131. package/src/components/LogPanel.tsx +1 -1
  132. package/src/components/LogViewer.tsx +13 -17
  133. package/src/components/ProgramControl.tsx +7 -2
  134. package/src/components/ProgramStateIndicator.tsx +3 -2
  135. package/src/components/RobotCard.tsx +6 -1
  136. package/src/components/RobotListItem.tsx +4 -1
  137. package/src/components/RobotSetupReadinessIndicator.tsx +4 -2
  138. package/src/components/SelectableFab.tsx +2 -2
  139. package/src/components/TabBar.tsx +7 -3
  140. package/src/components/ThemeSelect.tsx +2 -1
  141. package/src/components/Timer/TimerDefaultVariant.tsx +9 -6
  142. package/src/components/Timer/TimerSmallVariant.tsx +2 -1
  143. package/src/components/Timer/useTimerLogic.ts +9 -9
  144. package/src/components/TransparentOverlay.tsx +2 -2
  145. package/src/components/VelocitySlider.tsx +3 -1
  146. package/src/components/experimental/utils/AdornedSelect.tsx +4 -8
  147. package/src/components/jogging/JoggingBlocked.tsx +6 -2
  148. package/src/components/jogging/JoggingCartesianAxisControl.tsx +5 -7
  149. package/src/components/jogging/JoggingCartesianTab.tsx +6 -8
  150. package/src/components/jogging/JoggingFreedriveTab.tsx +1 -2
  151. package/src/components/jogging/JoggingJointLimitDetector.tsx +41 -43
  152. package/src/components/jogging/JoggingJointTab.tsx +12 -20
  153. package/src/components/jogging/JoggingJointValueControl.tsx +44 -30
  154. package/src/components/jogging/JoggingOptions.tsx +143 -139
  155. package/src/components/jogging/JoggingPanel.test.tsx +77 -85
  156. package/src/components/jogging/JoggingPanel.tsx +10 -13
  157. package/src/components/jogging/JoggingStore.ts +18 -13
  158. package/src/components/jogging/JoggingToggleButtonGroup.tsx +3 -3
  159. package/src/components/jogging/JoggingVelocitySlider.tsx +2 -10
  160. package/src/components/jogging/PoseCartesianValues.tsx +2 -1
  161. package/src/components/jogging/PoseJointValues.tsx +2 -1
  162. package/src/components/jogging/__fixtures__/motionStreamMockData.ts +0 -1
  163. package/src/components/modal/NoMotionGroupModal.tsx +7 -10
  164. package/src/components/robots/DHLinearAxis.tsx +62 -45
  165. package/src/components/robots/DHRobot.tsx +47 -45
  166. package/src/components/robots/GenericRobot.tsx +24 -24
  167. package/src/components/robots/LinearAxis.tsx +0 -1
  168. package/src/components/robots/LinearAxisAnimator.tsx +4 -1
  169. package/src/components/robots/MotionGroupVisualizer.tsx +53 -53
  170. package/src/components/robots/RobotAnimator.test.tsx +2 -2
  171. package/src/components/robots/RobotAnimator.tsx +4 -1
  172. package/src/components/robots/SupportedLinearAxis.tsx +10 -3
  173. package/src/components/robots/SupportedRobot.tsx +10 -3
  174. package/src/components/robots/robotModelLogic.ts +22 -11
  175. package/src/components/safetyBar/ControllerTypeIndicator.tsx +2 -1
  176. package/src/components/safetyBar/IndicatorWithExplanation.tsx +13 -11
  177. package/src/components/safetyBar/OperationModeIndicator.tsx +2 -1
  178. package/src/components/safetyBar/SafetyBar.tsx +3 -1
  179. package/src/components/safetyBar/SafetyStateIndicator.tsx +2 -1
  180. package/src/components/utils/converters.ts +10 -7
  181. package/src/components/utils/errorHandling.ts +1 -1
  182. package/src/components/utils/hooks.tsx +1 -0
  183. package/src/components/utils/interpolation.test.ts +53 -38
  184. package/src/components/utils/interpolation.ts +1 -0
  185. package/src/externalizeComponent.tsx +3 -1
  186. package/src/icons/DropdownArrowIcon.tsx +1 -2
  187. package/src/lib/JoggerConnection.ts +24 -24
  188. package/src/themes/createDarkTheme.ts +2 -3
  189. package/dist/MotionGroupVisualizer-1twp8wG6.js +0 -1328
  190. package/dist/MotionGroupVisualizer-1twp8wG6.js.map +0 -1
  191. package/dist/MotionGroupVisualizer-Dq_KWGsa.cjs +0 -2
  192. package/dist/MotionGroupVisualizer-Dq_KWGsa.cjs.map +0 -1
  193. package/dist/interpolation-B3pbgXYX.cjs +0 -42
  194. package/dist/interpolation-B3pbgXYX.cjs.map +0 -1
  195. package/dist/interpolation-D4ATdkEg.js +0 -7912
  196. package/dist/interpolation-D4ATdkEg.js.map +0 -1
  197. package/dist/theming-BJ6pB6jG.cjs +0 -115
  198. package/dist/theming-BJ6pB6jG.cjs.map +0 -1
  199. package/dist/theming-LwkvEF-K.js +0 -22417
  200. package/dist/theming-LwkvEF-K.js.map +0 -1
@@ -1,11 +1,10 @@
1
1
  import { tryParseJson } from "@wandelbots/nova-js"
2
2
  import {
3
+ JointTypeEnum,
3
4
  type CoordinateSystem,
4
- type DHParameter,
5
+ type KinematicModel,
5
6
  type MotionGroupDescription,
6
7
  type RobotTcp,
7
- type KinematicModel,
8
- JointTypeEnum,
9
8
  } from "@wandelbots/nova-js/v2"
10
9
  import { countBy } from "lodash-es"
11
10
  import keyBy from "lodash-es/keyBy"
@@ -43,11 +42,11 @@ export type IncrementJogInProgress = {
43
42
  axis: JoggingAxis
44
43
  }
45
44
 
46
- type TabType = "cartesian" | "joint" | "debug";
45
+ type TabType = "cartesian" | "joint" | "debug"
47
46
  export type CartesianMotionType = "translate" | "rotate"
48
47
 
49
48
  export class JoggingStore {
50
- selectedTabId: TabType = "cartesian";
49
+ selectedTabId: TabType = "cartesian"
51
50
 
52
51
  /** Locks to prevent UI interactions during certain operations */
53
52
  locks = new Set<string>()
@@ -163,9 +162,10 @@ export class JoggingStore {
163
162
  ),
164
163
  ])
165
164
 
166
- const kinematicModel: KinematicModel = await nova.api.motionGroupModels.getMotionGroupKinematicModel(
167
- description.motion_group_model,
168
- )
165
+ const kinematicModel: KinematicModel =
166
+ await nova.api.motionGroupModels.getMotionGroupKinematicModel(
167
+ description.motion_group_model,
168
+ )
169
169
 
170
170
  const tcps = Object.entries(description.tcps || {}).map(([id, tcp]) => ({
171
171
  id,
@@ -174,7 +174,13 @@ export class JoggingStore {
174
174
  orientation: tcp.pose.orientation as Vector3Simple,
175
175
  }))
176
176
 
177
- return new JoggingStore(jogger, coordinatesystems || [], description, tcps, kinematicModel.inverse_solver)
177
+ return new JoggingStore(
178
+ jogger,
179
+ coordinatesystems || [],
180
+ description,
181
+ tcps,
182
+ kinematicModel.inverse_solver,
183
+ )
178
184
  }
179
185
 
180
186
  constructor(
@@ -214,6 +220,7 @@ export class JoggingStore {
214
220
  this.disposers.push(autorun(() => this.saveToLocalStorage()))
215
221
 
216
222
  // Assign joggingStore to window
223
+ // biome-ignore lint/suspicious/noExplicitAny: pre-biome code
217
224
  ;(window as any).joggingStore = this
218
225
  }
219
226
 
@@ -329,7 +336,6 @@ export class JoggingStore {
329
336
  return tempTabs
330
337
  }
331
338
 
332
-
333
339
  get incrementOptions() {
334
340
  return incrementOptions
335
341
  }
@@ -347,6 +353,7 @@ export class JoggingStore {
347
353
  }
348
354
 
349
355
  get currentTab() {
356
+ // biome-ignore lint/style/noNonNullAssertion: pre-biome code
350
357
  return this.tabsById[this.selectedTabId] || this.tabs[0]!
351
358
  }
352
359
 
@@ -391,7 +398,6 @@ export class JoggingStore {
391
398
  : this.translationVelocityMmPerSec
392
399
  }
393
400
 
394
-
395
401
  /** Minimum selectable velocity in mm/sec or deg/sec */
396
402
  minVelocityInDisplayUnits(useDegree: boolean) {
397
403
  return useDegree
@@ -399,7 +405,6 @@ export class JoggingStore {
399
405
  : this.minTranslationVelocityMmPerSec
400
406
  }
401
407
 
402
-
403
408
  /** Maximum selectable velocity in mm/sec or deg/sec */
404
409
  maxVelocityInDisplayUnits(useDegree: boolean) {
405
410
  return useDegree
@@ -408,6 +413,7 @@ export class JoggingStore {
408
413
  }
409
414
 
410
415
  onTabChange(_event: React.SyntheticEvent, newValue: number) {
416
+ // biome-ignore lint/style/noNonNullAssertion: pre-biome code
411
417
  const tab = this.tabs[newValue] || this.tabs[0]!
412
418
  this.selectedTabId = tab.id
413
419
  }
@@ -440,7 +446,6 @@ export class JoggingStore {
440
446
  }
441
447
  }
442
448
 
443
-
444
449
  setSelectedCartesianMotionType(type: CartesianMotionType) {
445
450
  this.selectedCartesianMotionType = type
446
451
  }
@@ -1,6 +1,6 @@
1
- import type { ToggleButtonGroupProps } from "@mui/material"
2
- import { styled, ToggleButtonGroup } from "@mui/material"
3
-
1
+ import type { ToggleButtonGroupProps } from "@mui/material/ToggleButtonGroup"
2
+ import { styled } from "@mui/material/styles"
3
+ import ToggleButtonGroup from "@mui/material/ToggleButtonGroup"
4
4
  export const JoggingToggleButtonGroup: React.ComponentType<ToggleButtonGroupProps> =
5
5
  styled(ToggleButtonGroup)(({ theme }) => ({
6
6
  "&.MuiToggleButtonGroup-root": {
@@ -1,17 +1,10 @@
1
- import { observer} from "mobx-react-lite"
1
+ import { observer } from "mobx-react-lite"
2
2
  import { useTranslation } from "react-i18next"
3
3
  import { VelocitySlider, VelocitySliderLabel } from "../VelocitySlider"
4
4
  import type { JoggingStore } from "./JoggingStore"
5
5
 
6
6
  export const JoggingVelocitySlider = observer(
7
- ({
8
- store,
9
- useDegree,
10
- }: {
11
- store: JoggingStore
12
- useDegree: boolean
13
- }) => {
14
-
7
+ ({ store, useDegree }: { store: JoggingStore; useDegree: boolean }) => {
15
8
  const { t } = useTranslation()
16
9
 
17
10
  function valueLabelFormat(value: number, useDegree: boolean): string {
@@ -20,7 +13,6 @@ export const JoggingVelocitySlider = observer(
20
13
  : `v = ${t("Jogging.Cartesian.Translation.velocityMmPerSec.lb", { amount: value })}`
21
14
  }
22
15
 
23
-
24
16
  return (
25
17
  <VelocitySlider
26
18
  store={store}
@@ -1,4 +1,5 @@
1
- import { Button, Stack } from "@mui/material"
1
+ import Button from "@mui/material/Button"
2
+ import Stack from "@mui/material/Stack"
2
3
  import { poseToWandelscriptString, type Pose } from "@wandelbots/nova-js/v2"
3
4
  import { observer } from "mobx-react-lite"
4
5
  import { useState } from "react"
@@ -1,4 +1,5 @@
1
- import { Button, Stack } from "@mui/material"
1
+ import Button from "@mui/material/Button"
2
+ import Stack from "@mui/material/Stack"
2
3
  import { observer } from "mobx-react-lite"
3
4
  import { useState } from "react"
4
5
  import { externalizeComponent } from "../../externalizeComponent"
@@ -134,4 +134,3 @@ export const linearAxisDescription: MotionGroupDescription = {
134
134
  operation_limits: { auto_limits: { joints: [] } },
135
135
  dh_parameters: linearAxisDhParameters,
136
136
  } as unknown as MotionGroupDescription
137
-
@@ -1,13 +1,10 @@
1
- import {
2
- Button,
3
- Dialog,
4
- DialogActions,
5
- DialogContent,
6
- DialogTitle,
7
- Stack,
8
- Typography,
9
- } from "@mui/material"
10
-
1
+ import Button from "@mui/material/Button"
2
+ import Dialog from "@mui/material/Dialog"
3
+ import DialogActions from "@mui/material/DialogActions"
4
+ import DialogContent from "@mui/material/DialogContent"
5
+ import DialogTitle from "@mui/material/DialogTitle"
6
+ import Stack from "@mui/material/Stack"
7
+ import Typography from "@mui/material/Typography"
11
8
  function getBaseUrl(): string {
12
9
  const currentUrl = window.location.href
13
10
  return currentUrl.substring(
@@ -1,6 +1,8 @@
1
+ /* biome-ignore-all lint/style/noNonNullAssertion: pre-biome code */
2
+ /* biome-ignore-all lint/suspicious/noExplicitAny: pre-biome code */
3
+
1
4
  import { Line } from "@react-three/drei"
2
- import type { DHParameter } from "@wandelbots/nova-js/v2"
3
- import React, { useRef } from "react"
5
+ import { useRef } from "react"
4
6
  import type * as THREE from "three"
5
7
  import { Matrix4, Quaternion, Vector3 } from "three"
6
8
  import LinearAxisAnimator from "./LinearAxisAnimator"
@@ -20,25 +22,27 @@ export function DHLinearAxis({
20
22
  // Calculate initial TCP position
21
23
  function calculateTcpPosition(jointValues: number[]): Vector3 {
22
24
  const tempMatrix = new Matrix4()
23
-
25
+
24
26
  for (let i = 0; i < dhParameters.length; i++) {
25
27
  const param = dhParameters[i]
26
28
  const jointValue = jointValues[i] ?? 0
27
-
29
+
28
30
  const matrix = new Matrix4()
29
31
  .makeRotationY(param.theta!) // Base rotation (if any)
30
32
  .multiply(
31
33
  new Matrix4().makeTranslation(
32
34
  param.a! / 1000,
33
- (param.d! + jointValue * (param.reverse_rotation_direction ? -1 : 1)) / 1000,
34
- 0
35
- )
35
+ (param.d! +
36
+ jointValue * (param.reverse_rotation_direction ? -1 : 1)) /
37
+ 1000,
38
+ 0,
39
+ ),
36
40
  ) // Translate along X by a, and Y by d + joint_position
37
41
  .multiply(new Matrix4().makeRotationX(param.alpha!)) // Rotate around X
38
-
42
+
39
43
  tempMatrix.multiply(matrix)
40
44
  }
41
-
45
+
42
46
  const position = new Vector3()
43
47
  const quaternion = new Quaternion()
44
48
  const scale = new Vector3()
@@ -47,7 +51,9 @@ export function DHLinearAxis({
47
51
  }
48
52
 
49
53
  // Calculate initial TCP position for rendering
50
- const initialTcpPosition = calculateTcpPosition(rapidlyChangingMotionState.joint_position)
54
+ const initialTcpPosition = calculateTcpPosition(
55
+ rapidlyChangingMotionState.joint_position,
56
+ )
51
57
 
52
58
  function setTranslation(joints: THREE.Object3D[], jointValues: number[]) {
53
59
  accumulatedMatrix.identity()
@@ -59,19 +65,21 @@ export function DHLinearAxis({
59
65
  for (let jointIndex = 0; jointIndex < dhParameters.length; jointIndex++) {
60
66
  const jointValue = jointValues[jointIndex] ?? 0
61
67
  const param = dhParameters[jointIndex]
62
-
68
+
63
69
  // Calculate and accumulate transformation
64
70
  const matrix = new Matrix4()
65
71
  .makeRotationY(param.theta!) // Base rotation (if any)
66
72
  .multiply(
67
73
  new Matrix4().makeTranslation(
68
74
  param.a! / 1000,
69
- (param.d! + jointValue * (param.reverse_rotation_direction ? -1 : 1)) / 1000,
70
- 0
71
- )
75
+ (param.d! +
76
+ jointValue * (param.reverse_rotation_direction ? -1 : 1)) /
77
+ 1000,
78
+ 0,
79
+ ),
72
80
  )
73
81
  .multiply(new Matrix4().makeRotationX(param.alpha!))
74
-
82
+
75
83
  accumulatedMatrix.multiply(matrix)
76
84
  }
77
85
 
@@ -84,45 +92,54 @@ export function DHLinearAxis({
84
92
 
85
93
  // Update TCP marker
86
94
  if (tcpMeshRef.current) {
87
- tcpMeshRef.current.position.set(tcpPosition.x, tcpPosition.y, tcpPosition.z)
95
+ tcpMeshRef.current.position.set(
96
+ tcpPosition.x,
97
+ tcpPosition.y,
98
+ tcpPosition.z,
99
+ )
88
100
  }
89
101
 
90
102
  // Update TCP line
91
103
  if (tcpLineRef.current) {
92
104
  const lineGeometry = tcpLineRef.current.geometry
93
- if (lineGeometry && lineGeometry.setPositions) {
94
- lineGeometry.setPositions([0, 0, 0, tcpPosition.x, tcpPosition.y, tcpPosition.z])
105
+ if (lineGeometry?.setPositions) {
106
+ lineGeometry.setPositions([
107
+ 0,
108
+ 0,
109
+ 0,
110
+ tcpPosition.x,
111
+ tcpPosition.y,
112
+ tcpPosition.z,
113
+ ])
95
114
  }
96
115
  }
97
116
  }
98
117
 
99
118
  return (
100
- <>
101
- <LinearAxisAnimator
102
- rapidlyChangingMotionState={rapidlyChangingMotionState}
103
- dhParameters={dhParameters}
104
- onTranslationChanged={setTranslation}
105
- >
106
- <group {...props} name="Scene">
107
- {/* Base (origin) - Green sphere representing initial previous position */}
108
- <mesh name="Base" position={[0, 0, 0]}>
109
- <sphereGeometry args={[0.02, 32, 32]} />
110
- <meshStandardMaterial color={"green"} depthTest={true} />
111
- </mesh>
112
- {/* Line from Base to TCP */}
113
- <Line
114
- ref={tcpLineRef}
115
- points={[new Vector3(0, 0, 0), initialTcpPosition]}
116
- color={"White"}
117
- lineWidth={5}
118
- />
119
- {/* TCP (Tool Center Point) - Red sphere that shows final position */}
120
- <mesh ref={tcpMeshRef} name="TCP" position={initialTcpPosition}>
121
- <sphereGeometry args={[0.025, 32, 32]} />
122
- <meshStandardMaterial color={"red"} depthTest={true} />
123
- </mesh>
124
- </group>
125
- </LinearAxisAnimator>
126
- </>
119
+ <LinearAxisAnimator
120
+ rapidlyChangingMotionState={rapidlyChangingMotionState}
121
+ dhParameters={dhParameters}
122
+ onTranslationChanged={setTranslation}
123
+ >
124
+ <group {...props} name="Scene">
125
+ {/* Base (origin) - Green sphere representing initial previous position */}
126
+ <mesh name="Base" position={[0, 0, 0]}>
127
+ <sphereGeometry args={[0.02, 32, 32]} />
128
+ <meshStandardMaterial color={"green"} depthTest={true} />
129
+ </mesh>
130
+ {/* Line from Base to TCP */}
131
+ <Line
132
+ ref={tcpLineRef}
133
+ points={[new Vector3(0, 0, 0), initialTcpPosition]}
134
+ color={"White"}
135
+ lineWidth={5}
136
+ />
137
+ {/* TCP (Tool Center Point) - Red sphere that shows final position */}
138
+ <mesh ref={tcpMeshRef} name="TCP" position={initialTcpPosition}>
139
+ <sphereGeometry args={[0.025, 32, 32]} />
140
+ <meshStandardMaterial color={"red"} depthTest={true} />
141
+ </mesh>
142
+ </group>
143
+ </LinearAxisAnimator>
127
144
  )
128
145
  }
@@ -1,3 +1,6 @@
1
+ /* biome-ignore-all lint/style/noNonNullAssertion: pre-biome code */
2
+ /* biome-ignore-all lint/suspicious/noExplicitAny: pre-biome code */
3
+
1
4
  import { Line } from "@react-three/drei"
2
5
  import type { DHParameter } from "@wandelbots/nova-js/v2"
3
6
  import React, { useRef } from "react"
@@ -99,50 +102,49 @@ export function DHRobot({
99
102
  }
100
103
 
101
104
  return (
102
- <>
103
- <RobotAnimator
104
- rapidlyChangingMotionState={rapidlyChangingMotionState}
105
- dhParameters={dhParameters}
106
- onRotationChanged={setRotation}
107
- >
108
- <group {...props} name="Scene">
109
- <mesh>
110
- <sphereGeometry args={[0.01, 32, 32]} />
111
- <meshStandardMaterial color={"black"} depthTest={true} />
112
- </mesh>
113
- {dhParameters!.map((param, index) => {
114
- const { a, b } = getLinePoints(
115
- param,
116
- rapidlyChangingMotionState.joint_position[index] ?? 0,
117
- )
118
- const jointName = `dhrobot_J0${index}`
119
- return (
120
- <group name={jointName} key={jointName}>
121
- <Line
122
- ref={(ref) => {
123
- lineRefs.current[index] = ref
124
- }}
125
- name={CHILD_LINE}
126
- points={[a, b]}
127
- color={"white"}
128
- lineWidth={5}
129
- />
130
- <mesh
131
- ref={(ref) => {
132
- meshRefs.current[index] = ref
133
- }}
134
- name={CHILD_MESH}
135
- key={"mesh_" + index}
136
- position={b}
137
- >
138
- <sphereGeometry args={[0.01, 32, 32]} />
139
- <meshStandardMaterial color={"black"} depthTest={true} />
140
- </mesh>
141
- </group>
142
- )
143
- })}
144
- </group>
145
- </RobotAnimator>
146
- </>
105
+ <RobotAnimator
106
+ rapidlyChangingMotionState={rapidlyChangingMotionState}
107
+ dhParameters={dhParameters}
108
+ onRotationChanged={setRotation}
109
+ >
110
+ <group {...props} name="Scene">
111
+ <mesh>
112
+ <sphereGeometry args={[0.01, 32, 32]} />
113
+ <meshStandardMaterial color={"black"} depthTest={true} />
114
+ </mesh>
115
+ {dhParameters?.map((param, index) => {
116
+ const { a, b } = getLinePoints(
117
+ param,
118
+ rapidlyChangingMotionState.joint_position[index] ?? 0,
119
+ )
120
+ const jointName = `dhrobot_J0${index}`
121
+ return (
122
+ <group name={jointName} key={jointName}>
123
+ <Line
124
+ ref={(ref) => {
125
+ lineRefs.current[index] = ref
126
+ }}
127
+ name={CHILD_LINE}
128
+ points={[a, b]}
129
+ color={"white"}
130
+ lineWidth={5}
131
+ />
132
+ <mesh
133
+ ref={(ref) => {
134
+ meshRefs.current[index] = ref
135
+ }}
136
+ name={CHILD_MESH}
137
+ // biome-ignore lint/suspicious/noArrayIndexKey: pre-biome code
138
+ key={`mesh_${index}`}
139
+ position={b}
140
+ >
141
+ <sphereGeometry args={[0.01, 32, 32]} />
142
+ <meshStandardMaterial color={"black"} depthTest={true} />
143
+ </mesh>
144
+ </group>
145
+ )
146
+ })}
147
+ </group>
148
+ </RobotAnimator>
147
149
  )
148
150
  }
@@ -1,8 +1,8 @@
1
1
  import { useGLTF } from "@react-three/drei"
2
2
  import type { ThreeElements } from "@react-three/fiber"
3
- import React, { useCallback, useEffect, useState } from "react"
4
- import type { Group, Mesh } from "three"
5
- import { type Object3D } from "three"
3
+ import type React from "react"
4
+ import { useCallback, useEffect, useState } from "react"
5
+ import type { Group, Mesh, Object3D } from "three"
6
6
  import { isFlange, parseRobotModel } from "./robotModelLogic"
7
7
 
8
8
  export type RobotModelProps = {
@@ -20,24 +20,19 @@ function isMesh(node: Object3D): node is Mesh {
20
20
  }
21
21
 
22
22
  // Separate component that only renders when we have a valid URL
23
- function LoadedRobotModel({
24
- url,
25
- flangeRef,
26
- postModelRender,
27
- ...props
28
- }: {
23
+ function LoadedRobotModel({
24
+ url,
25
+ flangeRef,
26
+ postModelRender,
27
+ ...props
28
+ }: {
29
29
  url: string
30
30
  flangeRef?: React.Ref<Group>
31
31
  postModelRender?: () => void
32
32
  } & ThreeElements["group"]) {
33
33
  const gltfResult = useGLTF(url)
34
- let gltf
35
- try {
36
- const parsed = parseRobotModel(gltfResult, 'robot.glb')
37
- gltf = parsed.gltf
38
- } catch (err) {
39
- throw err;
40
- }
34
+ const parsed = parseRobotModel(gltfResult, "robot.glb")
35
+ const gltf = parsed.gltf
41
36
 
42
37
  const groupRef: React.RefCallback<Group> = useCallback(
43
38
  (group) => {
@@ -66,7 +61,12 @@ function LoadedRobotModel({
66
61
  }
67
62
  // Fallback to empty group if geometry is missing
68
63
  return (
69
- <group name={node.name} key={node.uuid} position={node.position} rotation={node.rotation} />
64
+ <group
65
+ name={node.name}
66
+ key={node.uuid}
67
+ position={node.position}
68
+ rotation={node.rotation}
69
+ />
70
70
  )
71
71
  } else {
72
72
  return (
@@ -82,7 +82,7 @@ function LoadedRobotModel({
82
82
  )
83
83
  }
84
84
  } catch (e) {
85
- console.warn('Error rendering node', node.name, e)
85
+ console.warn("Error rendering node", node.name, e)
86
86
  return null
87
87
  }
88
88
  }
@@ -101,21 +101,21 @@ export function GenericRobot({
101
101
  ...props
102
102
  }: RobotModelProps) {
103
103
  const [resolvedURL, setResolvedURL] = useState<string | null>(null)
104
-
104
+
105
105
  useEffect(() => {
106
106
  const resolveURL = async () => {
107
107
  try {
108
- if (typeof modelURL === 'string') {
108
+ if (typeof modelURL === "string") {
109
109
  setResolvedURL(modelURL)
110
110
  } else {
111
111
  const url = await modelURL
112
112
  setResolvedURL(url)
113
113
  }
114
114
  } catch (error) {
115
- console.error('Failed to resolve model URL:', error)
115
+ console.error("Failed to resolve model URL:", error)
116
116
  }
117
117
  }
118
-
118
+
119
119
  resolveURL()
120
120
  }, [modelURL])
121
121
 
@@ -123,9 +123,9 @@ export function GenericRobot({
123
123
  if (!resolvedURL) {
124
124
  return null // Loading state
125
125
  }
126
-
126
+
127
127
  return (
128
- <LoadedRobotModel
128
+ <LoadedRobotModel
129
129
  url={resolvedURL}
130
130
  flangeRef={flangeRef}
131
131
  postModelRender={postModelRender}
@@ -70,4 +70,3 @@ export function LinearAxis({
70
70
  }
71
71
 
72
72
  export { defaultGetModel }
73
-
@@ -1,6 +1,7 @@
1
1
  import { useFrame, useThree } from "@react-three/fiber"
2
2
  import type { DHParameter, MotionGroupState } from "@wandelbots/nova-js/v2"
3
- import React, { useCallback, useEffect, useRef } from "react"
3
+ import type React from "react"
4
+ import { useCallback, useEffect, useRef } from "react"
4
5
  import type { Group, Object3D } from "three"
5
6
  import { useAutorun } from "../utils/hooks"
6
7
  import { ValueInterpolator } from "../utils/interpolation"
@@ -25,6 +26,7 @@ export default function LinearAxisAnimator({
25
26
  const { invalidate } = useThree()
26
27
 
27
28
  // Initialize interpolator
29
+ // biome-ignore lint/correctness/useExhaustiveDependencies: pre-biome code
28
30
  useEffect(() => {
29
31
  const initialJointValues = rapidlyChangingMotionState.joint_position.filter(
30
32
  (item) => item !== undefined,
@@ -98,6 +100,7 @@ export default function LinearAxisAnimator({
98
100
  * Fire an update joints call on every motion state change.
99
101
  * requestAnimationFrame used to avoid blocking main thread
100
102
  */
103
+ // biome-ignore lint/correctness/useExhaustiveDependencies: pre-biome code
101
104
  useEffect(() => {
102
105
  updateJoints()
103
106
  }, [rapidlyChangingMotionState, updateJoints])