Skip to content

Conversation

@kensthilaire
Copy link
Contributor

We've noticed that the XRP is unable to drive straight due to surface textures, friction with the rollers, etc. Students find it frustrating that they have a hard time controlling the XRP, especially with the new support for gamepad control. I had previously added behavior at the application level to use the IMU with PID to allow the XRP to maintain a constant heading and thought that it would be better if the XRP library supported this capability natively.

The proposed changes extend the DifferentialDrive class to allow it to drive straight under arcade control. When enabled by the presence of the IMU parameter during instantiation, the new behavior will maintain a course heading when driving straight (turn value of 0.0). If a turn is requested, the new behavior will set a turning indicator and apply the derived left/right motor speeds without correction. Then once the turn value is 0.0 again, the heading will be reset based and the XRP will follow this new course heading until another turn is requested.

No attempt was made to refactor either the straight() or turn() behavior to match the arcade() changes, but that can be easily done so that the implementations better match.

Copy link

@Will-Scheirey Will-Scheirey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to handle the case where the imu is initialized but imu.is_connected() returns false? Looks like it isn't handled in other places, so maybe it doesn't need to be done here.

@kensthilaire
Copy link
Contributor Author

kensthilaire commented Oct 21, 2025 via email

@Will-Scheirey
Copy link

Hi Ken,

I believe a review from someone with write access to the repository is required to complete the merge; I do not currently have write access

Thank you, Will for the review. You're right in that I hadn't considered validating the imu.is_connected(), but I did see that it's not handled in several cases. Perhaps, we should open up a separate issue to add that validation wherever needed. I see that you approved the PR, but I am unable to complete the merge and close the PR. Is that something that a team member would need to do? Ken

On Tue, Oct 21, 2025 at 10:36 AM Will @.> wrote: @.* approved this pull request. Do we need to handle the case where the imu is initialized but imu.is_connected() returns false? Looks like it isn't handled in other places, so maybe it doesn't need to be done here. — Reply to this email directly, view it on GitHub <#85 (review)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAY2RENGKWSBD7ZAPJXEK6T3YZAFVAVCNFSM6AAAAACAG2ZVFCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTGNRRGE3DCNRRGU . You are receiving this because you authored the thread.Message ID: @.***>

@bradamiller bradamiller merged commit 4e16995 into Open-STEM:main Oct 22, 2025
@kensthilaire
Copy link
Contributor Author

kensthilaire commented Oct 22, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants