Skip to content
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

add arcade-drive-xbox-controller example #83

Merged

Conversation

fletch3555
Copy link
Contributor

@fletch3555 fletch3555 commented Dec 3, 2023

I added comments to match the cpp example. Let me know if you'd rather it be a little simpler like the existing arcade-drive example.

Confirmed it runs in sim

arcade-drive-xbox-controller/robot.py Outdated Show resolved Hide resolved
arcade-drive-xbox-controller/robot.py Outdated Show resolved Hide resolved
arcade-drive-xbox-controller/robot.py Outdated Show resolved Hide resolved
arcade-drive-xbox-controller/robot.py Outdated Show resolved Hide resolved
self.myRobot = wpilib.drive.DifferentialDrive(m_left, m_right)
self.myRobot.setExpiration(0.1)

# xbox controller #0
Copy link
Member

Choose a reason for hiding this comment

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

Comment not in original example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I left this, but made it match what's in the tank-drive examples for consistency

@fletch3555
Copy link
Contributor Author

Responding to all comments in one. Those were cloned from the standard arcade-drive one and mixed with the new stuff from the cpp example. I'll clean that up and make it one-for-one, and update the arcade-drive one as well while I'm in there.

@virtuald
Copy link
Member

virtuald commented Dec 3, 2023

Thanks. Historically I didn't care as much about matching the official examples, but since going official and being used in documentation I think it's more important to match now.

@fletch3555
Copy link
Contributor Author

Thanks. Historically I didn't care as much about matching the official examples, but since going official and being used in documentation I think it's more important to match now.

I understand completely, and agree. I haven't done much of anything with robotpy (or python at all for that matter), so wasn't sure if there was a reason for it. In any case, should be good now.

right.setInverted(True)

def teleopPeriodic(self):
"""
Copy link
Member

Choose a reason for hiding this comment

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

Generally """ comments describe the whole function's purpose, not a single statement's purpose.

@virtuald virtuald force-pushed the add_arcade-drive-xbox-controller_example branch from d7add5c to af76d1b Compare December 5, 2023 07:48
@virtuald virtuald merged commit 82298e6 into robotpy:main Dec 5, 2023
10 checks passed
@fletch3555 fletch3555 deleted the add_arcade-drive-xbox-controller_example branch December 6, 2023 04:30
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.

2 participants