Skip to content

FLU: Implement backward compatibility mechanism - #3619

Merged
lukicdarkoo merged 58 commits into
feature-enu-planfrom
feature-flu-backward-compability
Sep 22, 2021
Merged

lukicdarkoo merged 58 commits into
feature-enu-planfrom
feature-flu-backward-compability

Conversation

@lukicdarkoo

@lukicdarkoo lukicdarkoo commented Aug 27, 2021 •

Copy link
Copy Markdown
Member

To avoid breaking worlds and PROTOs we add a mechanism to handle the backward compatibility by adding Transform nodes and rotation Transform descendants.

Tasks

  • Proof of concept
  • Cases
    • 21b PROTO inside 21b PROTO
    • 21c PROTO inside 21b PROTO
    • 21b PROTO inside 21c PROTO
    • Primitive inside 21b PROTO
    • Primitive inside 21b world
  • Cover all nodes
    • Cylinder
    • Capsule
    • Cone
    • Plane
    • Elevation grid
    • Camera
    • Range Finder
    • Lidar
    • Radar
    • Track
    • Viewpoint
    • TouchSensor
    • Connector
    • Emitter & Receiver
    • Pen
  • Fix reset
  • Handle USE/DEF
  • Add tests

World example

#VRML_SIM R2021c utf8
WorldInfo {
}
Viewpoint {
  orientation 0.1763811647303118 -0.3150091039421665 -0.9325550649489456 5.201713829247902
  position -0.3639376985270853 -1.5105649727458803 1.0602391552040498
}
TexturedBackground {
}
TexturedBackgroundLight {
}
Floor {
  size 100 100
}
Robot {
  translation -2.69 0 0
  children [
    Camera {
      children [
        DEF BOX_SHAPE Shape {
          geometry Box {
            size 0.1 0.1 0.1
          }
        }
      ]
      boundingObject USE BOX_SHAPE
    }
  ]
}
TrashContainer {
}
JetBot {
}
UR3e {
  translation 0 0.33 1.54865e-06
  rotation 1 0 0 4.692820414042842e-06
}
DEF TEST Spot {
  translation 1.02 0.624 0.6
  rotation 1 0 0 1.5708
}
Imagine a user has a custom built of the Khepera IV robot

Screenshot-20210914165331-531x592

Screenshot-20210914165456-402x384

Screenshot-20210916145443-909x673
Before the backwards compatibility fix

Screenshot-20210916145502-986x624
After the backwards compatibility fix

@lukicdarkoo lukicdarkoo added the enhancement Implementation of a minor feature label Aug 27, 2021
@lukicdarkoo lukicdarkoo added this to the R2021c milestone Aug 27, 2021
@lukicdarkoo lukicdarkoo self-assigned this Aug 27, 2021
@lukicdarkoo lukicdarkoo added the test suite Start the test suite label Sep 15, 2021
@lukicdarkoo lukicdarkoo added the test distribution Start the distribution test label Sep 16, 2021
@lukicdarkoo

lukicdarkoo commented Sep 17, 2021 •

Copy link
Copy Markdown
Member Author

The tests are passing locally, the Windows error seems not to be related to the PR.

Keep in mind there are probably a lot of edge cases that are not covered. However, I will believe it will still significantly improve the user experience (see the examples in the original comment).

@lukicdarkoo
lukicdarkoo marked this pull request as ready for review September 17, 2021 07:00
@lukicdarkoo
lukicdarkoo requested review from a team and omichel September 17, 2021 07:00

@omichel omichel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although, I didn't yet fully tested, it looks good to me.
There is a series of apparently unrelated files committed here however.

mViewpoint->pick(currentMousePosition.x(), currentMousePosition.y(), mZEye),
mViewpoint->orientation()->value(),
mViewpoint->viewDistanceUnscaling(detachedHandlePosition) * 9);
mViewpoint->orientation()->value(), mViewDistanceUnscaling);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem related with this PR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It fixes the new object rotation, I can make a separate PR (it was just convenient to discover and implement small UX improvements).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, no need to make a separate PR, that's fine.

WrViewport *viewport = wr_scene_get_viewport(wr_scene_get_instance());
const float width = wr_viewport_get_width(viewport), height = wr_viewport_get_height(viewport),
maxDimension = height > width ? height : width, arrowScaleFactor = arrowScale * 2.0f / maxDimension;
maxDimension = height > width ? height : width, arrowScaleFactor = (arrowScale * 2.0f / maxDimension) * 10.0f;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to be related with this PR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also related to the object rotation

@omichel omichel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conversions are not always perfect, but it would be probably very difficult to achieve better results. In any case, it is better than nothing, even if it doesn't provide 100% backwards compatibility support.

@lukicdarkoo
lukicdarkoo merged commit 6715e5d into feature-enu-plan Sep 22, 2021
@lukicdarkoo
lukicdarkoo deleted the feature-flu-backward-compability branch September 22, 2021 06:46
@lukicdarkoo lukicdarkoo changed the title FLU: Implement backward compability mechanism FLU: Implement backward compatibility mechanism Sep 22, 2021
@omichel omichel modified the milestones: R2021c, R2022a Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Implementation of a minor feature test distribution Start the distribution test test suite Start the test suite

Development

Successfully merging this pull request may close these issues.

2 participants