Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC fix for legacy lifts #126

Merged
merged 3 commits into from
Jul 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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