iOS pointer using gyro - ios

I'm trying to build a pointer using the gyro in an iPhone. Right now I send gyro-data to a windows application from an iPhone over TCP but I want it to send two dimensional data that the app can use more directly to control a pointer. To start sending data a button is pressed. The orientation the phone is in when the button is pressed should be "the starting point", and how the phone is tilted from that is what should be sent.
So say I have the phone in my hand while lying down, I press the button (0, 0) and tilt it forward so that the top of the phone moves closer and closer pointing toward the ceiling (0.54, 0).
Is there any library I can use to transform the gyro data to a two dimensional representation or will I have to dust off my algebra? Are there any good resources for doing it algebraically?

Related

Create track motion app in iOS

I just want some hint of how can I create an app in iOS which can do following.
When a user is at point X, user will click on start button so app will start a timer and track the movement. User will be on a horse and user needs to ride in a full circle. When user comes back to point X the app should draw the route taken by the user on the horse.
Aim is to ride completely in a circle. I want to make this app to
practice and see how close to a circle I ride.
I tried to look at GPS locator but I am not sure whether it will give me efficient results because the circle I ride can be as small as 60m or less in radius.
I don't know if iOS GPS can be this accurate. I read article on motion sensor and how to track rotation and acceleration.
But I am not quite sure how to use that to my advantage.
I just need some tips like which API to use etc.
Using the Standard Positioning Service one can achieve 15 meter
horizontal accuracy 95% of the time. This means that 95% of the time,
the coordinates you read from your GPS receiver display will be within
15 meters of your true position on the earth.
More Information click here
For integrate Map and draw path using current position google map is good option for integrate in iOS mobile .
small and range and get accurate result use indoor position system.
For more information about Indoor positioning system (IPS) click here
http://developer.estimote.com/
and Github iOS demo : get code

Detect if iPhone thrown in air using core motion

I'm trying to detect if my iPhone has been thrown into the air.I've tried using core motion's acceleration API and its altitude API.However, because the axes are fixed to the phone doing the detection of the changes is incredibly difficult.Is there a better way to do what I want?Is it possible to speed up the refresh rate of the CMAltitude API?
In freefall, you should see your 3 accelerometer values go to 0. Even in a projectile type of fall (throwing), the phone is in freefall as soon as it leaves the thrower's hand.
This white paper talks about using a MCU, but the concept is there.
http://www.nxp.com/files/sensors/doc/app_note/AN3151.pdF

Transferring billiard game state from player to player with box2d

Im using Union server for my iOS (Starling) billiard game.
So far the connections work great.
My question is:
How would you handle the transfer of the ball positions from the opponent.
Lets say I make the break, and I want to copy that shot to the other player?
Do you think its a good idea to send a message over union every frame (x, y)?
Will this cause latency problems?
First about your question:
The game is installed on both devices, the rules are same. So on shot send the white balls force and all other properties you modify. On the receiving device add that force etc. and the ball will repeat the action done by the sending user.
Now the sad part:
I will be the first one to disappoint you - even if you solve your problem and send the message from player to player with out problems the result won't be pleasant: box2d calculations are optimised for performance, but the result will differ as it's calculated with approximate accuracy. As a result even on the same device the balls will end up in a different location on different runs. You won't notice it in one-two hits, but after playing for a minute you'll end up with deferent ball locations.
You can also try to send a message of every ball position in space after all balls stop moving and relocate the remote users ball positions. After that "correcting" message was received return the control to the player.
We had a similar game and I just wrote my own 2d engine. If you're working only with ball to ball and ball to rectangle collisions it's easy to write your own engine.

iOS Accelerometer and Spacial Navigation?

I'm trying to build a web app specifically for iOS that relies on accelerometer data for navigation. (A site that you could theoretically move through (from page to page) spatially.)
For example, taking a step (or moving the device) forward would take you to one web page or URL, and left, right, or backwards would take to their own unique URLs. Any ideas on how to make this happen?
I spent quite a lot of time looking in to this for an experiment I was writing.
The trouble is that it is very hard/impossible to get an accurate (or even approximate) location in space from your device.
The trouble is that the device measures acceleration which needs a couple of calculations to get down to position.
You can use this value to measure location relative to a start point but the next problem is the noise that the accelerometer receives.
The closest I could get to getting it working was to smooth out the noise of the accelerometer and then calculate back to try and determine location. But due to the noise I found that the device would constantly think it was moving in one direction.
After a number of days of trying different methods I determined that it really isn't possible without external tracking of the device.
What you can do is use the orientation of the device to navigate. i.e. tilt forwards, tilt backwards, tilt left, tilt right do do different things.

iphone map kit indoors?

i'm trying to develop a small application that is able to track the position of the user indoors. I also want to create a small map of the building floor, so the user can see a image of it and his/her current position as they travel though the building. They would be able to connect via wifi.
Are there any tutorials/examples of how to create a navigational map indoors on the iphone? furthermore is it possible to accuratly track the position of the player by the use of wifi indoors?
Your second question is IMHO much more crucial, and the answer is "not very easily, and not very accurately". You'd have to see multiple APs (4+) located at well known positions at the same time, and triangulate your position from the signal strengths. This would also require that the phone scans for networks all the time but doesn't connect to any.

Resources