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

L3 Left and Right with Servos #6

Open
nick-harper opened this issue May 13, 2020 · 2 comments
Open

L3 Left and Right with Servos #6

nick-harper opened this issue May 13, 2020 · 2 comments

Comments

@nick-harper
Copy link

Has anybody had any issues with L3 for "steering"?

It seems that when you let go of L3_left and right it takes a second or so to realise the state has changed and update.

It works perfectly fine to use the D pad and steers perfectly.

So I am using this code:

` def on_L3_left(self, value):
print("going left")
# p.ChangeDutyCycle(0.1)
# time.sleep(0.1)
#print("on_L3_left: {}".format(value))

def on_L3_right(self, value):
    print ("going righhhhttttt")
    #p.ChangeDutyCycle(8)
   # time.sleep(0.1)
 #   print("on_L3_right: {}".format(value))

def on_L3_at_rest(self):
    """L3 joystick is at rest after the joystick was moved and let go off"""
   # p.ChangeDutyCycle(6.1)
    print('center')
  #  time.sleep(0.1)`

Then if I run it and go quickly left to right and let go I get:

going left going left going left going left going left going left going left on_L3_up: -338 going left on_L3_up: -2365 going left on_L3_up: -3379 on_L3_up: -4392 on_L3_up: -4730 on_L3_up: -4392 on_L3_up: -4730 on_L3_up: -4392 on_L3_up: -4730 on_L3_up: -5068 going left going left going left going left going left on_L3_up: -4730 going left going left on_L3_up: -3716 going left on_L3_up: -2365 going left on_L3_up: -338 center center going righhhhttttt going righhhhttttt going righhhhttttt going righhhhttttt going righhhhttttt going righhhhttttt going righhhhttttt going righhhhttttt going righhhhttttt going righhhhttttt going righhhhttttt going righhhhttttt on_L3_down: 337 on_L3_down: 1689 on_L3_down: 2026 on_L3_down: 2364 on_L3_down: 2026 on_L3_down: 2364 on_L3_down: 2026 on_L3_down: 2364 on_L3_down: 2026 on_L3_down: 2364 on_L3_down: 1689 going righhhhttttt center going righhhhttttt going righhhhttttt

Obviously it is trying to run the action over and over again.

What would the best way to be to do this?

@nick-harper
Copy link
Author

I really struggle to get L3 Left to show too. it seems to be returning L3 Up a lot of the time.

I have just tried by making it only work between a certain value and that didn't work either.

I don't think its the controller as I have tried 2 with the same issue.

@ArturSpirin
Copy link
Owner

@nick-harper I'm not able to repro but can you try with version 1.2.4 and see if its any better? Also try it with the bare minimum code example from the docs without involving servos see if you get the same behavior. For me its very snappy with all the joysticks.

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

No branches or pull requests

2 participants