Simulator SDK¶
Requirements¶
- gcc > 4.4 or Visual Studio > 9 (2008)
- cmake 2.8 (2.8.3 minimum on windows)
Introduction¶
The simulator-sdk is aimed at roboticists who want to simulate SoftBank Robotics robots in their own 3D simulator.
It provides libraries, data, assets and examples.
Libraries¶
lib/ALRobotModel | a C++ lib which describes all the Aldebaran-Robotics models (initial geometry, kinematics & dynamics data, sensors and actuators initial positions). |
lib/ALNAOsim | a C++ lib which enables to link the sensors / actuators to NAOqi (via the Hardware Abstraction Layer). |
lib/ALSimUtils | a C++ lib which launches automatically one naoqi per robot. |
For further information, see: Simulator-SDK reference
Data and examples¶
share/alrobotmodel/meshes | OGRE 3D format meshes. |
share/alrobotmodel/models | xml files defining robots. They should be provided to the ALRobotModel lib. |
examples/dummysim | a small example which shows how to use those lib. |
How it works¶
To use the simulator-sdk for your own simulator, you have to write a plugin that uses the libs of the simulator-sdk.
- First, you have to instanciate a model by providing the xml file you want amongst those found under libalrobotmodel/models to the ALRobotModel lib.
- Then, you should use your simulator API to get the physical values of the simulated world. These values should be transmitted into the sensors of the simulated robot. Use HALInterface::sendSensorValues functions for this.
- Also, you should use the HALInterface to get the command values send by NAOqi to the actuators. Use HALInterface::fetchActuatorValues function for this. Finally use your simulator API to set these values to the actuators of the simulated robot.
The following figure summarizes this, and explains in further details how the simulator-sdk works.
How to build dummysim¶
Step | Action |
---|---|
From the root of simulator-sdk, move to examples/dummysim/ cd examples/dummysim/
|
|
Create a build directory, and move into it mkdir build && cd build
|
|
Configure the build with cmake cmake -DCMAKE_TOOLCHAIN_FILE=../../../toolchain-pc.cmake ..
|
|
Compile make
|
|
Execution of dummysim. Do not forget to uncomment the dcm_hal in the file etc/naoqi/autoload.ini in the sdk. Next, at the root of simulator-sdk: on Linux: bin/dummysim share/alrobotmodel/models/NAOH25V50.xml <naoqi_port> <path_to_sdk>
on Mac: DYLD_LIBRARY_PATH=lib bin/dummysim share/alrobotmodel/models/NAOH25V50.xml <naoqi_port> <path_to_sdk>
on Windows: launch bin/dummysim share/alrobotmodel/models/NAOH25V50.xml <naoqi_port> <path_to_sdk>
Where: <naoqi_port> is the port on which NAOqi will be launched and <path_to_sdk> is the path to the sdk from which NAOqi will be launched (can be the simulator-sdk itself) |
|
Check that everything works fine:
|
Various remarks¶
Multi-robot¶
You can instantiate several robots on the same computer by defining a port for each.
Units¶
Everything is in the Standard International.
Video¶
In its current implementation, the video does not work without NAOqi running.
How to generate URDF model and visualize it in rviz¶
Use robot_description to generate urdf:
Step | Action |
---|---|
Install ros and rviz (see http://www.ros.org/wiki/) | |
Use robot_description to generate the urdf file of the model you need. At the root of the simulator-sdk: bin/robot_description --urdf --mesh-path=share/alrobotmodel/meshes --model-file=share/alrobotmodel/models/<model_name>.xml > <model_name>.urdf
|
|
Copy display_aldebaran.launch in the current directory |
|
Visualize it with rviz (for more information, see http://www.ros.org/wiki/rviz): rosrun urdf check_urdf <model_name>.urdf
roslaunch display_aldebaran.launch model:=<model_name>.urdf
|