As a software engineer working in open-source, research, or startup domains, you want stuff that’s quick to implement and gets the job done well. But the key is still fast — either to meet deadlines or just to really focus on the actual contribution of your project and shove aside secondary considerations.

WiFiSlam, when it was open-source, used to be a pretty good choice for getting a Wi-Fi localizer built in your app. However, when it was bought by Apple, it become closed source and the site was shut down. It left a niche in the open-source community for a good solution to Wi-Fi localization. Here is an open-source solution you can use to get Wi-Fi Localization in your app in 5 minutes that helps fill then niche that WiFiSlam used to fill. It’s somewhat even easier to use!

The robotic localization community prioritizes building localizers that give you as accurate meter (or even inch) precision as possible. Indeed, that is where the state of the art lies. However, that level of precision is overkill for a great many applications since most of the time you don’t need that level of detail. There are also serious privacy concerns of users not wanting to be tracked that finely.

Often, you just want to be able to localize in a particular room or locality of interest inside a building. This is often easier to do, and possible with only WiFi signal strengths alone (provided you have enough decently placed access points) with a simple and clean fingerprinting algorithm.

Presented here is a Wi-Fi localizer optimized for room-level identification that does not require the user to upload a building map (since those are sometimes annoying to track down). All the user of your application has to do is spend a couple minutes collecting data in each room as an initial training procedure, hit a build model button, and Wi-Fi Localization starts working. Even if multiple applications are running on the device that use our underlying API, they will all just work based on the framework. No need to retrain for every single app that you build that uses Wi-Fi localization!

As an Android developer, integrating Wi-Fi Localization into your app is incredibly easy. All you have to do is extend a base LocateMeActivity class and call a locateMe() function of that class whenever you want to localize:

public void locateMe()

You can also specify a callback for what happens when indoor location is received from your locate me call (similar to Android’s outdoor localization capabilities):

	@Override
	public void onLocationChanged(String location) {

		//display location
		Toast t = Toast.makeText(this.getApplicationContext(), "Location: " + location,Toast.LENGTH_SHORT);
		t.setGravity(Gravity.CENTER, 0, 0);
		t.show();
		Log.d("LOCATION", "LOCATION: " + location);
	}

The user of your application uses the Android menu attached to the LocateMeActivity base class to calibrate the Wi-Fi localizer for the particular building or locality they want their localizer to work for. This includes collecting Wi-Fi access point data at different tagged locations in the environment and building models using Machine Learning. Here is the main settings screen:

Screenshot_2014-02-13-12-05-58

First, the user collects Wi-Fi data at different locations in the environment, specifying a location tag for different orientations. The user can also specify the orientation they are facing in (in case they want orientation to be taken into account in the model) and number of samples to take.

Screenshot_2014-02-13-19-02-01-2

Then the user can decide which access points to use in the model. The user can also use Machine Learning based feature selection to choose the access points automatically.

Screenshot_2014-02-13-18-32-30

Once the localizer is trained, your use of the locateMe() function will just work. It is really easy to incorporate Wi-Fi localization into your Android apps. Here is the use of the Wi-Fi localizer applied to the accessibility domain: http://www.youtube.com/watch?v=CoYStsCYuV8 (credit to the puppy programmers who did a fair bit of the science).

The user only needs to train once — for all applications that use the underlying API running on the device. Barring major chances in Wi-Fi distribution, things should just work and you can always retrain if there’s some performance drop off.

Best of all, the library is and will always be completely open-source and free. This preserves the capability of the software to have maximum impact in a field increasingly dominated by NDAs, corporate interests, stealth-mode projects, and top secret labs, etc. Ultimately, if Robotics is to have maximum impact in the world to do good, it must also embrace open-source.

Code available at: https://github.com/prateekt/WifiLocLib

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s