Hi everyone and welcome to How to program your NAO Robot with Python Tutorial Video number 2. On this week's tutorial we are looking to how to get your robot to walk using Python. So if you want to learn how to program your robot to walk up to any mountain then please stay tuned.
Hi guys! I'm Philip English from Robophil.com. Now on this video we are looking to teach you on how to program your NAO robot to walk with Python. The NAO can be program to walk to any point using the in-build Python Programming Language, so instead of using the drag and drop boxes in the choregraphe, Python is more expressive and allows you to do things like computing trigonometric calculations on the robot.
Right! Jumping straight here guys, we are going to do the Walk Two Tutorial but with Python.
- Right click the main section box and go to "add new box"
- Create a name for the box
- Input main image
- Select the type of box
Brilliant! And that's it. And we have a Python Code Box here, so what we do is we open but before that what we want to do is stand up,we want our robot to stand up as it is sitting down at the moment, from the screen you can see it is standing up, drag a stand up icon in there and we'll just connect it all up the noodles, I am actually using the NAO key so the 3D robot in the robot view, and this because we need to put the robot on connecting so we can see what's going on quite clearly with the NAO key button, oversee when you are using this on the real robot never forget to trigger on the motors and connect everything up properly.
- Open the Code Box
- Go to “def onInput_onStart(self):”
- Write "motionProxy = ALProxy("ALMotion")"
- On the next line write “walkTo(0.2,0.0,0.0)“
- End it with “self.onStopped()”
So as you can see we have put it down here. Now, the first line is a proxy called, ALmotion which what is we created here, which allows us to call the motion functions up, the second line is the walkTo which moves the robot to specific distance. Now, look on the decimal places here, sorry the numbers here, so see .2 is X and Y and the radius, so he's going to move .2 forward and then if I start playing with the other numbers here, he'll move to the Y radius and then to the other turning point as well. The final bit is the self.onStopped this will call and tell the choregraphe to stop the procedure when it is at the end and just simple loop and loop and loop. Now, If we are good we should see this now on the 3D NAO, so if I hit play, there we go we can see it walking along and as you know, if you going to see your robot you'll gonna see it walking along now with you. So that's it guys just have a quick play with the walk two in Python, again you can play with there figures and number in here to see it again to walk a little bit further. Brilliant! Thank you!
Well done guys, you can now get your NAO Robot to walk by using
your Python programming skills.
Now have a play with this behaviour to see if you can get your NAO
to walk to several points, or maybe even walk around a maze?
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.
Aldebaran NAO Robot Product - http://www.robotcenter.co.uk/collections/aldebaran-robotics-nao
Robo Phil Facebook - https://www.facebook.com/RoboPhilip
Robo Phil Twitter - https://twitter.com/RobotPhilip
**Click Below to SUBSCRIBE for More Videos: