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

Heavily cleanup teleop_turtle_key. #121

Merged
merged 3 commits into from
May 13, 2021

Conversation

clalancette
Copy link

  1. Rearrange code so it is in a more logical order.
  2. Switch from spin_some to spin, which should be lighter on
    CPU time.
  3. Get rid of complicated actions in a signal handler.
  4. Set the timeout on the keyboard reader so it will check status
    between loops.
  5. Fixup the Windows keyboard handling to not use 100% CPU and
    to properly respond to Ctrl-C.

Signed-off-by: Chris Lalancette [email protected]

This should fix #119 . @mjeronimo FYI

1. Rearrange code so it is in a more logical order.
2. Switch from spin_some to spin, which should be lighter on
   CPU time.
3. Get rid of complicated actions in a signal handler.
4. Set the timeout on the keyboard reader so it will check status
   between loops.
5. Fixup the Windows keyboard handling to not use 100% CPU and
   to properly respond to Ctrl-C.

Signed-off-by: Chris Lalancette <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
Copy link
Contributor

@sloretz sloretz left a comment

Choose a reason for hiding this comment

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

LGTM as long as it's been manually checked on Windows! I only tested it on Linux.

@clalancette
Copy link
Author

I was going to merge this, but then I got cold feet when I realized that Galactic and Rolling share a branch here. While I have tested on Linux, macOS, and Windows, I think it is too late in the Galactic release process to introduce a change of this size. What do people think we should do?

@mjeronimo
Copy link

I think the risk is low, given that this is a sample code used in a tutorial. It'll be nice to have cleaner code that works and doesn't chew up a core. Personally, I'd rather not have example/demo code out there with existing issues that people might reproduce.

Signed-off-by: Chris Lalancette <[email protected]>
@clalancette
Copy link
Author

clalancette commented May 12, 2021

Here's CI on this:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@clalancette
Copy link
Author

All right, I retested it locally on Windows, and it seems happy. CI is also happy. I'm going to go ahead and merge this one.

@clalancette clalancette merged commit 7b77b3e into galactic-devel May 13, 2021
@clalancette clalancette deleted the clalancette/fix-teleop-key branch May 13, 2021 14:41
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.

None yet

4 participants