Show Posts
|
|
Pages: 1 2 3 [4] 5 6 ... 26
|
|
46
|
Using Arduino / Sensors / Re: mpu6050 problem
|
on: January 24, 2013, 11:15:58 am
|
|
jjspierx can you post the code of your cube? The processing sketch doesn't work... maybe with yours i'll be more lucky!
|
|
|
|
|
48
|
Using Arduino / Sensors / Re: mpu6050 problem
|
on: January 23, 2013, 04:08:30 pm
|
|
Thank you. for the reply. Yes, I don't need the angular velocity. Have you some code about fused data algorithm? On Google I didn't find anything about arduino...
|
|
|
|
|
49
|
Using Arduino / Sensors / Re: mpu6050 problem
|
on: January 23, 2013, 03:39:10 pm
|
|
I found the toxi libraries for the processing sketch. But I'm still not understanding how to convert the raw values to the real position of my board on the space and if it's possible. Can you explain this to me?
|
|
|
|
|
50
|
International / Hardware / Re: mpu 6050
|
on: January 23, 2013, 03:18:38 pm
|
Ok, ho trovato le librerie toxi. Il problema è che mi dà tre barre verdi pependicolari tra loro con un punto rosso in comune... Per quanto ho capito comunque a me serve la conversione da valori raw alla posizione del sensore nello spazio e non ho trovato nulla come "sensor fusion"... Ho paura che dovrò accantonare questo sensore. 
|
|
|
|
|
51
|
International / Hardware / Re: mpu 6050
|
on: January 23, 2013, 01:35:33 pm
|
Sul suo github non le ho trovate e per le conversioni non saprei proprio da dove cominciare...  Dopo cena guardo meglio sulla baia 
|
|
|
|
|
52
|
International / Hardware / Re: mpu 6050
|
on: January 23, 2013, 09:39:09 am
|
sì, il mio è così. Per iniziare penso sia perfetto. Lesto, credimi, non sono sfaticato! Non sono riuscito a trovare nulla su toxi... comunque per quanto riguarda i valori hai ragione
|
|
|
|
|
54
|
International / Hardware / Re: mpu 6050
|
on: January 23, 2013, 09:18:10 am
|
In poche parole sono valori inutilizzbili? Ho visto che Jeff ha fatto anche uno sketch chiamato teapot in cui si fa ruotare una teiera con il giroscopio e accelerometro mpu6050. Ho caricato lo sketch ma dice che mancano questi due: import toxi.geom.*; import toxi.processing.*; Sai dove posso trovarli? magari riesco a far diventare il sensore utile!!! 
|
|
|
|
|
56
|
International / Hardware / Re: mpu 6050
|
on: January 23, 2013, 08:49:55 am
|
Grazie mille Lesto per l'esauriente risposta. In questo momento sto usando la libreria mpu6050( http://playground.arduino.cc/Main/MPU-6050#measurements) Dopo aver decommentato due voci #include "Wire.h"
// I2Cdev and MPU6050 must be installed as libraries, or else the .cpp/.h files // for both classes must be in the include path of your project #include "I2Cdev.h"
#include "MPU6050_6Axis_MotionApps20.h" //#include "MPU6050.h" // not necessary if using MotionApps include file
// class default I2C address is 0x68 // specific I2C addresses may be passed as a parameter here // AD0 low = 0x68 (default for SparkFun breakout and InvenSense evaluation board) // AD0 high = 0x69 MPU6050 mpu;
/* ========================================================================= NOTE: In addition to connection 3.3v, GND, SDA, and SCL, this sketch depends on the MPU-6050's INT pin being connected to the Arduino's external interrupt #0 pin. On the Arduino Uno and Mega 2560, this is digital I/O pin 2. * ========================================================================= */
/* ========================================================================= NOTE: Arduino v1.0.1 with the Leonardo board generates a compile error when using Serial.write(buf, len). The Teapot output uses this method. The solution requires a modification to the Arduino USBAPI.h file, which is fortunately simple, but annoying. This will be fixed in the next IDE release. For more info, see these links:
http://arduino.cc/forum/index.php/topic,109987.0.html http://code.google.com/p/arduino/issues/detail?id=958 * ========================================================================= */
// uncomment "OUTPUT_READABLE_QUATERNION" if you want to see the actual // quaternion components in a [w, x, y, z] format (not best for parsing // on a remote host such as Processing or something though) //#define OUTPUT_READABLE_QUATERNION
// uncomment "OUTPUT_READABLE_EULER" if you want to see Euler angles // (in degrees) calculated from the quaternions coming from the FIFO. // Note that Euler angles suffer from gimbal lock (for more info, see // http://en.wikipedia.org/wiki/Gimbal_lock) //#define OUTPUT_READABLE_EULER
// uncomment "OUTPUT_READABLE_YAWPITCHROLL" if you want to see the yaw/ // pitch/roll angles (in degrees) calculated from the quaternions coming // from the FIFO. Note this also requires gravity vector calculations. // Also note that yaw/pitch/roll angles suffer from gimbal lock (for // more info, see: http://en.wikipedia.org/wiki/Gimbal_lock) #define OUTPUT_READABLE_YAWPITCHROLL
// uncomment "OUTPUT_READABLE_REALACCEL" if you want to see acceleration // components with gravity removed. This acceleration reference frame is // not compensated for orientation, so +X is always +X according to the // sensor, just without the effects of gravity. If you want acceleration // compensated for orientation, us OUTPUT_READABLE_WORLDACCEL instead. #define OUTPUT_READABLE_REALACCEL
// uncomment "OUTPUT_READABLE_WORLDACCEL" if you want to see acceleration // components with gravity removed and adjusted for the world frame of // reference (yaw is relative to initial orientation, since no magnetometer // is present in this case). Could be quite handy in some cases. //#define OUTPUT_READABLE_WORLDACCEL
// uncomment "OUTPUT_TEAPOT" if you want output that matches the // format used for the InvenSense teapot demo //#define OUTPUT_TEAPOT
Secondo te mi restituisce l'angolo? Io credo di sì, perchè nel monitor seriale leggo questo: Initializing I2C devices... Testing device connections... MPU6050 connection successful
Send any character to begin DMP programming and demo: Initializing DMP... Enabling DMP... Enabling interrupt detection (Arduino external interrupt 0)... DMP ready! Waiting for first interrupt... ypr -0.16 7.15 0.27 areal 320 9 2572 ypr -0.19 7.13 0.31 areal 398 11 3163 ypr -0.21 7.11 0.36 areal 452 10 3598
|
|
|
|
|
57
|
Using Arduino / Sensors / Re: mpu6050 problem
|
on: January 23, 2013, 07:24:28 am
|
You're helping me a lot! ok, i changed my sketch in this: #include "Wire.h"
// I2Cdev and MPU6050 must be installed as libraries, or else the .cpp/.h files // for both classes must be in the include path of your project #include "I2Cdev.h"
#include "MPU6050_6Axis_MotionApps20.h" //#include "MPU6050.h" // not necessary if using MotionApps include file
// class default I2C address is 0x68 // specific I2C addresses may be passed as a parameter here // AD0 low = 0x68 (default for SparkFun breakout and InvenSense evaluation board) // AD0 high = 0x69 MPU6050 mpu;
/* ========================================================================= NOTE: In addition to connection 3.3v, GND, SDA, and SCL, this sketch depends on the MPU-6050's INT pin being connected to the Arduino's external interrupt #0 pin. On the Arduino Uno and Mega 2560, this is digital I/O pin 2. * ========================================================================= */
/* ========================================================================= NOTE: Arduino v1.0.1 with the Leonardo board generates a compile error when using Serial.write(buf, len). The Teapot output uses this method. The solution requires a modification to the Arduino USBAPI.h file, which is fortunately simple, but annoying. This will be fixed in the next IDE release. For more info, see these links:
http://arduino.cc/forum/index.php/topic,109987.0.html http://code.google.com/p/arduino/issues/detail?id=958 * ========================================================================= */
// uncomment "OUTPUT_READABLE_QUATERNION" if you want to see the actual // quaternion components in a [w, x, y, z] format (not best for parsing // on a remote host such as Processing or something though) //#define OUTPUT_READABLE_QUATERNION
// uncomment "OUTPUT_READABLE_EULER" if you want to see Euler angles // (in degrees) calculated from the quaternions coming from the FIFO. // Note that Euler angles suffer from gimbal lock (for more info, see // http://en.wikipedia.org/wiki/Gimbal_lock) //#define OUTPUT_READABLE_EULER
// uncomment "OUTPUT_READABLE_YAWPITCHROLL" if you want to see the yaw/ // pitch/roll angles (in degrees) calculated from the quaternions coming // from the FIFO. Note this also requires gravity vector calculations. // Also note that yaw/pitch/roll angles suffer from gimbal lock (for // more info, see: http://en.wikipedia.org/wiki/Gimbal_lock) #define OUTPUT_READABLE_YAWPITCHROLL
// uncomment "OUTPUT_READABLE_REALACCEL" if you want to see acceleration // components with gravity removed. This acceleration reference frame is // not compensated for orientation, so +X is always +X according to the // sensor, just without the effects of gravity. If you want acceleration // compensated for orientation, us OUTPUT_READABLE_WORLDACCEL instead. #define OUTPUT_READABLE_REALACCEL
// uncomment "OUTPUT_READABLE_WORLDACCEL" if you want to see acceleration // components with gravity removed and adjusted for the world frame of // reference (yaw is relative to initial orientation, since no magnetometer // is present in this case). Could be quite handy in some cases. //#define OUTPUT_READABLE_WORLDACCEL
// uncomment "OUTPUT_TEAPOT" if you want output that matches the // format used for the InvenSense teapot demo //#define OUTPUT_TEAPOT
and now I'm reciving this: Initializing I2C devices... Testing device connections... MPU6050 connection successful
Send any character to begin DMP programming and demo: Initializing DMP... Enabling DMP... Enabling interrupt detection (Arduino external interrupt 0)... DMP ready! Waiting for first interrupt... ypr 0.09 -2.43 8.77 areal -111 379 2561 ypr 0.07 -2.45 8.82 areal -144 464 3145 ypr 0.05 -2.46 8.86 areal -163 524 3579 ypr 0.03 -2.48 8.91 areal -174 562 3896
Is ypr about the gyroscope? Howerever the areal values are still strange...
|
|
|
|
|
58
|
Using Arduino / Sensors / Re: mpu6050 problem
|
on: January 22, 2013, 04:19:29 pm
|
I've just seen that Jeff had comment the information to obtain the values in degrees and g. Tomorrow I'm testing. Thank you very, very much for all this information. 
|
|
|
|
|
59
|
Using Arduino / Sensors / Re: mpu6050 problem
|
on: January 22, 2013, 04:06:45 pm
|
thank you very much but there's another prolem: Initializing I2C devices... Testing device connections... MPU6050 connection successful
Send any character to begin DMP programming and demo: Initializing DMP... Enabling DMP... Enabling interrupt detection (Arduino external interrupt 0)... DMP ready! Waiting for first interrupt... $?â on the serial monitor I read this!!! 
|
|
|
|
|
60
|
Using Arduino / Sensors / Re: mpu6050 problem
|
on: January 22, 2013, 03:40:51 pm
|
thanks for this so fast reply. My code is this: // Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation // is used in I2Cdev.h #include "Wire.h"
// I2Cdev and MPU6050 must be installed as libraries, or else the .cpp/.h files // for both classes must be in the include path of your project #include "I2Cdev.h" #include "MPU6050.h"
// class default I2C address is 0x68 // specific I2C addresses may be passed as a parameter here // AD0 low = 0x68 (default for InvenSense evaluation board) // AD0 high = 0x69 MPU6050 accelgyro;
int16_t ax, ay, az; int16_t gx, gy, gz;
#define LED_PIN 13 bool blinkState = false;
void setup() { // join I2C bus (I2Cdev library doesn't do this automatically) Wire.begin();
// initialize serial communication // (38400 chosen because it works as well at 8MHz as it does at 16MHz, but // it's really up to you depending on your project) Serial.begin(38400);
// initialize device Serial.println("Initializing I2C devices..."); accelgyro.initialize();
// verify connection Serial.println("Testing device connections..."); Serial.println(accelgyro.testConnection() ? "MPU6050 connection successful" : "MPU6050 connection failed");
// configure Arduino LED for pinMode(LED_PIN, OUTPUT); }
void loop() { // read raw accel/gyro measurements from device accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
// these methods (and a few others) are also available //accelgyro.getAcceleration(&ax, &ay, &az); //accelgyro.getRotation(&gx, &gy, &gz);
// display tab-separated accel/gyro x/y/z values Serial.print("a/g:\t"); Serial.print(ax); Serial.print("\t"); Serial.print(ay); Serial.print("\t"); Serial.print(az); Serial.print("\t"); Serial.print(gx); Serial.print("\t"); Serial.print(gy); Serial.print("\t"); Serial.println(gz);
// blink LED to indicate activity blinkState = !blinkState; digitalWrite(LED_PIN, blinkState); } It's the example of the library MPU6050 ( https://github.com/jrowberg/i2cdevlib/blob/master/Arduino/MPU6050/Examples/MPU6050_DMP6/Processing/MPUTeapot.pde)
|
|
|
|
|