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.
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!
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.
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.
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.
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.
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.
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
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.
@@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
@@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 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.
@@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/
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.
@@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)
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?
Neat! Really nice project.
Xbox one S controller is next? :)
That's the plan! But I don't have the budget to buy one at the moment.
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.
thank you for this video :D!
You're so welcome!
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!
Good question! I just did a live cast about doing this for a holonomic robot: th-cam.com/video/p3uk80tuqI4/w-d-xo.html
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.
...but with the hassle of wires.
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.
This seems to have less latency than with 51515. do you think so too?
Yes, much less. This remote control is actually usable....
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.
can u plz tell me in this comment how to connect the ps4 controller to the ev3 with a cable??
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.
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.
I recommend ev3dev pybricks with vs code.
thank you, but can you realize a one video about how to connect my ps5 controller with my mindstorms? thank you
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
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/
@@AntonsMindstorms you are the best one bro
it finds my controller but asks for a passcode which i cannot type on a controller :/
make sure you got ev3dev installed on your ev3
V1 or V2 dualshock controller, does it matter?
Can you make this but for Xbox one please
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.
What is on line 37?
@@AntonsMindstorms line 37 - return (float(val - src[0]) / (src[1] - src[0])) * (dst[1] - dst[0]) + dst[0]
@@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
@@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
@@juniorkoduje I think I fixed the problem in wordpress. It was a functions.php thing. :(
Does the ps5 controller work on it
Can I do this also whit A nintendo switch controller?
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
? Mine doesn’t let me scan
How do I do it?
Do you have ev3dev?
@@AntonsMindstorms lol sry don’t worry I got it figured out lol thanks
What kind of plug in light is that your using?
Just something I found in the attic. No idea.
Is it possible to connect a dualshock to a power functions hub?
yes, its a different app tho
Can you do one but with an Xbox controller?
My controllers pair/connect for a few seconds then disconnect, any solution?
Never happened to me...
Try reset controller with paper clip.
which ev3 it is.... its different from the others
It's a regular ev3 with new firmware on a micro SD card.
will this work with an xbox controller
Xbox one and xbox series x should work, but the code will be slightly different.
I have some delay issues when control the robot with ps4. Is it the controller's false or my robot's false ??
That is hard to tell from where I am. ;)
@@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.
@@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/
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.
@@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)
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?
Can you contact me on Facebook and explain more?
It seems that some text editors replace the minus signs with em-dashes. Can you check?
Does it work with the PS5 Controller too?
I think so, but PS5 controllers are still really hard to get.