|
|||||||||
|
|||||||||
|
|||
|
great job jim danner now, think this...if you want someone to help us ( the person you want to call for help never read this thread) is better to start a mini thread asking for help cause not all the people read ALL threads from ALL topics so starting a new mini thread will get more people from reading it and helping us...don't know if this understands it, anyway about the name.....if this gets official and finished some day, will be in installer, hackint0sh and who knows engadget gizmodo etc... and it will be like this "igtech for iphone LIKE THE REAL GTECH" (for example) and you'll getting free publicity. my thoughts if you want we change it....bye
__________________
Please we need help in developing an application to measure (HP, Lateral G's, Braking distance) in our cars... http://www.hackint0sh.org/forum/show...ght=likes+cars PLEASE CODERS AND DEVELOPERS....HELP NEEDED READ POST #80 FOR MORE INFO! THIS IS NOT AN OVERSIZED LETTER SIZE! ![]() REP UP IF MY POST HELPED YOU IN ANY WAY!
|
|
|||
|
Quote:
I'm still very new to iPhone development but have recently been playing with the new SDK. The main problem I have is that I have not been accepted into the developer program yet and therefore cannot put apps on my device. So basically I am unable to actually test the Accelerometer at this time. I have implemented the calibration routines as mentioned by you and these values will be saved for later use. I've just found the following information in the iPhone OS Programming Guide (pdf) and wondered if this would/could change your calculations (i'm pretty lost when it comes to the maths on this project): Isolating the Gravity Component From Acceleration Data If you are using the accelerometer data to detect the current orientation of a device, you need to be able to filter out the portion of the acceleration data that is caused by gravity from the portion that is caused by motion of the device. To do this, you can use a low-pass filter to reduce the influence of sudden changes on the accelerometer data. The resulting filtered values would then reflect the more constant effects of gravity. Listing 10-3 shows a simplified version of a low-pass filter. This example uses a low-value filtering factor to generate a value that uses 10 percent of the unfiltered acceleration data and 90 percent of the previously filtered value. The previous values are stored in the accelX, accelY, and accelZ member variables of the class. Because acceleration data comes in regularly, these values settle out quickly and respond slowly to sudden but short-lived changes in motion. Code:
#define kFilteringFactor 0.1
- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {
// Use a basic low-pass filter to keep only the gravity component of each axis.
accelX = (acceleration.x * kFilteringFactor) + (accelX * (1.0 - kFilteringFactor));
accelY = (acceleration.y * kFilteringFactor) + (accelY * (1.0 - kFilteringFactor));
accelZ = (acceleration.z * kFilteringFactor) + (accelZ * (1.0 - kFilteringFactor));
// Use the acceleration data.
}
If you are using accelerometer data to detect just the instant motion of a device, you need to be able to isolate sudden changes in movement from the constant effect of gravity. You can do that with a high-pass filter. Listing 10-4 shows a simplified high-pass filter computation. The acceleration values from the previous event are stored in the accelX, accelY, and accelZ member variables of the class. This example computes the low-pass filter value and then subtracts it from the current value to obtain just the instantaneous component of motion. Code:
#define kFilteringFactor 0.1
- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {
// Use a basic high-pass filter to keep only the instantaneous motion component of each axis.
accelX = acceleration.x - ( (acceleration.x * kFilteringFactor) + (accelX * (1.0 - kFilteringFactor)) );
accelY = acceleration.y - ( (acceleration.y * kFilteringFactor) + (accelY * (1.0 - kFilteringFactor)) );
accelZ = acceleration.z - ( (acceleration.z * kFilteringFactor) + (accelZ * (1.0 - kFilteringFactor)) );
// Use the acceleration data.
}
EG: // Constant for the number of times per second (Hertz) to sample acceleration. #define kAccelerometerFrequency 40 // Configure and start the accelerometer [[UIAccelerometer sharedAccelerometer] setUpdateInterval 1.0 / kAccelerometerFrequency)];[[UIAccelerometer sharedAccelerometer] setDelegate:self]; I hope more people are working on this idea (and will post here to let us know) so that we may have a working app at some point. Cheers |
|
|||
|
Thanks. Interesting to see that this guide (by Apple?) has some thoughts about these issues. I understand more or less what they mean, but their methods surprise me a little bit.
Isolating the gravity component This I understand, and it is not unlike what my formulas do in the first calibration run. To avoid random deviations, they take a running average of the measurements that come in over a period of time. So instead of the total of one single measurement, their result is 10% of the most recent one + 9% of the one before + 8.1% of the one before that + ... (multiply by 0.9 for the next earlier one, etc.). These percentages add up to 100, and the most recent one counts most heavily. Makes sense, if you need to know the current gravity vector but don't want it to be disturbed by random measurement error. Isolating instantaneous motion What they do here seems strange. The intention is to do the same as the main routine from my calculations: take the measured values and subtract gravity from them. But here they subtract a mixture of previous and current values from it, so what they take off is actually more than just gravity. Their formula reduces to (measured value - gravity)x0.9. Thus, 10% of what they want to measure is filtered away. If we do it this way, we get values that are too low. I suspect that this routine is intended for gaming applications etc. but not for precision measurements. Great to see that you could make a real native application (as opposed to a script running under Jiggy). I assume this will enable you to read the accelerometers at much higher frequency (like the 40 times per second of the example), with better accuracy as a result. If that is the case, there may be better calculation algorithms we could use to filter out vibrations -- let's discuss this when you know the possible frequencies. Keep going!
__________________
iPhone 3GS / 3.1.2 JB (PwnageTool) / 04.26.08 carrier-locked, Carrier Logo Fixer / Cydia / 1000 posts on Hackint0sh Installing Cydia programs on a phone that has no internet connection: read this. Editing binary .plist, .strings, .nib and .xib files: * on your computer: Windows tool / conversion website. * on your iPhone: convert those files in a terminal with plutil (installed with Erica Utilities) or edit them with iFile (Cydia links). |
| Sponsored links Remove advertisements | |
|
|
|
|
|
|||
|
Jim,
Just wanted to let you know that i'm still trying to work on this. I've been accepted into the developer program and paid my $99 but i'm still waiting for the certificates until I can actually put it on a device? I have the calibration routines in place (although not tested) but just wanted to check that you are happy with the following equations and i'll try and implement them: Code:
// Calculate all the interesting values on the basis of the measurement
var t = new Date().getTime()/1000; // The current time (since Epoch) in seconds
// Some grouping here? ((ex*_x)+(ey*_y)+(ex*_z))
a = (ex*_x + ey*_y + ez*_z)/C; // The formula that puts it all together. a=forward acceleration in m/s2
// Grouping here too maybe.. v = (lv+(la+a)*(t-lt))/2
var v = lv + (la+a)*(t-lt)/2; // Current velocity in m/s: old velocity+(average acceleration*duration)
var u = v*3.6; // current velocity in km/h
var m = u*0.62137; // current velocity in MPH
// Grouping here if you want.. d = (ld+(lv+v)*(t-lt))/2
var d = ld + (lv+v)*(t-lt)/2; // Distance traveled, in m
var yrd = d*1.0936; // Distance traveled, in yards (is this the customary unit?)
Just to keep you busy, do you think it would be possible to work out an angle based on the current velocity? So that we may produce actual speed display on screen like a car speedometer? EG: If you imagine a clock: 8 o'clock would be 0 KPH and 4 o'clock would be 200 KPH? The needle would then move between the two. We would know the center spot but not sure if it's possible to work out the degree of the current velocity to show on screen? (ATan2 is used in one of the sample codes, perhaps will help?) Seeing as this thread has had such a huge group input i'd be happy to make anything that I create FREE on the AppStore. In fact unless the Dev team come up with a way for people to distribute SDK apps outside of the App Store then I think i'd have too. Can people do some research into this and let me know if it's possible to distribute SDK apps? (any possible workarounds) |
|
|||
|
What customizing settings are people after?
I'm just making a list of things to try and include: CALIBRATION: Test 1 & Test 2 MONITOR SPEED IN: Miles Per Hour (MPH) or Kilometers Per Hour (KPH) MONITOR DISTANCE IN: Miles (M) or Kilometers (KM) AUTO-STOP TIMER: None, After 5 seconds, After 10 seconds, 60 KPH, 60 MPH, 100 KPH, 100 MPH Note: The time will automatically stop when the selected option occurs. None means that the user will have to actually press "Stop" while recording. Thanks |
| Sponsored links Remove advertisements | |
|
|
|
|
|
|||
|
Quote:
I would suggest you use the formulas from post # 349 above. They have been slightly modified to deal with some comments from JuiCe. (The ones you quoted were an earlier version). Accuracy should be reasonable; we should be able to be within a few percent error on accelerations, and speeds may accumulate somewhat larger deviations over the course of a run. For distributing applications outside the App Store, there must be an open toolchain for the new 2.0 firmware. I'm pretty sure this will come to exist (or may exist already), for example this blog post and this thread suggest that it is of interest to the right people. The open toolchain could be used to compile your code to work without any sort of DRM or restrictions. Installer and Cydia will continue to exist under the 2.0 firmware. Working out the angle of the speed dial is easy. With the parameters you mentioned, the angle between a vertical line and the dial comes out at (u-100)*1.2 (in degrees, where positive angles are to the right and negative ones to the left). I don't know how you would actually program the displaying of such a thing; maybe you need to use different variables than an angle -- let me know. For customization, I would like to note that power (horsepower, kW) can only be calculated (or rather, approximated) if the mass of the vehicle is known -- so there would have to be an input area for that. Making graphs of the test results would be my first thought for a real improvement, and if it were possible to zoom in on the graph and see some numbers around it (highest point, etc.), that would be interesting for the user.
__________________
iPhone 3GS / 3.1.2 JB (PwnageTool) / 04.26.08 carrier-locked, Carrier Logo Fixer / Cydia / 1000 posts on Hackint0sh Installing Cydia programs on a phone that has no internet connection: read this. Editing binary .plist, .strings, .nib and .xib files: * on your computer: Windows tool / conversion website. * on your iPhone: convert those files in a terminal with plutil (installed with Erica Utilities) or edit them with iFile (Cydia links). |
|
|||
|
hi rjshearman welcome, first thanks for your help and all of you guys who are supporting/helping with this idea it will be an innovative app. so, second thing as jim said you need the weight of the car to know its power but can you also think of entering a field for torque? why torque....because if you know the weight of the car and torque it can be measured the RPM of the engine also!....you should also (ALL OF YOU) SEE THIS LINK !!http://www.rdrop.com/~/larry/download/formulas.pdf jim here you will find useful formulas! bye see ya guys!
__________________
Please we need help in developing an application to measure (HP, Lateral G's, Braking distance) in our cars... http://www.hackint0sh.org/forum/show...ght=likes+cars PLEASE CODERS AND DEVELOPERS....HELP NEEDED READ POST #80 FOR MORE INFO! THIS IS NOT AN OVERSIZED LETTER SIZE! ![]() REP UP IF MY POST HELPED YOU IN ANY WAY!
|
| Sponsored links Remove advertisements | |
|
|
|
|
|
||||
|
Quote:
Quote:
I've found some sample code which draws the second hand on an analogue clock (which may help): Quote:
Quote:
Will update soon. |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|