Although it’s still a work-in-progress, I figured this would be a good time to post the work I’ve been doing on creating a new moving map within the Command Center. It’s still pretty basic at this point, but definitely fun to play with.
Command Center: Moving Map
How to use it now
Follow this link to access an updated version of the Command Center with the new Moving Map section:
Just scroll down to the Moving Map section and click the
Toggle Map button to get started.
IMPORTANT: If you do not see Misty moving in the map when driving, you’ll need to refresh your browser (maybe more than once). This happens because the map initialized before Misty’s websocket connection was made…I should have a fix for this in a future release.
What is does
The moving map pulls in real-time sensor data from Misty using the REST API and displays it on a map in the Command Center. This currently includes data from the Time of Flight (ToF) and Bump sensors, the IMU, Actuators (just head yaw for now), and drive encoders.
With this data, you can watch Misty build an idea of her surroundings while you drive her around your space. With enough driving time and exploration, you can build a decent map of the space around Misty. You can then save that map data and load it in (coming soon) for later use when you want to explore the same area.
- Real-time movement and rotation following of Misty on map
- Adds ToF data to map as soft black markers (valid data only)
- Adds bump sensors to map as hard blue markers
- Adds initial location marker (to allow you to find your way back home)
- Decent memory management
- Save your map to JSON format
- Reset your map and start with a clean canvas
This moving map was built on top of the Phaser desktop and mobile HTML5 game framework that uses Canvas and WebGL to power browser-based games. Specifically I use Phaser version 2 here since I’m more familiar with that version. For more info on Phaser, visit https://phaser.io/.
Future roadmap (near-term)
Update the ToF sensor dots in the map to self-update if better or contradictory data comes in. This could also help detect dynamically moving objects (e.g. people, pets, doors).
Build the “Load Map” function to bring in previously saved locations. This is great for moving your robot from, for example, the office to home and using a pre-saved map to move around in. This is part of the reason I built in the “parking space” feature.
With both new and saved maps, be able to click a point on the map and instruct Misty to go there via path finding (easy now that the map is built on top of a gaming platform). Multiple could also be added to make waypoints enabling a quick and dirty way to create a smart wander skill. Waypoints would also save with the “Save Map” feature to be reusable.
Have fun and let me know what you think! I’d love to hear about your experience with it.