How to connect a PS4 controller to a MINDSTORMS EV3 robot in under 5 minutes!

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 พ.ย. 2024

ความคิดเห็น • 62

  • @d0iu
    @d0iu 4 ปีที่แล้ว +4

    Neat! Really nice project.
    Xbox one S controller is next? :)

    • @AntonsMindstorms
      @AntonsMindstorms  4 ปีที่แล้ว +1

      That's the plan! But I don't have the budget to buy one at the moment.

  • @komabra
    @komabra ปีที่แล้ว

    Man! Full Subscribe. Working finally :)
    Do you maybe know how to decrease some 'lags' in control when using more ps4 buttons?
    I feel like somethimes my truck is not responding fast enougt when pressing throttle and turn both etc.

  • @xCabex
    @xCabex 4 ปีที่แล้ว +4

    thank you for this video :D!

  • @Asher-99
    @Asher-99 4 ปีที่แล้ว +4

    Great video and articles they really helped! How would you suggest learning how to code the program to work for another robot? My brothers and I made robots to compete in games during this quarantine but they are tank drive robots using all four motors and I cannot figure out how to program them with the ps4 controller for our customized robots. Thank you so much!

    • @AntonsMindstorms
      @AntonsMindstorms  4 ปีที่แล้ว +2

      Good question! I just did a live cast about doing this for a holonomic robot: th-cam.com/video/p3uk80tuqI4/w-d-xo.html

  • @shelbykoch655
    @shelbykoch655 4 ปีที่แล้ว +4

    So I was unable to get different controllers paired via Bluetooth but if you plug your controller into the USB A slot on the side of the brick you should be able to achieve the same result without the hassle of pairing.

  • @robotikb.p.8661
    @robotikb.p.8661 3 ปีที่แล้ว +2

    Great Job... i tried to connect via bluetooth with HC-05 but it doesn´t works, also with ESP32 with arduino platform. The only way i see is to use micropython or python, due to mailboxes communication.
    Thank you for the video.

  • @aka6153
    @aka6153 3 ปีที่แล้ว +3

    This seems to have less latency than with 51515. do you think so too?

    • @AntonsMindstorms
      @AntonsMindstorms  3 ปีที่แล้ว +2

      Yes, much less. This remote control is actually usable....

  • @oskana7107
    @oskana7107 ปีที่แล้ว

    not sure if you'll see this but could u help me out I keep getting this error when using your code
    Starting: brickrun -r --directory="/home/robot/resources" "/home/robot/resources/template\main.py"
    ----------
    Starting program failed: Failed to execute child process "/home/robot/resources/template\main.py" (No such file or directory)
    ----------
    Exited with error code 1.
    Any help would be appreciated thank you.

  • @FNAF2292_2
    @FNAF2292_2 หลายเดือนก่อน +1

    can u plz tell me in this comment how to connect the ps4 controller to the ev3 with a cable??

  • @Kotetsu90
    @Kotetsu90 3 ปีที่แล้ว +3

    Hi Anton, can this also work with the PS5 controller? I tried to change your script for this. But it looks like the EV3 is to slow for all the inputs (Gyro, Touch etc.) Result in big lags for the control.

  • @AlejandroVázquezValdez-n4c
    @AlejandroVázquezValdez-n4c 8 หลายเดือนก่อน

    Hello, good day, I want to ask you that I want to connect 2 more motors to the PS4 controller, what code do you recommend I use since we are doing a school project. I thank you in advance.

    • @AntonsMindstorms
      @AntonsMindstorms  7 หลายเดือนก่อน

      I recommend ev3dev pybricks with vs code.

  • @gameplayconchrist6737
    @gameplayconchrist6737 ปีที่แล้ว

    thank you, but can you realize a one video about how to connect my ps5 controller with my mindstorms? thank you

  • @archyzone
    @archyzone 3 ปีที่แล้ว

    Hello, the code dont work whit ps4 pad, I would like have the correct one, can you send to me the code.
    I don't want the steering mode, but I would like the crawler mode, thanks and great work I love lego

    • @AntonsMindstorms
      @AntonsMindstorms  3 ปีที่แล้ว +1

      Check my website. This is crawler code in the main loop: antonsmindstorms.com/2019/06/16/how-to-use-a-ps3-gamepad-with-micropython-on-the-ev3-brick/

    • @archyzone
      @archyzone 3 ปีที่แล้ว

      @@AntonsMindstorms you are the best one bro

  • @GoldAxoMC
    @GoldAxoMC ปีที่แล้ว +1

    it finds my controller but asks for a passcode which i cannot type on a controller :/

    • @WeirdLegoCoder
      @WeirdLegoCoder 3 หลายเดือนก่อน

      make sure you got ev3dev installed on your ev3

  • @anatolorzecki
    @anatolorzecki 4 ปีที่แล้ว

    V1 or V2 dualshock controller, does it matter?

  • @SupaDoughBoi
    @SupaDoughBoi ปีที่แล้ว

    Can you make this but for Xbox one please

  • @iyadsalameh1989
    @iyadsalameh1989 4 ปีที่แล้ว +1

    i get the below error when i press F5
    Starting: brickrun --directory="/home/robot/ps4_ev3" "/home/robot/ps4_ev3/main.py"
    ----------
    Traceback (most recent call last):
    File "/home/robot/ps4_ev3/main.py", line 37
    SyntaxError: invalid syntax
    ----------
    Exited with error code 1.

    • @AntonsMindstorms
      @AntonsMindstorms  4 ปีที่แล้ว

      What is on line 37?

    • @juniorkoduje
      @juniorkoduje 4 ปีที่แล้ว

      @@AntonsMindstorms line 37 - return (float(val - src[0]) / (src[1] - src[0])) * (dst[1] - dst[0]) + dst[0]

    • @AntonsMindstorms
      @AntonsMindstorms  4 ปีที่แล้ว +1

      @@juniorkoduje I think there is some bug in Wordpress embedding. I'll try to find it. In the meantime use the original gist, unembedded: gist.github.com/antonvh/695ab1c36b61171714a84f700858cdb3

    • @juniorkoduje
      @juniorkoduje 4 ปีที่แล้ว

      @@AntonsMindstorms meantime I figured it out, there is "minus" sign issue, copied and pasted code will throw line 37 error, just replace all minuses with proper one typed from keyboard and voila, working like a charm

    • @AntonsMindstorms
      @AntonsMindstorms  4 ปีที่แล้ว

      @@juniorkoduje I think I fixed the problem in wordpress. It was a functions.php thing. :(

  • @Ghost_3528
    @Ghost_3528 ปีที่แล้ว

    Does the ps5 controller work on it

  • @stijn384
    @stijn384 10 หลายเดือนก่อน

    Can I do this also whit A nintendo switch controller?

    • @stijn384
      @stijn384 10 หลายเดือนก่อน

      And can you tell me what the code should be fore the medium moter in slot A to go right when I push ZR en go left when I push ZL

  • @utubeaddictions2211
    @utubeaddictions2211 4 ปีที่แล้ว +2

    ? Mine doesn’t let me scan
    How do I do it?

    • @AntonsMindstorms
      @AntonsMindstorms  3 ปีที่แล้ว +1

      Do you have ev3dev?

    • @utubeaddictions2211
      @utubeaddictions2211 3 ปีที่แล้ว +1

      @@AntonsMindstorms lol sry don’t worry I got it figured out lol thanks

  • @philfromcharlotte
    @philfromcharlotte 4 ปีที่แล้ว

    What kind of plug in light is that your using?

    • @AntonsMindstorms
      @AntonsMindstorms  4 ปีที่แล้ว

      Just something I found in the attic. No idea.

  • @-Teague-
    @-Teague- 4 ปีที่แล้ว

    Is it possible to connect a dualshock to a power functions hub?

    • @FNAF2292_2
      @FNAF2292_2 หลายเดือนก่อน

      yes, its a different app tho

  • @champsheard5278
    @champsheard5278 2 ปีที่แล้ว

    Can you do one but with an Xbox controller?

  • @Jageo
    @Jageo 2 ปีที่แล้ว

    My controllers pair/connect for a few seconds then disconnect, any solution?

  • @harshsandhu5427
    @harshsandhu5427 4 ปีที่แล้ว +1

    which ev3 it is.... its different from the others

    • @AntonsMindstorms
      @AntonsMindstorms  4 ปีที่แล้ว

      It's a regular ev3 with new firmware on a micro SD card.

  • @haydenwood8211
    @haydenwood8211 3 ปีที่แล้ว +1

    will this work with an xbox controller

    • @AntonsMindstorms
      @AntonsMindstorms  3 ปีที่แล้ว

      Xbox one and xbox series x should work, but the code will be slightly different.

  • @phongo1901
    @phongo1901 3 ปีที่แล้ว

    I have some delay issues when control the robot with ps4. Is it the controller's false or my robot's false ??

    • @AntonsMindstorms
      @AntonsMindstorms  3 ปีที่แล้ว

      That is hard to tell from where I am. ;)

    • @phongo1901
      @phongo1901 3 ปีที่แล้ว

      @@AntonsMindstorms is there a way that i can contact with you more convenient bcuz i need some help with the code. Of course only if it's not bother you.

    • @AntonsMindstorms
      @AntonsMindstorms  3 ปีที่แล้ว +1

      @@phongo1901 My email is on this page: th-cam.com/users/AntonsMindstormsHacksabout. HOWEVER. I would prefer if you ask your question publicly so more people can learn from it. You can add a comment here, or on facebook: antonsmindstorms.com/2020/02/14/how-to-connect-a-ps4-dualshock-4-controller-to-your-mindstorms-ev3-brick-with-bluetooth/

    • @phongo1901
      @phongo1901 3 ปีที่แล้ว

      Ok so the thing is I use 2 wheels car and use the same code as in the video, but it's kinda hard to moving straight and the turning is so quick, which make the car hard to control. Is there a way that i can modify the code that make the turn slower and moving forward easier ?? Thanks for the help.

    • @AntonsMindstorms
      @AntonsMindstorms  3 ปีที่แล้ว

      @@phongo1901 Something like this is for steering with front wheels:
      # Set motor voltages.
      left_motor.dc(forward)
      right_motor.dc(forward)
      # Track the steering angle
      steer_motor.track_target(left)
      Something like this is for steering 'tank style' with two wheels and caster or with threads. You can increase or even invert steer power to change the handling.
      # Set motor voltages.
      steerpower = 0.5
      left_motor.dc(forward - left * steerpower)
      right_motor.dc(forward + left * steerpower)

  • @prasertluekong
    @prasertluekong 4 ปีที่แล้ว

    Thank you for the good tutorial but due to LEGO upgrade version python with EV3 version 1.0 to 2.0. I try to apple your code by setting the import part as a default new version. anyway I still have this problem at the end of function "return (float(val - src[0]) / (src[1] - src[0])) * (dst[1] - dst[0]) + dst[0]" by SyntaxError: invalid character in identifier. Please give me some idea?

    • @AntonsMindstorms
      @AntonsMindstorms  4 ปีที่แล้ว

      Can you contact me on Facebook and explain more?

    • @AntonsMindstorms
      @AntonsMindstorms  4 ปีที่แล้ว

      It seems that some text editors replace the minus signs with em-dashes. Can you check?

  • @Jarouf
    @Jarouf 3 ปีที่แล้ว

    Does it work with the PS5 Controller too?

    • @AntonsMindstorms
      @AntonsMindstorms  3 ปีที่แล้ว

      I think so, but PS5 controllers are still really hard to get.