0845 528 0404

Philip English

Robotics Enthusiast, Director, Investor, Trainer, Author and Vlogger

Python Programming Your NAO Robot Tutorial Video 3

Python Programming Your NAO Robot Tutorial Video 3

Hi Everyone, and welcome to the how to program your NAO Robot with Python tutorial video number 3. On this weeks tutorial we are looking in to how to get your Robot to walk to a point with Python! So if you want your Robot to turn and march to your desired destination, then please stay tuned.

Hi Guys, I’m Philip English from robophil.com, now on this video we are looking to teach you how to program your NAO Robot to turn and walk with Python!

The NAO can be programmed to not only walk forward, but can be programmed to turn and walk to an exact destination, by using it’s Python programming language.

So in instead of using the drag and drop box system in Choregraphe, we will implement a Python behaviour.

Right! Hi Guys! And welcome to the turn and walk tutorial Python Tutorial. So what we going to do is we are going to take this one step at the time. Now, the signal is box up here, this is basically more of the Python code but I wanted to put it up here just to make this little bit quicker so you won’t see see me type lots of lots of text.

  • Add new Code Box for Turn and Walk
  • Add the X and Y coordinates in the parameter fields
  • Set the type of box both to Float
  • Set the values to 0.2, -2, 2
  • Get the robot to stand up using the NAO to stand up Code Box
  • Connect the Code Boxes with the Noodles

Now what we want to do, so you don’t see me type tons of tons of code I already created a box and done this already. Which is already here, this is the little fellow here. So I am going to delete this one and cut and just going to bring the one that is already done and coded. So to walk you through it, we are going to enter the details onto the onInput and onStart as we’ve done before. What we’ve done here is we’ve done import math so what it does is import the uses of math functions such as atan which is the tangent functions and square root functions, without that square root will not work. The code takes the X and Y parameters and compute the angle for turn using the atan functions, the tangent functions and then compute the distance to walk forward using the square root functions, and multiplication, addition and then complete the equation to make the robot walk forward.

So that should have given you enough time to out quickly and if not just pause this video and just jot everything down there and if I’ll close these then we hit the play button on our robot we should it turn and walk forward. I’ll position this better so you could see and play and as you can see it is doing its turn and then he is walking forward. Brilliant!So we know the code is working nicely. We are doing it again to double check. And he’s up, stands, twisted around and walking forward. Brilliant! Brilliant! And that’s it guys. Thanks very much.

Well done guys, you can now get your NAO Robot to turn and then walk to a point, by using your Python programming skills.

Now have a play with this behaviour to see if you can get your NAO to walk in a giant Circle!, or maybe even measured out distance to see how accurate he is?

Have a play guys and use your imagination.

Now if you liked this tutorial and want to see the next one in the collection, then please hit the Subscribe button and keep update with the latest videos that come out.

Please have a look below, where I have put links relating to this videos , as well as other information about the NAO Robot.

If you have any questions or want to see any other related tutorials, then please write me a message in the comments section, and I will see what I can do.

Thanks Guys! And I will see you next time.

Python Programming Your NAO Robot Tutorial Video 3 YouTube: https://youtu.be/023Aik_hPkM

Philip English: https://philipenglish.com

Sponsor: Robot Center: http://www.robotcenter.co.uk

 

 

You might be interested in …