-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publishing values from multiple hall effect encoders #878
Comments
Working Pico SDK code
|
Is your micro-ROS node connection properly to the micro-ROS Agent? |
Yes I believe so, if I remove the lines
Then the messages for publisher_right are published and can be seen through the relevant ROS2 topic. But including the two lines above results in no messages being published. The topic still exists (with no messages being published) so it is making a connection to the ROS network |
I guess that, if this is the behavior, this issue is related to your IRQ priorities or configuration. |
@jackmcnamara107 have you tested the encoder values in an independent runtime, that is without micro-ROS? Just |
@jackmcnamara107 I also tried having two separate interrupt callbacks, which did not work. I had to use only one callback. Regardless of that, I have now implemented an encoder counter with PIO state machines, based on this example: https://github.com/raspberrypi/pico-examples/tree/master/pio/quadrature_encoder I recommend you give it a try, being able to handle encoders without using processor cycles. |
Steps to reproduce the issue
Have two DC motors with Hall Effect encoders. I'm attempting to read the encoder data using interrupts and publish to seperate ROS messages. Each sensor has two signal wires with 10k ohm pullup resistors.
Expected behavior
Move motor and see respective encoder message change. This functionality works with the standard Pico SDK library using serial monitor when printing the two encoder values.
Actual behavior
Messages are not published by the device. The final setup steps are to enable the IRQ handlers and then spin. Not enabling the secondary IRQ with the handler allows for the other encoder value to be published.
Additional information
The text was updated successfully, but these errors were encountered: