How to determine if a plane is inclined or not

Software Version: Mech-Vision (1.7.2), Mech-Viz (1.7.2), Mech-Eye Viewer (2.1.0)
Camera Model and Firmware Version: (LSR L V4 version)
Robot Model: (ABB IRB-6700-205)
Photo Method: (ETH)

Problem Description:
I want to determine if the foam tray is inclined or not using point cloud data, and if it exceeds the set angle, an alarm should be triggered.

Methods attempted:
Attempted to extract the edge of the foam tray and use Step “Calc Poses and Dimensions from Planar Point Clouds”. Then fixed in the Z direction and convert the pose to the robot coordinate system for comparison. Found that regardless of whether it is inclined or not, it will be considered to exceed the set value.

The result of Step “Calc Poses and Dimensions from Planar Point Clouds” is in the camera coordinate system.

  1. You need to perform a pose transformation to transform the pose to the robot coordinate system, and then observe whether a flip of the pose Z-axis direction is needed.

  2. Regarding threshold setting, you can test and choose a reasonable threshold range.

  3. When calculating the planar point cloud pose using either edge point cloud or all the points cloud of the foam tray, there will be some deviation in the results between these two methods. You can test and choose a more accurate method.