Rack localization and stock inspection
UAT 459 UAS, Internet of Things and Smart Warehouse Systems
Lesson
By the end of this module you will be able to
- Define the aisle coordinate frame and convert a label's image position plus the drone position into a storage location code
- Compute the chance of assigning a read to the wrong slot from drone position error, and explain anchoring on beam location labels
- Design stock inspection with range sensors and images, covering empty slots, overhanging pallets and damage
- Evaluate inspection results with precision and recall
- Compare indoor positioning technologies with the slot size and work out which source can name the slot, the bay or only the aisle
Why this matters
In module 2 the drone read that pallet SSCC 088501234567890121 is in the image. But the WMS does not ask “which pallets did you see?” It asks “which pallet is in location A03-27-5-2?” Assigning a read just one slot off produces two wrong counts at once: one location appears to have lost stock, another appears to have extra, and staff must ride a lift truck to check both for nothing.
Besides reading labels, a drone that passes every slot every night also sees what people on the floor cannot, such as pallets overhanging the beam, crushed cartons, or beams hit by forklifts. This module covers two topics from the course description: rack localization and stock inspection.
The aisle and rack coordinate frame
Before converting anything, agree on the coordinate frame. The case warehouse uses one frame per aisle:
- x axis along the aisle, starting at 0 at the first upright on the front cross-aisle side and reaching 78.4 m at the far end
- y axis across the aisle, positive to the left when facing into the aisle
- z axis upwards from the floor
Bay position counted from the front covers from to with m, so . The left side uses odd bay numbers and the right side even numbers . The first half of a bay is slot 1 and the second half slot 2. The level comes from the beam heights 0, 1.8, 3.6, 5.4, 7.2 and 9.0 m: a label belongs to the highest beam that is still below it.
Watch the image direction. When the camera looks to the left of the aisle (at the odd-numbered rack face), the right side of the image is the direction, the way the drone is flying. A camera looking right sees the opposite: the right side of its image is . Picture yourself walking down the aisle and turning left: your right hand points forward along the aisle. Turn right and your right hand points back the way you came. Getting this sign wrong shifts every label on one side into the wrong slot systematically.
From label position in the image to a location code
The camera follows the pinhole model described by Szeliski (2022). An object at distance that appears in image column lies from the camera axis, where is the centre column and the focal length in pixels, the focal length divided by the pixel size. The module 2 camera has a 16 mm lens and 1.6 µm pixels, so pixels. The distance comes from a range sensor pointing the same way as the camera. The vertical direction works the same way, except that image rows count from top to bottom, so the sign flips.
Example 1 Turning three label detections into location codes
The camera is in portrait orientation, 3,000 pixels wide and 4,000 tall, so the image centre is (1500, 2000). In aisle A03 the drone detects three labels (drone positions and pixels are assumed).
import math
# map a label seen in the image to a storage location code (all values assumed)
BAY, SLOT = 2.8, 1.4 # m, bay width and slot width along the aisle
BEAMS = [0.0, 1.8, 3.6, 5.4, 7.2, 9.0] # m, height of levels 1 to 6
F_PX, CX, CY = 10000, 1500, 2000 # focal length in pixels (16 mm / 1.6 um), image centre
def locate(aisle, side, x_drone, z_drone, u, v, d):
"""side 'L': camera looks left, odd bays; 'R': camera looks right, even bays."""
sign = 1 if side == "L" else -1 # looking left, image right points forward along the aisle
x = x_drone + sign * (u - CX) * d / F_PX
z = z_drone - (v - CY) * d / F_PX # image rows grow downwards
k = int(x // BAY) + 1 # bay position along the aisle, 1..28
bay = 2 * k - 1 if side == "L" else 2 * k
slot = 1 if (x - (k - 1) * BAY) < SLOT else 2
level = max(i + 1 for i, h in enumerate(BEAMS) if h <= z)
edge = min(x % SLOT, SLOT - x % SLOT) # distance to the nearest slot boundary
return f"A{aisle:02d}-{bay:02d}-{level}-{slot}", x, z, edge
for det in [(3, "L", 38.10, 7.80, 2210, 1830, 1.36),
(3, "R", 12.40, 4.30, 2350, 2400, 1.31),
(3, "L", 22.45, 4.10, 1480, 2100, 1.35)]:
code, x, z, edge = locate(*det)
print(f"{code} x {x:.3f} m z {z:.3f} m {edge:.2f} m from a slot boundary")
A03-27-5-2 x 38.197 m z 7.823 m 0.40 m from a slot boundary
A03-10-3-1 x 12.289 m z 4.248 m 0.31 m from a slot boundary
A03-17-3-1 x 22.447 m z 4.087 m 0.05 m from a slot boundary
In the first detection the label is 710 pixels right of centre at 1.36 m, which is m forward, giving m. That is bay position 14 on the left, bay 27, slot 2, as in Figure 1. The second detection comes from the right-hand camera, so a label right of centre lies behind the drone. The third is worrying: the label is only 0.05 m from a slot boundary, so a small drone position error could move it into bay 15, slot 2.
Position error and anchoring on beam labels
The drone’s comes from an indoor positioning system, such as UWB or a camera combined with inertial sensors, which has errors (how these systems work and how their errors are measured is taught in UAT 458). If the error is normally distributed with standard deviation and the label is from the nearest slot boundary, the chance that the computed position crosses that boundary is , where is the standard normal cumulative distribution function.
Example 2 The chance of a wrong slot
Compare the boundary distances 0.05, 0.31 and 0.40 m of the three labels in Example 1 under three positioning qualities, then see what happens when the label position is measured relative to the beam location label in the same image, with about 3 pixels of measurement noise (assumed values).
# probability that position error pushes a label across the nearest slot boundary
def p_wrong(margin, sigma):
return 0.5 * math.erfc(margin / (sigma * math.sqrt(2))) # one-sided normal tail
print("margin sigma=0.05 sigma=0.10 sigma=0.20 m")
for m in (0.05, 0.31, 0.40):
print(f"{m:.2f} m " + " ".join(f"{p_wrong(m, s) * 100:9.3f}%" for s in (0.05, 0.10, 0.20)))
# re-anchor on the beam location label seen in the same image (assumed 3 px measurement noise)
sigma_rel = 3 * 1.35 / 10000 # m
p = p_wrong(0.05, sigma_rel)
print(f"relative sigma {sigma_rel * 1000:.1f} mm, P(wrong) at 0.05 m = {'below 1e-9' if p < 1e-9 else p}")
margin sigma=0.05 sigma=0.10 sigma=0.20 m
0.05 m 15.866% 30.854% 40.129%
0.31 m 0.000% 0.097% 6.057%
0.40 m 0.000% 0.003% 2.275%
relative sigma 0.4 mm, P(wrong) at 0.05 m = below 1e-9
A label 0.05 m from a boundary lands in the wrong slot 16 to 40% of the time even with positioning as good as m. A label 0.31 m away is safe when m but wrong 6% of the time when m. The most effective fix is not a more expensive positioning system but measuring the pallet label relative to the beam location label in the same image. The error drops below 1 mm because the drone position is no longer involved.
Most warehouses already fix a location label, a barcode or 2D code, on the beam of every slot so staff can scan it to confirm put-away. These labels are reference points that cost nothing extra. The WareVision work of Kalinov et al. (2020) used scanned barcodes as landmarks to improve drone localization in a real warehouse. If references that are easier to detect than barcodes are needed, ArUco markers can be added; Garrido-Jurado et al. (2014) designed them to be detected reliably even when partly occluded.
Locating RFID tags
RFID tags are harder to place, because module 2 showed that the drone reads beyond the aisle width. Three practical approaches work at application level. First, use a directional antenna aimed at one rack face and reduce power until only the slot in front reads. Second, log received signal strength along the flight and place the tag near where the signal was strongest. Third, use RFID to confirm “this container is in this area” and let the camera or beam labels give the slot. When the evidence is not enough, record only the aisle or bay and send a task to a person rather than guessing the slot.
Stock inspection
While reading labels, the drone collects other valuable data. Stock inspection in this course means checking what is in each slot against what should be there:
- Is there a pallet? A slot the WMS says is full is empty, or the reverse
- Is it the right pallet? The SSCC read matches what the WMS recorded (reconciled in module 5)
- Is it stored correctly? Pallets overhanging the beam, leaning, or straddling two slots can fall onto forklifts or people
- Packaging condition: crushed cartons, torn stretch film, leaks
- Rack condition: dented uprights or beams, beams unseated from their connectors
The last point matters for safety. The UK Health and Safety Executive’s guide HSG76 (Health and Safety Executive, 2007) recommends regular visual inspections of racking, for example weekly based on risk assessment, and expert inspection by a technically competent person at intervals of no more than 12 months. It also notes that the upper levels of high-bay installations cannot be seen from the ground. Drone images can therefore support the weekly visual inspection, but they do not replace the expert inspection, and any damage found must be reported at once to the person responsible for racking safety.
Checking whether a slot holds a pallet is easy with a range sensor pointing the same way as the camera. If is the distance to the beam front, the range to the first surface tells the slot’s state, as Figure 3 shows.
The classifier is measured with two values from the confusion matrix for the class of interest, such as “empty”. Precision says what share of the slots the system calls empty really are empty, and recall says what share of the truly empty slots the system finds (scikit-learn developers, n.d.). Here means correctly assigned to the class, assigned to it wrongly, and belonging to it but missed.
Example 3 Classifying slots from range and measuring precision and recall
Test 200 slots of known state: 162 normally occupied, 8 overhanging and 30 empty. Range noise is 3 cm, and hard cases are added on purpose: low pallets picked almost empty so the beam passes over them, stray cartons left at the front of empty slots, and a pallet that sticks out only slightly (simulated data with a fixed seed).
import numpy as np
# occupied, empty or overhanging? classify slots from the range to the first surface (simulated, seed fixed)
rng = np.random.default_rng(475)
D_FACE, DEPTH = 1.35, 1.10 # m, distance to the beam front, rack depth
truth = np.array(["occupied"] * 162 + ["overhang"] * 8 + ["empty"] * 30)
front = {"occupied": D_FACE + 0.02, "overhang": D_FACE - 0.18, "empty": D_FACE + DEPTH + 0.10}
r = np.array([front[t] for t in truth]) + rng.normal(0, 0.03, truth.size)
r[[3, 77, 140]] = D_FACE + DEPTH # low part-pallets: the beam passes above them
r[[171, 185]] = D_FACE + 0.30 # empty slots with a stray carton at the front
r[165] = D_FACE - 0.06 # a pallet leaning out only slightly
def classify(x):
if x > D_FACE + 0.50:
return "empty"
return "overhang" if x < D_FACE - 0.10 else "occupied"
pred = np.array([classify(x) for x in r])
for c in ("empty", "overhang"):
tp = np.sum((pred == c) & (truth == c)); fp = np.sum((pred == c) & (truth != c))
fn = np.sum((pred != c) & (truth == c))
print(f"{c:<9} TP {tp:3d} FP {fp:2d} FN {fn:2d} precision {tp / (tp + fp):.3f} recall {tp / (tp + fn):.3f}")
empty TP 28 FP 3 FN 2 precision 0.903 recall 0.933
overhang TP 7 FP 0 FN 1 precision 1.000 recall 0.875
The three slots wrongly called empty are the low pallets the beam passes over, and the two empty slots missed are those with a stray carton at the front. The pallet sticking out only 6 cm is not caught because the threshold is 10 cm. A single-point range sensor is not enough: measure at several heights or confirm with images, and never adjust the WMS straight from an “empty” result; send it to a person as a recheck task.
Whether to favour precision or recall depends on the cost of each error. For overhanging pallets, a safety issue, a miss (FN) costs far more than a false alarm (FP), so set the threshold for high recall first and let a person confirm from the image. Images of crushed cartons or dented beams can be handled with the image classifiers taught in UAT 456, evaluated with precision and recall in the same way.
Choosing a positioning technology: match the error to the slot
The drone must know where it is before a label can be turned into a slot. Indoor positioning falls into three families.
- Radio infrastructure fixed in the building. Wi-Fi positioning from signal strength is around 3 to 30 m, far too coarse for racks (Alarifi et al., 2016). Ultra-wideband (UWB) times short pulses and studies report centimetre-level errors, but metal racking creates multipath and blocked paths, and the same review lists interference from metallic materials as a weakness. Bluetooth LE direction finding, by angle of arrival or departure, is presented by the Bluetooth SIG as able to reach centimetre-level accuracy (Bluetooth SIG, n.d.), while ordinary signal-strength BLE gives proximity only.
- Sensing on the drone, nothing installed. A camera with inertial sensors, or LiDAR SLAM; visual navigation is one of the advances that made indoor warehouse drones practical (Wawrla et al., 2019), but its error grows along the aisle (the error models are in UAT 458).
- Landmarks the warehouse already has. Beam location labels and markers give an absolute position wherever one is seen, as above.
How accurate is enough? Let labels lie evenly across a slot of width and let the position error be normal with standard deviation . The chance that the measured position leaves the slot, averaged over the label positions, is
Example 4 Which source can name the slot?
The slot is m wide and the bay 2.8 m. Six sources are compared with the values below, all assumed for the example; the last is the relative measurement of Example 2. A bisection then finds the that keeps wrong slots at 1%.
import math
# average chance of a wrong slot or bay when labels lie evenly along it and the position error is normal (sigma values assumed)
def phi(z):
return 0.5 * (1 + math.erf(z / math.sqrt(2)))
def wrong(pitch, sigma, steps=2000):
ok = 0.0
for i in range(steps):
u = (i + 0.5) / steps * pitch # label position inside the slot or bay
ok += phi((pitch - u) / sigma) - phi(-u / sigma) # chance the measured position stays inside it
return 1 - ok / steps
sources = [("Wi-Fi signal strength", 3.0), ("BLE signal strength", 2.0), ("BLE direction finding", 0.30),
("UWB in metal racking", 0.10), ("camera+IMU drift, 1% of 78.4 m", 0.784), ("beam label, same image", 0.0004)]
print(f"{'source':32s}{'sigma m':>8s}{'wrong slot':>12s}{'wrong bay':>11s}")
for name, s in sources:
print(f"{name:32s}{s:8.4f}{wrong(1.4, s):12.1%}{wrong(2.8, s):11.1%}")
lo, hi = 0.0005, 1.0
for _ in range(40): # bisection: sigma at which 1% of slots are wrong
mid = (lo + hi) / 2
lo, hi = (mid, hi) if wrong(1.4, mid) < 0.01 else (lo, mid)
print(f"1% wrong slots needs sigma <= {lo * 100:.1f} cm (slot 1.4 m wide)")
source sigma m wrong slot wrong bay
Wi-Fi signal strength 3.0000 81.7% 65.3%
BLE signal strength 2.0000 73.2% 51.8%
BLE direction finding 0.3000 17.1% 8.5%
UWB in metal racking 0.1000 5.7% 2.8%
camera+IMU drift, 1% of 78.4 m 0.7840 43.0% 22.3%
beam label, same image 0.0004 0.0% 0.0%
1% wrong slots needs sigma <= 1.8 cm (slot 1.4 m wide)
One per cent wrong slots needs a of about 1.8 cm, several times better than UWB in racking (5.7% wrong at 10 cm) and far beyond signal-strength radio. Radio positioning gets the aisle and, at best, the bay (UWB: 2.8% wrong bays). Camera and inertial drift reaches 43% wrong slots and 22% wrong bays at the far end of the aisle. Only the beam label measured in the same image names the slot. The working design is therefore hybrid: a radio or visual-inertial system gives the coarse position and keeps the drone on its route, and beam labels fix the slot. Measure the real of the chosen system with the methods of UAT 458 before relying on any of these values.
Module lab
Lab: localization and slot inspection on a mock rack
- Build a mock rack with at least three bays and two levels. Fix location labels on the beams and labels on boxes standing in for pallets, and measure the true and of every label with a tape measure
- Take images from a cart at known positions with the camera facing both left and right. Convert them to location codes with the
locatefunction from Example 1 and compare with reality, checking that the sign for each side is correct - Add random position errors of 0.05, 0.10 and 0.20 m to the cart position, compare the wrong-slot rate with Example 2, then change the code to measure positions relative to the beam label in the same image
- Measure the range to the first surface of every slot, with empty slots, overhanging boxes and low boxes arranged in advance, and compute precision and recall as in Example 3
Common mistakes
Watch out
- Using the same sign for cameras on both sides, so labels on one side land in the wrong slot systematically
- Relying on the drone position alone when the beam location label is in the same image and far more accurate
- Assigning an RFID tag to a slot from a single read, when it may be in a neighbouring bay or across the aisle
- Adjusting the WMS straight from an “empty” result without a person confirming
- Treating drone images as a replacement for expert rack inspection, when they only support visual checks
- Buying a positioning system for slot-level accuracy that only reaches the bay, instead of anchoring on beam labels
Summary
- Define a frame per aisle, find the bay with and the level from beam heights, and remember that image direction flips between left and right cameras
- A label’s offset is ; the chance of a wrong slot is , which is high near boundaries; measuring relative to beam labels removes most of the error
- Stock inspection covers presence, the right pallet, storage, packaging and rack condition; drone images support visual rack inspection under HSG76
- Evaluate classifiers with precision and recall, and set thresholds by the cost of each kind of error
- Match the positioning error to the slot: about 1.8 cm is needed for 1% wrong slots in a 1.4 m slot, so radio or camera-plus-inertial positioning gives the aisle or bay and beam labels fix the slot
Check your understanding
- A left-facing camera, the drone at m, the label in column 1900 at 1.40 m, with and . Which bay and slot is it in?
- A label is 0.15 m from a slot boundary and the positioning system has m. What is the chance of a wrong slot?
- An empty-slot detector gives , , . What are precision and recall?
- Why is measuring the pallet label relative to the beam location label in the same image more accurate than using the drone position?
- With m, the range sensor reads 2.40 m in one slot and 1.22 m in another. How should each be classified under the rule in Figure 3?
Answers
- m, added for a left-facing camera, so m. , a left-side bay numbered , and 0.456 m from the bay start, so slot 1
- , about 6.7%
- Precision , recall
- Both labels are in the same image, so their separation is measured directly in pixels with millimetre-level error, independent of the drone positioning error, which is several centimetres
- 2.40 m is more than m, so the slot is empty; 1.22 m is less than m, so the pallet overhangs
Key formulas
| Label offset from the image centre | |
| Bay position along the aisle | |
| Chance of crossing a slot boundary | |
| Precision and recall |
Key references
- Szeliski, R. (2022). Computer vision: Algorithms and applications (2nd ed.). Springer. link
- Kalinov, I., Petrovsky, A., Ilin, V., Pristanskiy, E., Kurenkov, M., Ramzhaev, V., Idrisov, I., & Tsetserukou, D. (2020). WareVision: CNN barcode detection-based UAV trajectory optimization for autonomous warehouse stocktaking. IEEE Robotics and Automation Letters, 5(4), 6647–6653. link
- Garrido-Jurado, S., Muñoz-Salinas, R., Madrid-Cuevas, F. J., & Marín-Jiménez, M. J. (2014). Automatic generation and detection of highly reliable fiducial markers under occlusion. Pattern Recognition, 47(6), 2280–2292. link
- Health and Safety Executive. (2007). Warehousing and storage: A guide to health and safety (HSG76, 2nd ed.). HSE Books. link
- scikit-learn developers. Metrics and scoring: Quantifying the quality of predictions (scikit-learn 1.9). link
- Wawrla, L., Maghazei, O., & Netland, T. (2019). Applications of drones in warehouse operations (White paper). ETH Zurich, D-MTEC, Chair of Production and Operations Management. link
- Alarifi, A., Al-Salman, A., Alsaleh, M., Alnafessah, A., Al-Hadhrami, S., Al-Ammar, M. A., & Al-Khalifa, H. S. (2016). Ultra wideband indoor positioning technologies: Analysis and recent advances. Sensors, 16(5), 707. link
- Bluetooth SIG. (n.d.). Direction finding. Bluetooth Technology Website. link
Further reading
Study the assigned knowledge units in advance, review media and take the module quiz
ระบบระบุตำแหน่งภายในอาคาร
Computer vision and the path to edge AI
SLAM และการนำทางในพื้นที่ไม่มี GNSS
In class / field
Lab or field practice from worksheets with a safety checklist
Learning evidence: Checked worksheets and quiz results