From 8ab6c35d0e08914dadeb389fa2efc2c524aa5288 Mon Sep 17 00:00:00 2001 From: Jonah <47046556+jwbonner@users.noreply.github.com> Date: Wed, 25 Oct 2023 22:31:42 -0400 Subject: [PATCH] Fix unit conversion for odometry & 3D fields views Converting to meters actually produced the correct result since both meters and radians are used as base units, but radians is the correct unit here --- src/hub/tabControllers/OdometryController.ts | 2 +- src/hub/tabControllers/ThreeDimensionController.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hub/tabControllers/OdometryController.ts b/src/hub/tabControllers/OdometryController.ts index a8c657df..aee59165 100644 --- a/src/hub/tabControllers/OdometryController.ts +++ b/src/hub/tabControllers/OdometryController.ts @@ -211,7 +211,7 @@ export default class OdometryController extends TimelineVizController { getCommand(time: number) { const distanceConversion = convert(1, this.UNIT_DISTANCE.value, "meters"); - const rotationConversion = convert(1, this.UNIT_ROTATION.value, "meters"); + const rotationConversion = convert(1, this.UNIT_ROTATION.value, "radians"); // Returns the current value for a field let getCurrentValue = (key: string, type: LoggableType | string): Pose2d[] => { diff --git a/src/hub/tabControllers/ThreeDimensionController.ts b/src/hub/tabControllers/ThreeDimensionController.ts index 4b8ccca1..a55e2b93 100644 --- a/src/hub/tabControllers/ThreeDimensionController.ts +++ b/src/hub/tabControllers/ThreeDimensionController.ts @@ -302,7 +302,7 @@ export default class ThreeDimensionController extends TimelineVizController { getCommand(time: number) { const distanceConversion = convert(1, this.UNIT_DISTANCE.value, "meters"); - const rotationConversion = convert(1, this.UNIT_ROTATION.value, "meters"); + const rotationConversion = convert(1, this.UNIT_ROTATION.value, "radians"); // Returns the current value for a 3D field let get3DValue = (key: string, type: LoggableType | string): Pose3d[] => {