Example Projects
Two complete LumiScan VGR projects from HD Vision Systems show how the settings fit together in a real cell. Both use the settings format of LumiScan VGR 2.0, and both are checked against the settings schemas of v2.0.0 without errors.
| metal-rings | ai-syringes | |
|---|---|---|
Task |
Pick metal rings from a bin |
Pick syringes from a bin |
Detection |
3D: CAD model matched to the point cloud ( |
2D: neural network ( |
Robot |
UR5, bin as environment |
KUKA LWR, bin as environment |
Interface |
OPC UA |
OPC UA |
Runs without hardware |
Yes, with two recorded datasets |
Yes, with six recordings |
Download |
Not published |
The metal-rings project is also the project on which the integration tests of LumiScan VGR run (OPC UA and script mode), so a cycle that works with it on your PC shows that the installation works. To run it step by step, follow Try the Example Project; to test an installation with it, see Test Without a Camera or PLC.
metal-rings: CAD Matching
The rings have no texture a network could learn, but a simple, exact shape. The project therefore needs no neural network: the ring’s CAD model is matched against the point cloud, and two grip points on the ring, each repeated around its axis, give the robot grips from either side.
Requirements: LumiScan VGR 2.0.0 or later, and a HALCON licence: the 3D object matching uses HALCON (see No point cloud matching can be performed).
| File or folder | Content |
|---|---|
|
The project: camera drivers and cameras, robots, object, pipeline, the recipe |
|
The ring ( |
|
The pipeline |
|
Three robots: |
|
Ring, bin and gripper. |
|
One feature file per camera. |
|
Two recorded datasets, each an image ( |
What it shows
-
A simulated camera in the settings file. The camera
camerauses the driverdriver-sim-cameraof typeVirtual, which replays the folders belowdata/camera;layoutDATASETSmakes each subfolder a dataset. No command-line option is needed, and the camera keeps its ID. Two real cameras are configured too and switched off ("enable": false): a LumiScanX throughLumiScanPlugin.dlland an Ensenso throughEnsensoPlugin.dll. See Camera Roster."cameraDrivers": [ { "driverType": "Plugin", "id": "driver-lumiscan", "pluginPath": "LumiScanPlugin.dll" }, { "driverType": "Plugin", "id": "driver-ensenso", "pluginPath": "EnsensoPlugin.dll" }, { "driverType": "Virtual", "id": "driver-sim-camera", "path": "data/camera", "layout": "DATASETS" } ], "cameras": [ { "cameraId": "camera", "serial": "LX20220109", "driverId": "driver-sim-camera", "enable": true, "featureFiles": [ "cameras/features/camera.device.txt" ] }, ... ] -
Settings in several files. The robots, the object and the pipeline are kept in files of their own and taken into
settings.jsonwith a$refto the file, for example{ "$ref": "robots/robot.json#/robot" }. Insideobjects/ring.json, a path template (templates.t_path) is used by both grip points through$ref. See JSON Preprocessing. -
3D object matching. The 2D step
SET_ROI_PIPELINEpasses the ROI of the pipeline on, anddetection3dof typeOBJECT_MATCHINGfinds the ring in the point cloud:"detection3d": { "type": "OBJECT_MATCHING", "cadPath": "meshes/ring.stl", "roiPercentage": 1.0, "trainingParameters": { "featAngleResolution": 15 }, "detectionParameters": { "relativeSamplingDistance": 0.04, "keyPointFraction": 0.2, "minScore": 0.13 } } -
Symmetric grip points. A ring looks the same after any rotation about its axis. Each grip point is therefore repeated every 22.5° with the pose operation
SYMMETRY_ROTATION, so the robot gets a ring of candidates on each side and takes the best one it can reach without collision. See Pose Operations. -
Relative waypoints. The path approaches from above and behind the grip and leaves the same way (
WP_RELATIVEwaypoints of the robotrobot). See Relative Waypoints. -
Collision check against the bin. The pipeline checks the paths against the robot
env, whose URDF holds the bin (collisionRobotFilter), and against the point cloud (collisionCloud). -
A recipe.
pick-ringselects the cameracamera, the pipelinematch-ringand the robotrobotand runsCAPTURE_IMAGE,COMPUTE_2D,COMPUTE_3DandGET_BEST_RESULT. An OPC UA client runs it withRunRecipe. See Recipe Settings.
ai-syringes: Neural Network and Line Fit
|
This project is not published, because it contains a trained neural network. The excerpts below show how its settings are built. |
Syringes lie in a bin in every orientation, and they overlap. A neural network finds each syringe in the image as an oriented box; the points of the point cloud inside that box give the syringe’s position and long axis in 3D. The robot grips it from above.
What it shows
-
A neural network in the 2D detection. The network
detection_obbav_4(typeORTM) is declared once and used by the object’s 2D steps. The steps set the ROI, run the network with a detection threshold of 0.4, and halve each box in both directions about a fixed point in the box (SCALE), so that only part of the syringe is used for 3D. See Network Settings and Object Settings."networks": [ { "id": "detection_obbav_4", "networkPath": "networks/ORTM/network_description.json" } ], ... "detection2d": { "steps": [ { "type": "SET_ROI", "imageROI": { "x": 0, "y": 0, "width": 1280, "height": 960 } }, { "type": "SET_NETWORK", "networkId": "detection_obbav_4", "detectionThreshold": 0.4, "local": true }, { "type": "SCALE", "scale": [0.5, 0.5], "fixedPoint": [0, 0.5] } ] }, "detection3d": { "type": "LINE_FIT_LONG_AXIS", "roiPercentage": 0.75 } -
Three kinds of camera driver. A LumiScanX through
LumiScanPlugin.dll; an Ensenso throughEnsensoPlugin.dlland a 2D camera through the Teledyne Spinnaker GenTL producer (driverTypeGenICam,gentlPath), both switched off; and aVirtualdriver for the recordings. The recordings are replayed with--simulate-camera --simulate-camera-path data. -
Camera parameters.
cameraParameters[]switches on the auto-exposure of the LumiScanX, measured in a polygon of the image, and gives the lens intrinsics (fx,fy,cx,cy) of the 2D camera, which cannot report them itself. See Auto-exposure."cameraParameters": [ { "cameraId": "camera-lumiscan", "autoExposure": { "enable": true, "roi": [[160, 120], [1120, 120], [1120, 840], [160, 840]], "statistic": "MEDIAN", "targetIntensity": 80, "tolerance": 10, "acceptedIntensityMin": 20, "acceptedIntensityMax": 230, "minExposureTime_us": 500, "maxExposureTime_us": 200000, "retryBudget_ms": 800 } }, ... ] -
Robot templates with
$parents. The settings file keeps the common part of a robot (pose format, URDF, frames, waypoints) undertemplates.t_robot; the robotsrobot1androbot_freetake it with$parentsand add only their hand-eye calibration (cameraToRobot). See$parents."robots": [ { "id": "robot1", "$parents": ["/templates/t_robot"], "cameraToRobot": { "camera-lumiscan": [[1, 0, 0, 0.0], [0, -1, 0, 0.5], [0, 0, -1, 0.61], [0, 0, 0, 1.0]], ... } }, ... ] -
A recipe.
pick-needleselects the cameracamera-lumiscan, the pipelinepipeline_4and the robotrobot1and runs the default cycle.
Testing with the Example Projects
-
Check a settings file. Open
settings.jsonof the example in an editor that checks JSON schemas, such as Visual Studio Code: the"$schema"key points to the schemas of the installed LumiScan VGR (see$schemaand Checking the File in an Editor). The example shows no errors and no warnings. Compare your own project with it when the editor marks a key you do not understand. -
Check an installation. Run the recipe
pick-ringof metal-rings in manual mode, from an OPC UA client or from a script, see Test Without a Camera or PLC. A cycle that returnsSUCCESSshows that LumiScan VGR, its dependencies and the HALCON licence work on this PC. -
Narrow down a problem. If your own project fails and metal-rings works on the same PC, the cause is in your project (settings, files, camera), not in the installation.