QUB-ASL / bzzz

Quadcopter with ESP32 and RaspberryPi
MIT License
7 stars 0 forks source link

Barometer and GPS: initialisation #217

Closed pdavid747 closed 2 months ago

pdavid747 commented 3 months ago

Main Changes

Taking the initial altitude values and getting an average. The reason for doing this was so that we will have an altitude from ground, not sea level for both the barometer and the GNSS sensors. This will be calculated by subtracting the initial average from the current altitude.

Tests

Tests worked well both sensors take an average of the initial altitude values.

alphaville commented 3 months ago

@pdavid747 what is this PR about?

pdavid747 commented 3 months ago

@alphaville originally it was just taking the initial altitude values and getting an average. the reason for doing this was so that we will have an altitude from ground, not sea level. this will be calculated by subtracting the initial average from the current altitude.

when completing this I realised that the barometer code was wrong and needed re done. currently the GPS has this initialisation feature, and im working on implementing it with the new barometer code.

alphaville commented 3 months ago

@pdavid747, can you please write a proper description and title for this PR?

jamie-54 commented 3 months ago

@pdavid747 I've made a few comments otherwise LGTM

pdavid747 commented 3 months ago

@alphaville using "@property" seems to stop the code from working...

alphaville commented 3 months ago

@alphaville using "@Property" seems to stop the code from working...

What do you mean? Is there a specific error it gives? Did you investigate?

pdavid747 commented 3 months ago

@alphaville using "@Property" seems to stop the code from working...

What do you mean? Is there a specific error it gives? Did you investigate?

it gives "numpy.float64 object is not callable"

alphaville commented 3 months ago

@alphaville using "@Property" seems to stop the code from working...

What do you mean? Is there a specific error it gives? Did you investigate?

it gives "numpy.float64 object is not callable"

What gives "numpy.float64 object is not callable"?

jamie-54 commented 3 months ago

@alphaville using "@Property" seems to stop the code from working...

What do you mean? Is there a specific error it gives? Did you investigate?

it gives "numpy.float64 object is not callable"

What gives "numpy.float64 object is not callable"?

Yesterday when running python pressure_sensor.py it would stop working because of the __initialise() function called in line 60. By adding a few print statements to debug we found it was p = self.pressure() (line 191) causing the issue and getting the error above. The same issue then happened for .altitude() function in line 218

pdavid747 commented 3 months ago

@alphaville using "@Property" seems to stop the code from working...

What do you mean? Is there a specific error it gives? Did you investigate?

it gives "numpy.float64 object is not callable"

What gives "numpy.float64 object is not callable"?

Yesterday when running python pressure_sensor.py it would stop working because of the __initialise() function called in line 60. By adding a few print statements to debug we found it was p = self.pressure() (line 191) causing the issue and getting the error above. The same issue then happened for .altitude() function in line 218

thanks for the clarification Jamie.

pdavid747 commented 3 months ago

@alphaville @jamie-54 @ejb-11 @Yuanbwcx @Minanchi @Runway27

Can we get this reviewed and merged as soon as possible please, as I need it for other things (new Kalman filter, controllers)