From 9172f86763173826de1665a39d8d24881b9c9eb6 Mon Sep 17 00:00:00 2001 From: Luca Della Vedova Date: Mon, 15 May 2023 12:35:47 +0800 Subject: [PATCH 1/2] POC fix for legacy lifts Signed-off-by: Luca Della Vedova --- rmf_site_format/src/legacy/lift.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rmf_site_format/src/legacy/lift.rs b/rmf_site_format/src/legacy/lift.rs index d5d16b11..fdde80bd 100644 --- a/rmf_site_format/src/legacy/lift.rs +++ b/rmf_site_format/src/legacy/lift.rs @@ -45,8 +45,8 @@ impl Lift { // TODO(MXG): Rewrite this with glam now that we've accepted it as a dependency let x = self.x as f32; let y = self.y as f32; - let d = self.depth as f32 / 2.0; - let w = self.width as f32 / 2.0; + let d = self.width as f32 / 2.0; + let w = self.depth as f32 / 2.0; let theta = self.yaw as f32; let rotate = |x, y| { ( @@ -95,8 +95,8 @@ impl Lift { let dx = door.x as f32; let dy = door.y as f32; - let half_width = self.width as f32 / 2.0; - let half_depth = self.depth as f32 / 2.0; + let half_width = self.depth as f32 / 2.0; + let half_depth = self.width as f32 / 2.0; let cabin_face = if dx.abs() < 1e-3 { // Very small x value means the door must be on the left or right face @@ -208,8 +208,8 @@ impl Lift { } } - let width = self.width as f32; - let depth = self.depth as f32; + let width = self.depth as f32; + let depth = self.width as f32; let cabin = RectangularLiftCabin { width, depth, From 7ce37741c75358e42076477dba83fec02e3952aa Mon Sep 17 00:00:00 2001 From: "Michael X. Grey" Date: Wed, 26 Jul 2023 12:47:23 +0800 Subject: [PATCH 2/2] Add notes about lift axis changes Signed-off-by: Michael X. Grey --- rmf_site_format/src/legacy/lift.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/rmf_site_format/src/legacy/lift.rs b/rmf_site_format/src/legacy/lift.rs index fdde80bd..5022bd83 100644 --- a/rmf_site_format/src/legacy/lift.rs +++ b/rmf_site_format/src/legacy/lift.rs @@ -45,6 +45,12 @@ impl Lift { // TODO(MXG): Rewrite this with glam now that we've accepted it as a dependency let x = self.x as f32; let y = self.y as f32; + // NOTE: Coordinate axes changed between the legacy format and the + // new format. Width used to be along the local x axis, and depth + // used to be along the local y axis, but now that is flipped to + // better align with the robotics convention of the local x axis + // being forward/backward while the local y axis is the lateral + // direction (side-to-side). let d = self.width as f32 / 2.0; let w = self.depth as f32 / 2.0; let theta = self.yaw as f32; @@ -95,6 +101,12 @@ impl Lift { let dx = door.x as f32; let dy = door.y as f32; + // NOTE: Coordinate axes changed between the legacy format and the + // new format. Width used to be along the local x axis, and depth + // used to be along the local y axis, but now that is flipped to + // better align with the robotics convention of the local x axis + // being forward/backward while the local y axis is the lateral + // direction (side-to-side). let half_width = self.depth as f32 / 2.0; let half_depth = self.width as f32 / 2.0; @@ -208,6 +220,12 @@ impl Lift { } } + // NOTE: Coordinate axes changed between the legacy format and the + // new format. Width used to be along the local x axis, and depth + // used to be along the local y axis, but now that is flipped to + // better align with the robotics convention of the local x axis + // being forward/backward while the local y axis is the lateral + // direction (side-to-side). let width = self.depth as f32; let depth = self.width as f32; let cabin = RectangularLiftCabin {