Skip to content

Commit

Permalink
fix: Increment rotation jogging now correctly uses rads instead of de…
Browse files Browse the repository at this point in the history
…gs (#158)

Co-authored-by: Evan Summers <[email protected]>
  • Loading branch information
vgerber and evrys authored Dec 6, 2024
1 parent 4214cde commit a74612c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/components/jogging/JoggingCartesianTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ export const JoggingCartesianTab = observer(
currentTcpPose: tcpPose,
currentJoints: jointPosition,
coordSystemId: store.activeCoordSystemId,
velocityInRelevantUnits: store.velocityInCurrentUnits,
velocityInRelevantUnits:
store.selectedCartesianMotionType === "translate"
? store.translationVelocityMmPerSec
: store.rotationVelocityRadsPerSec,
axis: opts.axis,
direction: opts.direction,
motion:
Expand Down
9 changes: 6 additions & 3 deletions src/components/jogging/JoggingStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,19 +340,22 @@ export class JoggingStore {
return (this.rotationVelocityDegPerSec * Math.PI) / 180
}

get velocityInCurrentUnits() {
/** Selected velocity in mm/sec or deg/sec */
get velocityInDisplayUnits() {
return this.currentMotionType === "translate"
? this.translationVelocityMmPerSec
: this.rotationVelocityDegPerSec
}

get minVelocityInCurrentUnits() {
/** Minimum selectable velocity in mm/sec or deg/sec */
get minVelocityInDisplayUnits() {
return this.currentMotionType === "translate"
? this.minTranslationVelocityMmPerSec
: this.minRotationVelocityDegPerSec
}

get maxVelocityInCurrentUnits() {
/** Maximum selectable velocity in mm/sec or deg/sec */
get maxVelocityInDisplayUnits() {
return this.currentMotionType === "translate"
? this.maxTranslationVelocityMmPerSec
: this.maxRotationVelocityDegPerSec
Expand Down
6 changes: 3 additions & 3 deletions src/components/jogging/JoggingVelocitySlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export const JoggingVelocitySlider = observer(

return (
<VelocitySlider
velocity={store.velocityInCurrentUnits}
min={store.minVelocityInCurrentUnits}
max={store.maxVelocityInCurrentUnits}
velocity={store.velocityInDisplayUnits}
min={store.minVelocityInDisplayUnits}
max={store.maxVelocityInDisplayUnits}
onVelocityChange={store.setVelocityFromSlider}
disabled={store.isLocked}
renderValue={(value) => (
Expand Down

0 comments on commit a74612c

Please sign in to comment.