Creating new behaviors

1. Select "Templates"-> "Animation" and drag and drop it onto the flow diagram panel. Open the box by double clicking it.

2. At the top you now see a timeline, where you first should set start- and endframe by clicking on two different times with the right mouse button.
Select a time between those two frames by clicking on the timeline. This will be the time for the first position you want to store.

3. To create a behavior you have the option to work either with the robot view on your screen, or with a real robot.

3.1 Robot view:
In the robot view you can click on different parts of NAO's body e.g. his right arm, and a window opens for it, where you can see in wich position the part of the body is at that time, expressed by the angles the different joints are in.
To move the arm change some values and you see how it makes the robot move in the robot view.
You have the possibility to "mirror" the arms, so that the left and the right side move synchronous when you change the values only on one side.
Of course on the srceen you aren't able to excactly see how the position on the real robot will look like, especially creating a behavior in which NAO moves his legs would be difficult, as you don't know how stable the position you set is.
Therefore you have the option to work with the real robot.

3.2 Real robot:
Connect your NAO to Choregraphe and bring him into the standing position, if NAO should stand during the movement.
Now click on the animation mode button in the upper right corner (the one that looks like the "Vitruvian Man" by Leonardo Da Vinci), which will turn red. This mode allows you to remove the stiffness of different parts of the robot, so you can move it like a puppet to bring it in the desired position.
To move the arms, touch them at the colored part of the hands and carefully change their position, be especially careful with NAO's hands, best move them by clicking on the arms in the robot view, as described above.
To remove stiffness of the legs, tip on the colored part of NAO's feet, but be prepared that the robot may fall if you bring it into an unstable position.
When a leg is unstiffened, the Aldebaran sign on the foot shines green.
To unstiffen the head, tip the middle button on it, tip it again to restiffen it.
Parts or NAO's eyes change their color when stiffness of head or arms is removed.

4. When your NAO is in the desired position, store it in the keyframe that should have appeared where you set a time with the blue stripe before.
By clicking it with the right mouse button, you can store joints in it or remove joints from the keyframe, if you want only some parts of NAO to move in the behavior and wnt the other to remain where they were before.
If you want NAO to move to the exact position you set, store the whole body.
By setting different times you can store different positions, NAO should take consecutively.
Always watch out that NAO is standing safely and beware of putting the different positions too close on the timeline, otherwise NAO may fall because of moving too fast. First try out a slow version of your behavior and speed it up when it is working.

5. If you want your NAO to move less "robotic", you have the option to set the time in which each joint should reach the desired position separately.
Click on the pencil-button on the left side to open the timeline editor, where you can choose the exact time, in which a joint or body part should reach the position stored in the keyframe.

6. Export
To export the movement you created, click anywhere on the timeline with the right mouse button and choose "export motion to clipboard"->"python"->"bezier".
Open a text editor and paste it in there.
Replace the first two lines with "def call():"
Make sure everything below is indented correctly.
Delete the last lines from "try:" and add "return [names,times,keys]"
Save it as a python document.
Add the lines "import name of behavior" and ""name of behavior" : name of behavior" in trunk/mss/behaviors/__init__.py