{"id":18375075,"url":"https://github.com/cyberbotics/naoqisim","last_synced_at":"2025-04-06T20:30:59.516Z","repository":{"id":46088717,"uuid":"132758484","full_name":"cyberbotics/naoqisim","owner":"cyberbotics","description":"NAOqi enabled controller for simulated NAO robots in Webots","archived":false,"fork":false,"pushed_at":"2021-11-15T11:21:41.000Z","size":20406,"stargazers_count":23,"open_issues_count":3,"forks_count":11,"subscribers_count":45,"default_branch":"master","last_synced_at":"2025-03-22T06:25:38.621Z","etag":null,"topics":["choregraphe","nao-robot","naoqi","robotics-simulation","softbank-robotics","webots"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyberbotics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-09T13:08:47.000Z","updated_at":"2024-09-21T18:58:06.000Z","dependencies_parsed_at":"2022-08-29T10:20:44.446Z","dependency_job_id":null,"html_url":"https://github.com/cyberbotics/naoqisim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberbotics%2Fnaoqisim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberbotics%2Fnaoqisim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberbotics%2Fnaoqisim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberbotics%2Fnaoqisim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyberbotics","download_url":"https://codeload.github.com/cyberbotics/naoqisim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247547157,"owners_count":20956502,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["choregraphe","nao-robot","naoqi","robotics-simulation","softbank-robotics","webots"],"created_at":"2024-11-06T00:17:27.493Z","updated_at":"2025-04-06T20:30:54.508Z","avatar_url":"https://github.com/cyberbotics.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# naoqisim (deprecated)\nNAOqi enabled controller for simulated NAO robots in Webots\n\n## DISCLAIMER\n\nThis software is provided as-is with the hope it may help users. It may or may not work, without any guarantee. It is not maintained any more, neither by Aldebaran / SoftBank Robotics, nor by Cyberbotics.\nIt relies on outdated versions of Webots, Choregraphe and NAOqi.\n\n## Introduction\n\nThis repository contains the source code and dependencies needed to build the naoqisim Webots controller. This controller is used to connect a Webots-simulated NAO robot to the NAOqi programming interface, including the Choregraphe graphical programming interface.\n\n## Dependencies\n\n### Development environment\nOn Windows, it is necessary to install Microsoft Visual Studio C++ 2010 Express. You should also install MSYS2 (64 bit version) from https://www.msys2.org to have a convienient UNIX-like environment to be able to execute the Makefiles.\nOn Linux, you will need the standard gcc compiler suite.\nOn recent macOS distributions, naoqisim doesn't work any more.\n\n### Simulation SDK\nThese libraries were provided by Aldebaran Robotics Windows, Linux and Mac. However they are not maintained anymore and may not work on recent systems, including the latest versions of macOS. You can install them by typing `make` in the `aldebaran` directory.\n\n### Choregraphe\nThe Choregraphe suite software should be downloaded from SoftBank Robotics (formerly Aldebaran Robotics).\nVersion 2.1.4.13 was recently tested and is known to work with naoqisim.\n\n### Webots\nWebots can be downloaded from https://cyberbotics.com\nYou should use the latest version of Webots.\nVersion R2019a revision 1 was recently tested and is known to work with naoqisim, but later versions should work as well.\n\n## Build\n\nSet the `WEBOTS_HOME` environment variable to point to the Webots installation folder, as documented in the Webots user guide.\n\n### Windows\nOpen the MSYS2 console, `cd` to the naoqisim root directory. Type `make` to complete the installation of the Simulator SDK and the naoqisim controller. On the Simulator SDK is installed, you can compile the naoqisim controller by opening `controllers/naoqisim/naoqisim.sln` with Visual C++ to build the project.\n\n### Linux\nAdd `WEBOTS_HOME/lib` to your library path (e.g. `export LD_LIBRARY_PATH=$WEBOTS_HOME/lib`).\nType `make` in the naoqisim root directory to install the Simulation SDK and naoqisim controller. Once the Simulation SDK is installed, you can compile the naoqisim controller by typing `make` in the `controllers/naoqisim` folder.\n\n## Use\n\n### Short version\n\nStart Webots, open the `worlds/nao.wbt` world file and run the simulation in real-time mode.\nStart Choregraphe.\nChoose Connection \u003e Connect to or click the \"Connect to\" button.\nClick the \"Wake Up\" button (sun-like icon on the top right corner of the Choregraphe window) to make sure the stiffness is on.\n\nFor more information, refer to: http://doc.aldebaran.com/2-1/software/webots/webots_index.html\n\n### Using Webots with Choregraphe\n\nThese instructions have been tested with Webots R2018a and Choregraphe 2.1.4.\nPlease note that Webots must not be launched as root when using any world containing naoqisim, otherwise Choregraphe won't be able to send instructions to the robot in Webots.\n\nStart Webots and open this world file: \"naoqisim/worlds/nao.wbt\" You should see a red Nao in an empty environment.\nIf the simulation is paused, then please start it by pushing the `Real-time` button in Webots.\n\nThe camera images in Webots (small purple viewports) should reflect what the robot sees.\n\nSeveral lines of text information corresponding to the output of NAOqi should be printed to Webots console.\nAlso, a couple of harmless error messages may be displayed, you can safely ignore them:\n```\n[naoqisim] Qt: Untested Windows version 6.2 detected!\n[naoqisim] Error: %1 is not a valid Win32 application.\n[naoqisim]  (dynamic library)\n[naoqisim] Error: failed to load \u003e C:/Program Files/Webots/resources/projects/plugins/robot_windows/generic/generic.dll library\n```\n\nNow you can start Choregraphe with the --no-naoqi option.\nPlease make sure the Choregraphe version matches the NAOqi version printed in Webots console.\nIn Choregraphe choose the menu `Connection / Connect to...`.\nThen, in the list, select the NAOqi that was started by Webots, on you local machine, it will have the port number 9559, unless you change it.\nNote that the NAOqi will not appear in the list if the simulation was not started in Webots.\nIf the simulation was started but the robot still doesn't appear in the list, force the IP and port to 127.0.0.1 and 9559 in Choregraphe and then press connect.\n\nAt this point a Nao model matching the Webots model should appear in Choregraphe.\nNow, in Choregraphe toggle the \"Wake up\" button, which is a little sun in the top right of the window.\nNao is currently in the \"Stand Zero\" pose, you can change its starting pose using the posture library in Choregraphe.\n\nThen, double-click on any of the Nao parts in Choregraphe: a small window with control sliders appears.\nNow, move any of the sliders: the motor movement in Choregraphe should be reflected in the Webots simulation.\nIf you open the Video monitor in Choregraphe you should see the picture of the Nao camera simulated by Webots.\n\nIt is possible to have several Nao robots in your simulation.\nHowever, each Nao robot must use a different NAOqi port.\nThis can be done in the `controllerArgs` field in the newly created robot, e.g. 9560.\n\n#### Using Motion Boxes\n\nNow we can test some of the motion boxes of Choregraphe.\nA simple example is a sit down -\u003e stand up motion.\nIn Choregraphe, select the \"Sit Down\" and \"Stand Up\" boxes from `Box libraries \u003e default`.\nDrag and drop them in central view.\nThen connect the global \"onStart\" input to the \"Sit Down\" box's \"onStart\" input, and the output of this box to the \"Stand Up\" box's \"onStart\" input.\nNow, make sure the simulation is running, and push the `Play` button in Choregraphe.\nThis will make the robot sit down, and then stand up once he is done sitting down.\n\n#### Using the Cameras\n\nWebots simulates Nao's top and bottom cameras.\nUsing SoftBank Robotics's Choregraphe or the Monitor programs, it is possible to switch between these cameras.\nIn Choregraphe, use the \"Select Camera\" box in `Box Library / Vision`.\nThe simulated camera image can be viewed in Choregraphe: `View / Video monitor`.\nThe resolution of the image capture can be changed in Webots using the `cameraWidth` and `cameraHeight` fields of the robot.\nNote that the simulation speed decreases as the resolution increases.\nIt is possible to hide the camera viewports (purple frame) in Webots, by setting the `cameraPixelSize` field to 0.\nIt is also possible to completely switch off the camera simulation by adding the \"-nocam\" option before the NAOqi port number in the `controllerArgs` field, e.g. \"-nocam 9559\".\n\n### Known Problems\n\n#### macOS Support\n\nSoftBank Robotics dropped the `simulator SDK` support for macOS since the `2.1.2.17` version.\nWebots includes this latest version for macOS, however it doesn't work on recent macOS versions.\n\n#### Timing Issues: Getting the Right Speed for Realistic Simulation\n\nChoregraphe uses exclusively real-time and so the robot's motions are meant to be carried out in real-time.\nThe Webots simulator uses a virtual time base that can be faster or slower than real-time, depending on the CPU and GPU power of the host computer.\nIf the CPU and GPU are powerful enough, Webots can keep up with real-time, in this case the speed indicator in Webots shows approximately 1.0x, otherwise the speed indicator goes below 1.0x.\nChoregraphe motions will play accurately only if Webots simulation speed is around 1.0x.\nWhen Webots simulation speed drifts away from 1.0x, the physics simulation becomes wrong (unnatural) and thus Choregraphe motions don't work as expected anymore.\nFor example, if Webots indicates 0.5x, this means that it is only able to simulate at half real-time the motion provided by Choregraphe: the physics simulation is too slow.\nTherefore it is important to keep the simulation speed as close as possible to 1.0x.\nThere are currently no means of synchronizing Webots and Choregraphe, but this problem will be addressed in a future release.\nIt is often possible to prevent the simulation speed from going below 1.0x, by keeping the CPU and GPU load as low as possible.\nThere are several ways to do that, here are the most effective ones:\n\n- Switch off the simulation of the Nao cameras with the \"-nocam\" option, as mentioned above.\n- Increase the value of `WorldInfo.displayRefesh` in the Scene Tree.\n- Switch off the rendering of the shadows: change to FALSE the `castShadows` field of each light source in the Scene Tree.\n- Reduce the dimensions of the 3D view in Webots, by manually resizing the GUI components.\n- Remove unnecessary objects from the simulation, in particular objects with physics.\n\n#### Unexpected Webots Crashes\n\nIf for some unexpected reason Webots crashes, it is possible that the `hal` or `naoqi-bin` processes remain active in memory.\nIn this case we recommend you to terminate these processes manually before restarting Webots.\n\nOn Windows, use the Task Manager (the Task Manager can be started by pressing Ctrl+Alt+Delete): In the Task Manager select the `Processes` tab, then select each `hal.exe` and `naoqi-bin.exe` line and push the \"End Process\" button for each one.\n\nOn Linux, you can use the `killall` or the `pkill` commands, e.g.:\n\n```sh\n$ killall hal naoqi-bin\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberbotics%2Fnaoqisim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyberbotics%2Fnaoqisim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberbotics%2Fnaoqisim/lists"}