Closed Legohead259 closed 11 months ago
After commit 0bf950c, publisher is still publishing at ~38 Hz. Note that the publisher was originally running at 100 Hz and this frequency does not change after adding/removing services or FOC code. Something else is going on....
When all functionality of the callback method is removed, the publish frequency is 100 Hz, as expected. The timer functions properly, there is just delay in the callback. Delay is due to several factors:
sensor.getAngleEn()
from the callback (~10 ms)FAST
(400 kHz) (~5 ms)It is recommended to switch sensor to interrupt mode instead of polling method
/angular_position
topic will be published to when the sensor reports new data ready
For now, expect a maximum sample rate of ~40 Hz. THIS IS NORMAL FUTURE BRAIDAN
Describe the bug The
/angular_position
publisher is supposed to publish the hall effect sensor position at 100 Hz. In testing with the FOC algorithm and MicroROS, this frequency drops to ~38 Hz.To Reproduce Steps to reproduce the behavior:
ros2 topic hz /angular_position
Expected behavior The report from the
ros2 topic hz
command should be ~100 Hz, not ~38