Skip to content

Commit

Permalink
Merge branch 'main' into luca/drawing_editor
Browse files Browse the repository at this point in the history
  • Loading branch information
mxgrey authored Jul 26, 2023
2 parents 46a1dec + 54a5b45 commit fbf9856
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions rmf_site_format/src/legacy/lift.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ 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;
// 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;
let rotate = |x, y| {
(
Expand Down Expand Up @@ -95,8 +101,14 @@ 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;
// 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;

let cabin_face = if dx.abs() < 1e-3 {
// Very small x value means the door must be on the left or right face
Expand Down Expand Up @@ -208,8 +220,14 @@ impl Lift {
}
}

let width = self.width as f32;
let depth = self.depth 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 width = self.depth as f32;
let depth = self.width as f32;
let cabin = RectangularLiftCabin {
width,
depth,
Expand Down

0 comments on commit fbf9856

Please sign in to comment.