Repository navigation
Conversation
pidRightCallback set the left motor's PID constants, so tuning the right wheel over the pid_right topic changed the left wheel and left the right one unchanged. Both callbacks also set the constants twice; once is enough, since updateConstants only stores kp, ki and kd.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BaseController::pidRightCallbackin the Teensy firmware (diffbot_base/scripts/base_controller/lib/base_controller/base_controller.h) set the constants ofmotor_pid_left_. So a message onpid_rightchanged the left wheel's PID, and the right wheel kept its gains. It now updatesmotor_pid_right_.updateConstantstwice with the same values.updateConstantsonly stores kp, ki and kd, so one call does the same.Nothing in the repository publishes
pid_leftorpid_right. They're for tuning by hand, for example withrostopic puband adiffbot_msgs/PIDStampedmessage. Related: #54 (PID tuning over topics). #114 plans native firmware tests that would catch this kind of mix-up.Testing
Both boards build with PlatformIO 6.2.0 (
pio run -e teensy40 -e teensy31), and CI builds both too. Not tested on the robot.