NAOsim

What is NAOsim

NAOsim is a simulator of NAO where you can test your behaviors and algorithms in a virtual world. You can modify the environment by inserting and modifying objects of various shapes.

../../_images/NAOsim_red_ball.png

What is NAOsim and choregraphe relation

NAOsim embeds NAOqi and therefore can be connected to Choregraphe and Monitor, it is a safe place to test Choregraphe’s behaviors before playing them on NAO in a real environment. In NAOsim, you can also modify the path of NAOqi in order to add your own C++ modules.

../../_images/NAOsim_and_Choregraphe.png

Which sensors and actuators are supported

NAOsim supports the major part of NAO’s sensors and actuators ( Components & Sensors ) :

  • Motor position (Sensor & Actuator)
  • Inertial board
  • Force Sensitive Resistors (On/Off)
  • Bumpers contact
  • Camera (top and bottom)

Install NAOsim

NAOsim installer is available on Mac os X, Windows Xp and Windows 7. Linux is not supported yet.

Using NAOsim

This Getting Started guide explains you how to use NAOsim and Choregraphe together to simulate a behavior in a virtual environment.

Connecting NAOsim and Choregraphe

  1. Launch NAOsim.

  2. Create your environment:

    • Click on New
    • Select ‘Small Apartment’
    • Open the View > Robots
    • Drag & drop the model of the robot you want to simulate.
  3. Click the Start button to turn on the simulation (it will launch NAOqi).

  4. Launch Choregraphe.

  5. Connect Choregraphe with NAOsim:

    • In Choregraphe, go to Connection.
    • Select your NAO (the name should include the name of your computer). Its icon should be:
    ../../_images/beginning_nao_bleu.png
  6. You can now control the NAO with the 3dView in Choregraphe and check what NAO is seeing in the Choregraphe Video Monitor.

Handling objects in NAOsim

  1. Add the Objects panel: click View > Objects.

  2. Add an object in your virtual environment:

    • Select an object in the Objects panel.
    • In the virtual environment, click where you want the object to be added.
  3. Edit an object:

    • Open the Hierarchy View and the Properties panels.

    • Select the object in the Hierarchy View.

    • In the toolbar, click the Move, Rotate or Scale icon.

      ../../_images/navigation_buttons.png
    • In the virtual environment, move the cursor on the X, Y or Z axis to edit the object.

      ../../_images/move_object.png
    • You can also modify the Position, the physics parameters and the Material of the object.

      ../../_images/transform_properties.png
  4. Delete an object:

    • Select an object either in the Hierarchy View panel or in the virtual environment.
    • Press the Del key.

Testing a behavior in NAOsim

  1. In NAOsim, create a virtual environment including objects of various shapes.
  2. In Choregraphe, create a behavior and connect it to NAOsim.
  3. Click the Play button in Choregraphe.
  4. Check the result in NAOsim: Does it look good? Does NAO fall down?
  5. Adapt your behavior and play it again.
../../_images/NAOsim_WB2.png ../../_images/NAOsim_track_red_ball.png

Troubleshooting

I can’t see my virtual NAO in the connection window of Choregraphe.

Make sure you clicked on the Start button in NAOsim to turn on your virtual robot.

Two NAO have the same name in the connection window of Choregraphe.

Select the one with the port 9559.

My NAOsim window is grey, I can’t see NAO or any objects

Example of the issue:

../../_images/naosim_bugzoom.png

You probably zoomed in or out too much (the issue can occur also if you zoomed outside NAOsim due to a bug).

  1. Display the Explorer: go to View > Hierarchy View.
  2. Select an item in the list.
  3. Press the F key.

The window focus is now on the item selected and the issue is fixed.

Annoying warning

When connecting Choregraphe and NAOsim, there can be the warning ‘NAOqi’s version seems to differ from the Choregraphe you are using’.

  1. In NAOsim, go to File > Preferences and click Browse to select another naoqi-sdk path. Check the presence of the files bin/naoqi-bin and bin/nao_simulation_hal. Uncomment the dcm_hal line in naoqi-sdk/etc/naoqi/autoload.ini.
  2. Restart the simulation : in NAOsim click Stop and Start.
  3. Reset the connection in Choregraphe.