I2C GPS, init Home position

Post Reply
User avatar
Bledi
Posts: 187
Joined: Sat Sep 10, 2011 6:36 pm

I2C GPS, init Home position

Post by Bledi »

What do you think about changing the init of GPS HOME POISTION by
old code

Code: Select all

 
if (rcData[AUX4]>1800 || GPS_fix_home == 0) {
      i2c_rep_start(I2C_GPS_ADDRESS);i2c_write(I2C_GPS_COMMAND);i2c_write(I2C_GPS_COMMAND_SET_WP);//Store current position to WP#0 (this is used for RTH)
      i2c_rep_start(I2C_GPS_ADDRESS);i2c_write(I2C_GPS_COMMAND);i2c_write(I2C_GPS_COMMAND_ACTIVATE_WP);//Set WP#0 as the active WP


new code

Code: Select all

   if (rcData[AUX4]>1800 ||(!armed && GPS_fix_home == 1)) {
      i2c_rep_start(I2C_GPS_ADDRESS);i2c_write(I2C_GPS_COMMAND);i2c_write(I2C_GPS_COMMAND_SET_WP);//Store current position to WP#0 (this is used for RTH)
      i2c_rep_start(I2C_GPS_ADDRESS);i2c_write(I2C_GPS_COMMAND);i2c_write(I2C_GPS_COMMAND_ACTIVATE_WP);//Set WP#0 as the active WP


With this solution the home position is record when you arm motors

Wayne
Posts: 86
Joined: Sun Jul 31, 2011 10:44 pm

Re: I2C GPS, init Home position

Post by Wayne »

I like the idea of resetting home position when sticking into LCD Telemetry.
I have a custom OLED Telemetry page 7 that includes all three GPS locations, current-home-hold.
I am able to set the copter down in the center of the park and quickly see that MW has everything correct.

User avatar
djrm
Posts: 40
Joined: Wed Feb 15, 2012 11:32 pm
Location: North Yorkshire, UK

Re: I2C GPS, init Home position

Post by djrm »

Although automatically setting the GPS home position may have some advantages I think it would be wrong to set the GPS home position at every motor arming for a number of reasons. The GPS could have a poor fix especially after having just been switched on, the copter may have landed and been disarmed someware away from home. I prefer to have the choice which is given by having it linked into the calibrate gyro function as shown here: http://www.multiwii.com/forum/viewtopic.php?f=8&t=649&p=11123&hilit=GPS_reset_home_position#p11123
Best regards, David.

Post Reply