Skip to content

Commit

Permalink
Fix unit conversion for odometry & 3D fields views
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jwbonner committed Oct 26, 2023
1 parent f29b9d4 commit 8ab6c35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/hub/tabControllers/OdometryController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] => {
Expand Down
2 changes: 1 addition & 1 deletion src/hub/tabControllers/ThreeDimensionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] => {
Expand Down

0 comments on commit 8ab6c35

Please sign in to comment.