asdf
asdf
asdf
- Aligning the origin coordinates.
Motivation: Prepared CAD files come with origins that are placed in inconvenient positions, and often outside the actual component (as they have probably been exported in batch as parts of a bigger assembly). In order to properly visualize meshes and picking frames during detection, it is preferred that the origins are adjusted to match the main picking point and that the meshes used for vizualization have the same origin as the CAD files or meshes used for localization.
A CAD software is needed here, Autocad, Freecad, or similar, I am for example using Auodesk Inventor. In Autodesk Inventor, create a new Assembly.
Select the new assembly and place a component into it. This will enable us to align the component to the coordinate frame of the assembly and export the CAD with a newly defined origin.
For example, let's prepare this "silver_gun".
Selecting the assembly origin, we can visualize the origin planes of the assembly. We can do the sme things for the component we want to prepare, in this case "silver_gun".
Let's say that we want to prepare the new origin coordinates to match the ones drawn on the figure below. The work now consists of aligning the frame of the assembly (shown in the bottom left of the figure) to match the drawn frame.
We can use tools such as "Constrain" to align different planes.
For example, if we would like the Z coordinate to point "out" from the selected plane, we can use the flush constrain tool to align the selected plane and the "XY plane" of the assembly.
The next figure shows that the target plane and XY plane are flushed, and that the Z coordinate is pointing outwards from the target plane as intended (lower left corner).
Switching to the top view, we see that we first have to align the roration arounf the Z axis.
To do that, we cn again use the constrain tool to fluh the selected plane below with the YZ plane of the assembly.
Switching again to the top view, we see that the angles are aligned as intended.
The XY assembly plane is now locked to the first target plane, ensuring the good placement of the Z coordinate, and the YZ assembly plane is locked to the second target plane, ensuring a good angle of the Y and X coordinates. However, now we would like to move the origin of only the X and Y to the desired position, and to do so, we leave the XY flush locked, and supress the second flush with the YZ plane. This will allow us to move the component with its current oprientation in the XY plane.
Like so, now we have the desired origin like we have drawn it above.
Export the assembly now in a .stp CAD format for localization, and a .stl MESH file for visualization.
Start the Photoneo Localization software and import the prepared CAD file to verify the good position of the origin coordinate frame. The goal is to not manipulate the origin in the localization software, so all the coordinates and angles should be left as 0.
Next, connect the Photoneo scanner and open the Phoxi Control software. Position the scanner so that the components are visible. Note that the scanning volume of the photoneo model S is quite small. Trigger a scan.
The Phoxi control software should now visualize the point cloud. Make sure that the components to be localized are visible. If so, save the current scan, either in .ply or .praw. (.praw might hold more information, and it can be later converted to other formats if necessary, so .praw might be favored).
Open the localization software and select the prepared CAD file. After inspecting that the origin is correct, go next while leaving the positions and orientations at 0. The software now allows a "live" scanner view, or a saved scan in order to test the localization and prepare a localization file (.plcf). Since we have saved a scan where the parts are visible, select "file" in the testing window and find the saved .praw file. The point cloud should now be loaded.
Select a number od instances you would like to test for and start the localization. The localized items should now be highlightd and the overlap confidences displayed.
Tweak the setting so see if the confidences can be increased and save the settings. This can be done per prepared item and later used as a parameter. TODO: Expland this and show how to.