Today I will illustrate how I started implementing my proof-of-concept for walking directions in a warehouse, and I will provide the source code. The goal is to show the shortest path a picker would have to walk in a warehouse to complete a picking list and calculate the distance for it. This is most relevant for big warehouses and for temporary staff that are not yet familiar with a warehouse. The business benefit is to minimize picking time, reduce labor costs, increase throughput, and gather performance metrics. I used this for my demo of M3 picking lists in Google Glass.
A* search algorithm
I used Will Thimbleby’s wonderful illustration of A* shortest path in Javascript. We can drag and drop the start and stock locations to move them around and recalculate the path, and we can draw walls. I made the map bigger, and I put a warehouse image as a background.
Implementation
Here are the steps I performed:
- Double the map’s width/height
- Un-hard-code the map width/height
- Set the cell size and calculate the canvas width/height
- Un-hard-code the cell size
- Make a warehouse image in an image editor (I used Gimp)
- Add the warehouse image as background of the map
- Hide the heat map (search scores)
- Patiently draw the map, the walls, the doors, and the stock locations
- Save the drawing by serializing the map to JavaScript source code
- Replace startMap with the saved drawing
- Thicken the path’s stroke
- Hide the grid lines
- Hide the map
- Use diagonals
- Emphasize the path length
Here is a video of the making process (watch it in full-screen, HD, and 2x speed):
Result
You can test the result for yourself on my website here.
Here is an animated GIF of the result:
Here is a video of the result for a small warehouse:
Here is a video of the result for a big warehouse:
Source code
I put the resulting HTML, JavaScript source code and images in my GitHub repository for you to download and participate.
Future work
Some of the future work includes:
- Convert the path length into meters or feet
- Project the geocoded stock location coordinates to the map’s coordinates
- Set the start and end locations as input parameters
- Automatically generate a screenshot of the path for printing alongside the picking list
- Show the shortest path for an entire picking list using a Traveling Salesman Problem (TSP) algorithm
- Improve performance for big maps
- Provide a map editor to more accurately align the warehouse image with the map
Also, a much better implementation would be to use Google Maps Indoors.
That’s it. If you liked this, please thumbs up, leave a comment in the section below, share around you, and come author the next post with me.
Hey,
Did you move forward and create shortest path for an entire picking list using TSP, that should be very useful for me, bcoz I need to implement it for warehouse with many possible ways, than make a screen for an order picker worker.
LikeLike
Hi Andrew, no I have not continued yet, but I intend to continue some day. You are the first person to express immediate interest in a real environment. Contact me on my GMail. /Thibaud
LikeLike
Awesome post. It did a great job in jump starting a project I wanted to do. I’ll be checking it on github. Please let me know if you wold like some contribution or if I should just fork it.
LikeLike