Unity has built-in support for only some of the sensors on mobile devices.
This package provides access to every single sensor of your Android device. It can and has been used for augmented reality, multisensoric games, visualization and more. Sensors just work as expected, independent of device and app alignment and orientation.
The demo application (exactly the one contained in the package) is available from the Android Market (goo.gl/gkFq7).
support for every single sensor Android is capable of:
Rotation Vector
Gyroscope
Accelerometer
Linear Acceleration
Gravity
Light
Proximity
Orientation
Pressure
Magnetic Field
Processor Temperature
Ambient Temperature
Relative Humidity
Magnetic Field (uncalibrated)
Gyroscope (uncalibrated)
Game Rotation Vector
Step Detector
Step Counter
Geomagnetic Rotation Vector
experimental support for iOS cross-compiling (so rotation just works the same on both platforms)
you can do pretty much everything the Android sensor API can do:
check whether sensor is available
activate/deactivate sensor
set fetching speed
get info about power usage, manufacturer etc.
⌠(see this link for a complete list of sensors and their attributes)
fallback handler for device rotation - if one sensor is not supported, the next best sensor is choosen
selectable rotation sensor technique (different combinations of sensors to achieve a complete, three-axis rotation value)
multiple demo scenes and samples for different usage scenarios
really easy to use (enable a sensor for your application = 2 lines of code, and thatâs if you donât want to use the provided prefabs)
supports Unity Remote 4 for debugging rotation sensors in the editor
Thereâs also a tutorial about how to use GyroDroid together with Qualcommâs Vuforia augmented reality solution here.
You can try everything out in this demo scene (this complete application is included with the package, too): Android Market (goo.gl/gkFq7) (simply type into your mobileâs browser to install the application, or install directly from market)
By default, GyroDroid sends sensor hardware statistics to help us improve it. You can easily opt-out of this completely by adding NO_GYRODROID_STATISTICS to your list of Platform Custom Defines under âPlayer Settings > Other Settingsâ, see the unity docs for more info.
The demo application features several useful example scenes:
camera as window (first person view)
rotating around an object (third person view)
explorable world (moving camera target), switch between first and third person view
great work!
im on vacation, but was able to download the v2 demo on the galaxy tab and htc desire. unfortunately it crashes each time i select a category from the main menu. am i doing something wrong? firmware 2.2
thank you
we werenât aware that there are a few Android 2.3 calls inside our library (so the minimum required API level is currently 9 / Android 2.3.0). We will look into this issue as soon as possible - thanks for pointing this out!
Okay, so Android 2.3 introduced a bunch of sensors not available before. These sensors are, according to the SDK:
Gravity
Linear Acceleration
Rotation Vector
Unfortunately, these are the Really Cool Ones (the ones which work best and are most accurate).
The current application will crash running on Android 2.2 and below because of trying to access the regarding constants and functions â oops, thatâs entirely our fault.
Be assured that the sensors available prior to Android 2.3 will work just fine in the next version of GyroDroid, shouldnât take very long to correct that mistake.
The problem is fixed, and we updated the download link in the first post. The demo scene should work now down to Android 2.1, although Android 2.3 introduced more accurate sensors.
We tested on the following devices:
Samsung Galaxy Tab 7" - Android 2.2
Samsung Galaxy Tab 10.1v - Android 3.0
Motorola Xoom - Android 3.0
Samsung Google Nexus S - Android 2.3.3
Motorola Milestone - Android 2.2
Review is pending, so in a few days, the fixed version (2.1) is available in the Asset Store!
thanks a lot!
the demo works on the tab now.
what i need works perfectly, on the other hand:
the linear accel demo does nothing, maybe the tab + andro 22 doesnt support it
the box demo (awesome btw) works in all directions except one, check it out
If you open the StatisticsDemo on Galaxy Tab 7", you will see that LinearAcceleration sensor isnât available (unfortunately, it was introduced with Android 2.3). Glad you like the other demos! Consider writing a review in the AssetStore, please .
Very cool! Although I think the camera is rotated 90degrees - - i.e. in the âcamera windowâ mode - moving the phone (galaxy s) up and down moves the camera up and down - but the camera is viewing everything 90 degrees sideways. Probably easy to sort out in Unity. Canât wait to get stuck into this, thanks!
Any chance on supporting GPS? I think from Unity 3.3+ onwards GPS is supported on Android using the iPhoneSettings class but not all functions mentioned in the Android SDK are implemented So I was hoping you wouldâŚ
I totally agree with janook!!.. GPS and Compass support would be GREAT for my upcomming project⌠any chance you´r asset will be supporting both in the near future, or in any future!?
sorry for the long time without answers - finally weâre back
Compass is supported right now - you can simply use the MagneticField sensor (which basically is the compass included with the device). In the next version, we will also provide an example scene on how to use it, so it will be easier for you then.
We are also looking into fully supporting GPS, including all the features Android provides.
There are also some things to fix, like not-quite-right screen rotations on some devices.
I cannot give you a release date quite yet, but thanks for all your comments and requests!
I had problems with screen rotations on xperia mini and on samsung galaxy2.
Can you give a hint on how it can be sorted out?
Has it anything to do with the remapcoordinates() command from android?
When will you make fixes for phones like Samsung Galaxy S2? I purchased the gyrodroid app and the axis are inverted. I really need this functionality because I need to complete a project in a month.
PS.: We decided to implement GPS functionality into a new package, because of fundamental implementation differences and different requirements for your project (GPS needs manifest permissions, sensor usage does not). The GPS plugin isnât ready yet, but we are working on it.
@vfxdomain:
Have a look at the TurntableRotation example. This is exactly the functionality you need - the horizon is fixed to the ârealâ horizon if you rotate the device. You only need to use the rotation values to steer your airplane.
I wonder what will be the difference from Unityâs android.location mapping and this plugin.
At the moment Unityâs locationInfo are working great, only timestamp seem to be broken.
Perhaps even a fix only on that side (the locationInfo.timestamp) would be enough to make willing to buy.
I have recently purchased GyroDroid and need some help regarding calculating relative rotation from a starting pose.
I am using the rotation as returned from SensorHelper. However, this only considers absolute rotation and sets the transform.rotation accordingly. Is there an in-built way of calculating rotation from a given starting pose? I.e. the position that the user is currently holding the phone.