You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There was a previous commit that create a new preprocessor symbol, ENABLE_CAMERA, that must be defined for the camera support to be fully compiled into the rover's C++ code. By default this is defined in platformio.ini.
When it is not defined, the camera api is turned into function that just return failure, exception for getCameraPropertiesJson() which is the method underlying the status/ endpoint. When camera is enabled, it return all the camera properties and an enabled property with value of "true". When camera is disabled, it only returns enabled with value of "false".
So that's the context. The bug is that if ENABLE_CAMERA is not defined, then speed control does NOT work. The issue seems to be the interrupts are not firing, so the encoder never counts any ticks. This is likely because the camera internals may turn on interrupts, but if we don't initialize it, they never get turned on.
One way to confirm this is to disable the camera AND encoder interrupts; to do this, comment out these two lines in platformio.ini;
-D USE_ENCODER_INTERRUPTS=1
-D ENABLE_CAMERA=1
This will then make the rover C++ code using polling to read the encoder; this is not very accurate, but if it works it would prove the issue is with interrupts.
If it is interrupts, then we probably have to make a call to enable interrupts ourselves.
The text was updated successfully, but these errors were encountered:
I did the experiment where I disabled the camera and used polling for the encoder ticks. If found a bug in the code related t polling and once that was fixed, the code again worked. So we can correctly read the pins, but we are not getting interrupts from the pins. So it does seem to be an interrupt issue.
There was a previous commit that create a new preprocessor symbol,
ENABLE_CAMERA
, that must be defined for the camera support to be fully compiled into the rover's C++ code. By default this is defined in platformio.ini.When it is not defined, the camera api is turned into function that just return failure, exception for
getCameraPropertiesJson()
which is the method underlying thestatus/
endpoint. When camera is enabled, it return all the camera properties and anenabled
property with value of "true". When camera is disabled, it only returnsenabled
with value of "false".So that's the context. The bug is that if ENABLE_CAMERA is not defined, then speed control does NOT work. The issue seems to be the interrupts are not firing, so the encoder never counts any ticks. This is likely because the camera internals may turn on interrupts, but if we don't initialize it, they never get turned on.
The text was updated successfully, but these errors were encountered: