|
Home
Home of Accelerometer Simulator
IntroductionAccelerometer Simulator is an iPhone/iPod Touch application that transfers accelerometer data from the device to your computer using UDP protocol. Use casesThe main use case for the application is to allow iPhone application developers to create applications that require accelerometer, without having to do all the debugging on the actual device. By inserting two files into their project, they can use the Accelerometer Simulator to provide accelerometer data to their application when debugging on the iPhone simulator. Second use case is to use your iPhone accelerometer to control something else on another device (such as your MacBook or PC). Finally you can use the receiver part and write your own data generation application to, for example, execute predefined accelerometer datasets on your application. Usage
The application has two views: Accelerometer and Network. The Accelerometer view looks like this
Here you can switch between the actual sensor and manual operation modes. The sliders show the current accelerometer values. In the manual mode you can slide these yourself, generating accelerometer data manually. Note that in the manual mode you can generate data that would not be possible to generate with the HW sensor. In the second view (tap the bottom tap bar to activate) you can configure network settings.
When the application starts, network is set to OFF and no data is being sent. Switching it to ON opens the gates and the application begins sending UDP packets to the network. By feault it uses broadcast mode, which means that all devices in the same network (such as your WLAN) will receive the packets. In case you plan to run multiple simulators in the same network, you should switch to unicast mode and specify the target IP address manually. You may also change the port to something else if you wish (remember to change it on the receiving end as well). Now that AccSim is sending accelerometer data, it's time to setup someone receiving it. Embedding into your applicationTo embed Accelerometer Simulator capabilities into your own application, simply add the AccelerometerSimulation.h and AccelerometerSimulation.m files from the Simulator classes directory into your project. Then in the source file where you configure UIAccelerometer, simply add #import "AccelerometerSimulation.h" This will override the default behaviour of UIAccelerometer when run on the iPhone simulator. When building for device, nothing is changed in your application. After compiling and running your application on the simulator, it should now be receiving accelerometer data from the AccSim application running on your device. Should you need to use a different UDP port, you have to edit the AccelerometerSimulaton.m file and change the line #define kAccelerometerSimulationPort 10552 Other usagesIf you want to use the AccSim application for other purposes, check out the testaccsim.py Python-example. It prints out the messages sent by AccSim. The format of messages is following: ACC: <deviceid>,<timestamp>,<x>,<y>,<z> The deviceid is the unique device id of iPhone, used to identify different sources if there are many (think of a crowd of iPhone users controlling a single game on a big screen...) Next is timestamp and acceleration values for x,y and z. These are derived directly from UIAcceleration. |
Hello,
Please, can you put this app in the apple store?
It'd be great to have this in the app store!
Hey,
Thanks for sharing your code! I hooked this up to my macbook's internal accelerometer (using UniMotion?):
http://ifiddling.blogspot.com/2009/01/dummy2.html
Best, Karan
This is way too cool! I can finally provide decent looking movies for my accelerometer based games! Thanks a bunch, man!
Thanks for sharing! Is anyone aware of an equivalent for multitouch, sending touches from the device to the simulator? (I need more than the pinch and drag that are available on the simulator)
I made a TCP client that handles accelerometer and multi-touch. The only problem is that it is designed to work with SIO2, so it would need a bit of tweaking to work for general programs.
This is fantastic! Thanks for sharing such a useful tool, I had it all hooked up and running on my apps within a few minutes.
Does anybody know why this stops streaming when the iPhone goes into "sleep" mode? Even if it's setup to run in the background via jailbreaking, the data still stops.
I am having an issue with the timestamps coming over to the python script. When I average them, I am getting a 10% reduction on the frequency of the accelerometer update that is coded in. Also, it occasionally will lose a record.
Is this not working anymore?
I'm using iPhone SDK 3.1.2, iPhone Simulator running iPhone OS 2.2.1
I've got the AccSim? application running on an iPhone 3G and iPod Touch 16GB 1st Gen just fine, and included the simulator .h and .m files in my project(s) just fine, and I can see the "getAccelerometer" function get called by placing a NSLog statement there in the simulator, but the delegate never makes any callbacks in the simulator at all
Switching to the device(s) works just fine...
Works great! Thanks for the code.
Nice and easy, worked the very first time. Thanks a bunch. As others have pointed out, the only logical extension to this project is to add touchesBegin/touchesEnd support, then it'll be perfect. Also, the ability to save network preferences would be nice. But hey, it's open source, so I might contribute these changes if I ever put them in myself.
Thanks alot. Beers on me.
Very clever, here some suggestions how it could evolve even better (if only apple picked up): http://fraggle.squarespace.com/blog/2009/6/14/doing-game-using-accelerometer-on-the-iphone-dont-miss-that.html
Thank you very much. I think that this is going to prove a life saver for me.
Anyone know how many bytes are in each portion of the message. ie. it sends a 76 byte array across udp and it's split into those 5 messages. id, timestamp, x,y,z
how many bytes make up each portion?
Also anyone made a windows server for accepting this? I'm working on that now in c#.
Has anybody been able to get this to work with PhoneGap?? I'm not having any luck. Thanks.
I'm just wondering how exactly i download this. I've followed the link etc. but it doesn't take me to any sort of page... Is the link dead? Is it actually possible to download this?
To Download it just open a terminal window and type (or paste): svn checkout http://accelerometer-simulator.googlecode.com/svn/trunk/ accelerometer-simulator-read-only
Awesome project, using this w/ cocos2d. Thanks a lot! :M:
Anyone got this working with OS 3.x.x?
never mind, it works!
thank u
Just in case anyone is interested, I put this on the App Store (for free download): http://itunes.apple.com/us/app/accelerometer-simulator/id336476721?mt=8
Thanks for the code!
For those of you interested in getting the data from this tool into a Processing sketch, check out a simple code snippet here.
Does it only work via Wifi?
Thanks Mr, this is working like a charm! And it's so easy to implement. And i don't thx Apple who could have planned an accelerometer input in the sim. :)
Thanks, worked great!
Thanks, works. But, how i can get values of accelerometer with simulator? can i shake the simulator to change the values?
Thank you for posting this! But I'm still so confused. Is there any way I can directly download the accsim project? I think I'm creating files incorrectly.
Do I create two viewcontrller files for the networkinfo and accelerometerviewcontroller, and then a regular objective c file for the accelerometerinfo.h and .m? when should i add in the accelerometer simulator files?
thank you for your help!!
Hey just stopping by to say thanks for this project. Worked great for my team in assisting in capturing video of our iOS project without needing a camcorder.
If you ever make updates it'd be double cool if you could add the ability to send touch input from the Acc-Sim running device to the simulator.
vchang7190:
To get the files you'll need to use svn. This contains the full project which you use to build the app to your iOS device.
To add support to your simulator project, copy the AccelerometerSimulation?.h and AccelerometerSimulation?.m files to it, add them using Add Existing Files, and then include AccelerometerSimulation?.h wherever you use accelerometer input in your project.
If you're having issues with it make sure any firewalls you have aren't blocking it since in broadcast mode it's just spamming UDP packets (iirc).
Hey, thank you for that great developer helping app! Works perfectly fine and is absolutely easy to integrate!
Hi I need to get the accelerometer data in MATLAB and the do some filtering on them. does anybody have any idea on how I can do this via UDP packets??? I really need help. please
What a great and easy-to-use utility even for a total xcode newbie like me! This makes my dev practising on the iPhone simulator so much more sensible and enjoyable. Thanks a million!
I'm using iOS 4.3 in xcode 4 and get a warning that the class AccelerometerSimulation? does not implement the 'NSMachPortDelegate' protocol. Compiles ok but I don't get any data.
Any idea if it is possible to recive the data in Flash?
I get the same NSMachPortDelegate warning with no data. Anyone find a solution to this?
can i get the sample cod for the pedometer .Anyone can help me for this
Hi,
I'm getting an EXC_BAD_ACCESS error at line 121 processNotification:notification?; in handleMachMessage method. Any ideas?
Thank you!
Great work man! Thanks!
where are the downloads
where are the files to download?
Excelent! thanks
Anyone updating this?? I would love to have shake and swipe/multitouch. Support and since I'm asking for the moon. what about a cute little <popup> Debug console window..
ahh the dream !!! thanks
this is in the app store for those who don't have the ios dev account (search accelerometer simulator and search? button, it does not show up in the quick search results). I really can't part with $100 for the dev account so this really helped me being I just got to the accelerometer part of the nerd ranch book.
WHERE'S THE SOURCE/DOWNLOAD? I can't find it.
I just downperiod the app. But it is interacting very slow. It takes up to minutes after pressing "network" before it sows that page. Same with slow updating of XYZ data. Im using at Iphone 3GS. Anyone got any idea how to solve?
I have suggestion. From what I understand this app only works with UIAccelerometer, in the more recent iOS versions CMMotionManager is now the more used accelerometer access api so. If someone could integrate it for CMMotionManager. I would try my self but I'm not a very experienced iOS developer. I'm sure a lot of people would appreciate this.