Current DoubleMap web app for tracking shuttles (https://uc.doublemap.com/map/)
DoubleMap provides GPS shuttle tracking service for 150+ universities, corporations, hospitals and airports. As students at the University of Cincinnati and regular users of the shuttle system, we recognized that it would be nice to know when the next shuttle will arrive without needing to pull out your phone or laptop. Our skill voice-enables shuttle tracking and makes getting the ETA for shuttles at the closest stop much easier.
What it does
Shuttle Tracker allows a user to ask Alexa for the next shuttle’s ETA at the stop closest to a given address. If the stop has multiple stops then the user will be prompted to say their preferred route, then Shuttle Tracker will give the user the ETA of the next shuttle on this route.
How we built it
In order to build this skill, we partnered with DoubleMap to get access to their private APIs that expose sites, routes, stops, and ETAs from all of their shuttle services across the United States and Canada. We utilized Google’s Location API to take the user’s spoken address and convert it to longitude and latitude coordinates. We use this location to find the closest site and the closest stop associated with that site. We are hosting the skill using the Lambda service, and the address of the user is saved using the DynamoDB service so that the user does not have to repeat their address each time.
Challenges we ran into
Building this skill required two main tasks: (1) build voice interface and intent handlers for Alexa and (2) collect the shuttle data from the DoubleMap service.
As part of the first task, we ran into trouble getting the user’s location with the new Device Address API. In particular, collecting the necessary permission from the user was not well supported with the Alexa Skills Kit SDK for Node.js. Also, if the user has not already set up their address in the Alexa companion app, then they would not be able to use our skill using their voice only. To get around this, we needed to build our own way of getting the user’s location. Our skill allows users to simply say their address. We use Google’s Location API to process this, because it is extremely lenient and does a great job of filling in the blanks.
Both of us have very limited experience using Node.JS. So, we had to learn a lot about asynchronous programming and promises to be able to handle our API calls to DoubleMap’s service. Developing in Lambda was very different and challenging at first. We started by using only the Lambda in-line editor and
Test features, but we quickly outgrew those. In the end, we ended up with a setup that allowed us to test locally with Mocha/Chai and deploy directly from Sublime using custom build settings leveraging AWS-CLI.
Accomplishments that we're proud of
We faced a lot of challenges, and surmounting those challenges to get the skill to finally work feels great! We are excited that our skill utilizes a fully voice-only interface that allows the user to conveniently track shuttles. We are also excited that our skill has an incredibly wide reach since many of the 150+ organizations service each service 10’s of thousands of users.
What we learned
Through the process we learned how to use the Alexa Skills Kit, Lambda, DynamoDB, DoubleMap’s API, Google’s API, Node.JS, Mocha, and Chai to build an Alexa skill!
What's next for Shuttle Tracker
Currently, Shuttle Tracker simply gives you the ETA for the next shuttle to come to your closest stop. In future updates of Shuttle Tracker, we’d like to support more advanced trip planning. We’d love to see Alexa support push notifications, so we could verbally update the user when the shuttle that they are tracking is getting closer.