Movements

Creating a movement from scratch

In Choregraphe, it is very easy to create simple movements in no time.

  1. Drag and drop the Template > Animation box onto your diagram.

  2. Double-click on the box to enter it.

    An empty timeline is displayed.

  3. Select a frame by clicking in the motion section at an index different from 1.

    Note

    Having a keyframe at index 1 is not advised: it would mean that the robot, from an unknown position when entering the box,

    should go to this position in no time and the keyframe would probably be ignored.

  4. Click on one of the robot limbs to display the motion window.

    Note

    Whenever there is a current frame cursor (the blue line) on the timeline, the motion editing is on.

  5. In the Motion window, you can add some joint values of the selected limb in the current keyframe, moving a limb will automatically add the joint value to the selected keyframe.

Creating a movement with a real NAO robot to define the joints values

Warning

Make sure you are connected to a real NAO.

Head motors have to be un-enslaved, see page about enslave motor

This tutorial will explain how to use a real NAO robot to create a mouvement.

We will see how to define joints values by moving a real NAO robot.

Saving the head joints values using motion window

When you change the real NAO position, you can see that the virtual 3D NAO changes position too. Try to raise NAO’s arm for example.

../../../_images/chore_position_reflected.jpg

Wouldn’t it be nice to use this feature to create position keyframes on a motion timeline ?

Now, let’s say we want NAO to move its head up in the first keyframe and to keep its arms down:

  1. Click on the first keyframe

  2. Click on the head of the virtual 3D NAO to open the motion window.

  3. Move the real NAO robot head to the position you want.

  4. Click on the two record buttons of the motion window as in the following picture:

    ../../../_images/chore_clicking_record.png

    The head joints values have been saved in the first keyframe.

Saving the arms joints values using the “Store joints in keyframe” options

  1. Move the real NAO robot arms to put them down.

  2. Click on Enslave all on/off in the motion window.

    The robot doesn’t move.

  3. Right-click on the first keyframe and select the Store joints in keyframe option.

    Note

    This feature allows you to save the joints values of NAO: the joints of the whole body, the head, the arms or the legs.

  4. As we want to save the joints values of the arms, click on Arms.

    ../../../_images/chore_store_joints.png

    The joints values of the arms have been saved in the first keyframe.

Raising the arms in a second keyframe

  1. Left click the motion timeline to change the current edition frame (the blue line).

    A second keyframe is displayed on the motion timeline.

  2. Move the real NAO robot arms to the position you want.

  3. Click on Enslave all on/off in the motion window.

    The robot doesn’t move.

  4. Right click on the second keyframe and select Store joints in keyframe > Arms.

    The joints values of the arms have been saved in the second keyframe.

Thanks to the Store joints in keyframe option, we were able to save the values of 8 joints (4 joints per arm) in a keyframe in only a single click.

Note

When you right-click on a keyframe, the Remove joints from keyframe option allows you to easily remove the joints values that have been saved in a keyframe. You can choose to remove the joints values of the whole body, or only the values of the head, arms, legs or forearms.

Creating a movement using the recording mode

Warning

Make sure you are connected to a real NAO

Head motors have to be un-enslaved, see page about enslave motor

Now we are going to see the new recording mode, that allows you to record joints, without having to jump between the robot and the mouse!

Opening the recording mode

  1. Drag and drop the Templates > Animation box onto your diagram.

  2. Double click on it to see the timeline.

  3. Open the timeline editor by clicking on the following button:

    ../../../_images/timeline_editor.png
  4. Now activate the recording mode using the menu bar (Record > Switch to recording mode), or the toolbar by clicking on the folowing button:

    ../../../_images/recording_mode.png

    You should see two new columns in the tree on the left panel.

    ../../../_images/chore_record_mode1.png

    You are now ready to record your first movement.

Recording movement

Let’s create a new dance with arms movements.

  1. In order to select the joints to record, click on the record columm in front of arms, the window should look like that:

    ../../../_images/chore_record_mode2.png
  2. Start the record using the menu bar (Record > start) or the toolbar by clicking on the folowing button:

    ../../../_images/chore_rec_start.png
  3. Move the robot arms as you want and stop the recording whenever you want by clicking on the button:

    ../../../_images/chore_rec_stop.png

    You should obtain a timeline as follows:

    ../../../_images/chore_record_mode3.png

Now, let’s move the head accordingly to our nice arms movement.

  1. Uncheck the “record” column of the arms.

  2. Check the “replay” column of the arms.

  3. Check the “record” column of the head.

    The window should look like that:

    ../../../_images/chore_record_mode7.png
  4. Enslave the arms.

    Note

    Enslave the arms is done in order to replay the arms movements during the recording of any movement of the head.

Now, let’s change the recording mode:

  1. Open the motion recorder settings using the menu bar (Record > Settings) or by cliking on the folowing button:

    ../../../_images/chore_rec_settings.png
  2. Choose the interactive mode using bumpers.

    The robot is going to listen to its bumpers. A small panel should explain how it works.

Editing the recording

Now, you may want to edit the recording, and customize your movement.

Open the curves mode by clicking on the folowing button in the tool bar:

../../../_images/timeline_curve_mode.png

The animation is now displayed with curves that represents the evolution of joints values for each keyframes.

../../../_images/chore_record_mode4.png

Before doing any edition, you can use the “simplify” method, that will remove useless keys from selection:

  1. First, select a range of keyframes.

    ../../../_images/chore_record_mode5.png
  2. Click on Simplify button and try the default value:

    ../../../_images/chore_simplify.png

    You will see that non relevant points are now transparent: they will be deleted if you accept the simplification.

  3. Click on Close.

    You will see that the result is a bit less frightening! At least, all the double keys have been removed, which make the whole movement easier to read/modify.

    ../../../_images/chore_record_mode6.png

    Now, you are ready to edit the recording using all the timeline tools!

Creating a movement using animation mode

Warning

Make sure you are connected to a real NAO

This tutorial will show you how to create a movement using the animation mode.

Starting from the Init pose of the pose library, we will animate NAO in order to put it in the position of the famous sculpture called The thinker by Rodin.

This movement will include legs, arms and head movements.

First, if you want more information about the animation mode see How to use the animation mode section.

If you feel ready to bring your NAO to life:

  1. Enslave your NAO

    To know how to do it, see How to enslave section.

  2. Put your robot into the Init position using the pose library.

  3. Drag and drop the Template > Animation box.

    This box will store all the keyframes of the movement.

  4. Double click on the box in order to display the timeline.

  5. To edit the timeline, click on the folowing button:

    ../../../_images/timeline_editor.png

    The following window is displayed:

    ../../../_images/timeline_editor_window.png
  6. Now we will select the record mode, click on the following tools button:

    ../../../_images/chore_rec_settings.png
  7. Select the Interactive using the chest button mode, this mode will record NAO’s position each time you press the chest button or say Store position.

  8. Click on Ok.

  9. Click on the following button to switch to the recording mode:

    ../../../_images/recording_mode.png
  10. In the actuators list click on the intersection of the record column and the All row to activate the record of all actuators.

    The actuators list should look like that :

    ../../../_images/actuators_list_all.png
  11. Now you are ready to start the recording of the movement, click on the following button to start the record:

    ../../../_images/chore_rec_start.png

    Don’t worry no joints values are recorded until you have pushed the chest button or said Store position to your robot, this is the particularity of the recording mode you have choosen.

    Your robot in the Init pose should look like that:

    ../../../_images/animation_mode_mov1.png

    We will decompose the movement into several peaces in order to make it really simple, we will start by the leg:

  12. As you enslaved your robot before, all the joints are rigid, to move legs, you will have to un-enslave it first, hold your NAO by the chest to prevent it to fall down and push the two bumpers to un-enslave legs.

  13. Lower the chest in order to flex legs, your robot should look like that:

    ../../../_images/animation_mode_mov2.png
  14. Move the right foot forward and turn it a little on the right like in the following picture:

    ../../../_images/animation_mode_mov3.png
  15. Enslave the legs, press the chest button to record the position.

  16. The next part of the movement will involve the arms and the head of the robot, put the left arm on the left knee.

  17. Un-enslave the head and lower it until it is no longer possible, tilt the chest forward, raise the right hand to the head

  18. Enslave the robot and verify if the position is stable, if it is, record the position if not tilt the chest backward until the position remains stable and store the position.

    Your robot should look like that:

    ../../../_images/animation_mode_mov4.png

    The movement is finished congratulation!!!

  19. To stop the record, click on the following stop record button:

    ../../../_images/chore_rec_stop.png

    You can see that all the keyframe recorded were added to the timeline.

  20. To perform the animation, exit the animation box and link it to the beginning of the root behavior.

  21. Click on the following play button to start the animation.

    Note

    If you want, you can get the .crg files here: /your intallation directory/doc/sample/choregraphe/tutorial_animation_mode.crg

You can now create outstanding movements very easily.