Posts

Build custom arm model for VR

Image
It's time for some fun. An awesome use case in how to use quaternions to achieve portable results. If you aren't familiar with quaternions, please feel free to review them in my previous article. If that's confusing, it's no problem, you can use the code from below, but it might be a bit tough to understand without the prerequisite math knowledge. So let's write the inspiration: Notice that controller? One here too! In the world of mobile VR, the two main systems, Google's Daydream and Oculus' mobile GearVR, are both now shipping with a controller that is used much like a laser pointer in the virtual world. While both Google and Oculus provide an SDK for working with the controller, much of what it takes to work with it is missing in any form of documentation. Thus most apps rely upon other people's controller implementation and create a project wide dependency (Unity, Unreal) just for one very small aspect of the application. Also, my project...

Quaternions

Image
As I'm starting to put together the drone VR project, I've noticed that I've been remiss in explaining a facet of programming we're going to be depending upon; that while well understood among mathematicians, is viewed as too complex for most programmers. One of the many tasks that we often face in VR or game development is a need to know orientation. That is how to rotate objects so they appear oriented in a manner that we have planned. Now the easiest way to handle rotations is to use Euler angles. That is to say imagine a 3d cartesian coordinate system centered at the center of the 3d object we want to rotate. The straight forward way of doing it, is to say rotate it around the each axis a certain number of degrees in 3 separate steps. The above shows how a Gimbal works. They have the properties of being extremely easy to understand while also being susceptible to a very problematic detail. If one dimension rotates too close to another, then both dimension r...

Build executables for any ARM device

Android Studio has given developers a new IDE to create apps that work in Android. Now with the recent addition of CMake integration, it has also given us Embedded Developers something a bit more. We now have an IDE that can target not only Android but any device that runs linux on a supported ABI. Shock, horror, no, it's good to react with eagerness and let our inner hacker out. When building apps for Raspberry Pi, Snapdragon's family of boards, or any embedded device running linux, instead of creating a cross compiler; we can use the one that Google provided. In this blog post, I'm going to dedicate us to the lofty goal of a traditional Hello World compiled from Android Studio, and run on a Snapdragon 410c . It's simple really, so let's get started. 1st, create a module or new project, then get Android Studio to use CMakeLists.txt. From here, we need to start doing things that aren't part of the documentation. We need to create an executable. Howeve...

Android NDK with Google Test Part 2

I recently gave a presentation on using Google Test within Android Studio; Here's the slides I used. Thought it would be easier to see the code this way: The awesome thing about this is it is highly useful for the upcoming Snapdragon Flight drone controlled by Daydream running on a Snapdragon 820 powered Pixel XL. Being able to automatically determine if the various parts are working is essential for any complex program.

Unboxing the Snapdragon Flight

I got my hands on the Snapdragon Flight Development kit.  Thought I'd start with it by an unboxing video; this is what the kit comes with.  This drone project will be tied into the other work I've been doing by making a VR app that controls it.  I'm going to start doing a few videos along the way to give better access to what I'm doing and how.  I'll also open source the entire project.

Profiling a NDK app from a CI server

As we get into working in VR, one of the chief toolsets that's missing from our developer toolbox is profiling.  The problem is that VR has a hard CPU / GPU requirement which is not so forgiving to unoptimized code.  So every time a team member checks in code, we really must ensure that the app still performs at least at 60 fps or our end users will wind up sick. As I've mentioned before, I prefer Jenkins for a CI server.  Now something we can do is start recording the systrace and run a monkey test behind it so the app is doing more than just running.  To do that, create a new shell task in Jenkins and do something like this: adb shell monkey -p your.package.name -v 5000 > monkeyResults.txt This will run 5000 random events that an end user might run back to back.  The nice thing about it is it generates random user input and runs any app in an unpredictable yet repeatable manner.  It looks for crashes from unexpected user interaction and we can use...

Setup Android Studio for Daydream and Oculus development from the NDK

Thankfully Daydream is really easy to work on.  However, Oculus will require a bit of a on your own homework assignment as I can't redistribute their SDK for them.  Daydream's SDK distributes through a maven repository.  So to setup Daydream and make it easy to upgrade for the NDK development.  However, let's assume that you have downloaded Oculus Mobile SDK and have placed it in a known path <oculusPath> for the reference here:  we need to tell Android how to build the C++ by finding the include directories, the library files to link with and ultimately the library files as dependencies so Gradle knows to package them with the APK. repositories { maven { url "http://google.bintray.com/googlevr" } flatDir { dirs "<oculusPath>/VrAppFramework/Libs/Android" dirs "<oculusPath>/VrApi/Libs/Android" dirs "<oculusPath>/VrAppSupport/SystemUtils/Libs/Android" } } ...