Simulating Robots
Get setup with a robot simulator and the tutorial code.
By the end of this tutorial you will be able to:
- Open the BOW Robot Simulator
- Launch a robot simulation to start testing your applications
- Verify that your robot simulation has been detected via the BOW Hub
Using the BOW SDK you can connect to any robot that is running a BOW Robot Driver. The BOW Robot Driver translates the robot agnostic messages received from the BOW SDK into robot specific code to control that robot. This architecture provides three key advantages: i) Any application that you develop using the BOW SDK will remotely connect to and control any supported robot; ii) The BOW SDK interacts with all robots (physical or simulated) in exactly the same way so code developed in simulation works on real needs to be re-written to support each new robot; iii) just like a physical robot, your Webot's simulation does not need to be running on the same computer, or even the same network, as the workstation that you are developing on; you can connect to it from anywhere in the world.
Being able to easily test your applications with a range of different robots in simulation is central to accelerating robotics development, and that’s where we begin with this tutorial. We'll be using a customised version of the third-party robot simulator Webots, that comes pre-packaged with simulations of the robots supported by BOW.
Simulating Robots
Now that your computer is set up, you are going to need some robots.
Launch the BOW Webots Simulator
Open up the BOW Hub from your system tray and select the "BOW Webots Simulator" menu item.
If this is the first time running the simulator you will be asked for your simulation preferences. After confirming you will be met with the following:
Note that the only elements of the Webots simulator that you will need to use for development are the 3D Window (centre), which allows you to interact with the robot's 3D world, and the Console (bottom) which shows a log of the output from the BOW Robot Driver. You should ignore the Text Editor (right) in Webots, which shows the BOW Robot Driver that is running on your simulated robots. In the same way that you won't be modifying the BOW Robot Driver that is running on a real robot, you should not modify the BOW Robot Driver that is running in the simulation.
Once the simulator is open, navigate to File -> Open Sample World...
After clicking Open Sample World
you will get a window with 'BOW' and 'samples'. Use the drop-down menu for
BOW, find your desired Manufacturer and then Model of the robot that you want to simulate. When the
corresponding .wbt
file is found, double-click to start the robot simulation.
Webots will now load the selected simulation and you should see something like this.
Once you can see regular (white) messages being printed to the console located in the lower section of the window, the driver has started.
To verify the robot has started, check the BOW Hub to see if the robot is listed in the available robot section as shown below.
It may take the robot up to 30s to show for the first time.
If you are unable to see the "SID1 Sim" entry in your available robots section. The driver may have failed to start. If it has ensure that you have a Standard Subscription or Higher otherwise contact [email protected]
With the Robot now available you can select that robot by clicking on the Robot in the available robots section. Every robot, simulated or real, will appear in the available robots section as long as its online and active.
If you only have one robot available the Hub will automatically select that robot as available to the SDK!
Investigation
Within the simulator you can use the Scene Tree to add and remove items from the world.