Simulating robotics- Capturing simulation data for Digital Twin Computing -Part II
Overview
This is the second blog of our 3 blog series on data capture with Scurid Edge Agent from simulated robotics for digital twin computing. In the previous blog, we introduced the Digital Twin computing in the industrial IoT, its application and challenges.
This blog covers the following:
- Architecture of Argos3 simulator.
- Installation of Argos3 simulator.
- Writing robot controller and configuration file for the scenario.
Argos3
ARGoS3 is a multithreaded physics-based simulator designed to simulate large-scale robot swarms. Benchmark results show that Argos can perform physics-accurate simulations involving thousands of robots in a fraction of real-time.
The ARGoS 3 simulator expects
- An XML configuration file, typically with extension .argos
- User code compiled into one or more libraries.
- A robot controller.
The controller file has four main high level methods namely:-
- init: Is invoked at the start of the simulation.
- step: The simulation proceeds in steps. For each step the step method is invoked.
- reset: Resets the simulation to the initial state.
- destroy: Destroys the simulation.
All the user defined methods are called inside step method.
The configuration file contains all the information to set up the arena, the robots, the physics engines, the controllers, etc. User code includes robot controllers and, optionally, hook functions to be executed in various parts of ARGoS to interact with the running experiment.
Installing ARGoS 3
Download the binary package of ARGoS from ARGoS. Alternatively, we can download the development sources through git. In our case we are going to build it from source. The instructions provided for building ARGoS 3 in this blog is for macOS
, for other operating systems the instructions can be found here
Step 1:Download ARGoS 3
git clone https://github.com/ilpincy/argos3.git argos3
Step 2:Download dependencies
brew install pkg-config cmake libpng freeimage lua qt
docbook asciidoc graphviz doxygen
Step 3: Build ARGoS 3
cd argos3 mkdir build_simulator cd build_simulator cmake ../src make
Robot controller and configuration file for the scenario
We are going to use Footbot robots for our experiment. Footbot robots are mainly used in swarm robotics. The foot-bot has a differential drive system that uses a combination of tracks and wheels to provide mobility on rough terrain. They have LED communication ring which are used for sending messages. These RGB coloured signals are detectable by the onboard cameras of other foot-bots.
Argos3 supports several programming language such as Java, C++, Lua to write the robot controller. In our case we will be writing the robot controller code in Lua. Lua is an efficient, lightweight, embeddable scripting language.
Our robot controller code allows the robot to move randomly on the multicolored grid, sense the color value and report the color detected along with other parameters. The code for our experiment is available under scurid-inc/sample-apps/robotics Pull the repository inside the directory where we built the argos3 binary.
Now, we are all set to start the simulation. To run the simulation we need to execute the following command from the terminal.
argos3 -c robotics/robots.argos
This will launch the simulation window:
We can now start the simulation by clicking the Start icon on the simulation window. Once the simulation starts we can see logs from the robots in the terminal console as below:-
What's next
In this blog we have set up the ARGoS 3 simulator. Wrote the configuration and the controller for the robots and executed the simulation. In the simulation we were able to read sensor data fetched from the robots and their co-ordinate position. In the next blog we will see how we can securely process and store the robot data with Scurid.
Mentioned in this article
Edge Agent
Empower your devices with the Scurid Edge Agent a fusion of robust digital identity, trusted data exchange, and sleek efficiency. Crafted for the discerning IoT architect, it is the future of device autonomy and security.
Server
A server application designed to be deployed on-premise, private cloud or managed as a service by Scurid.
App
A unified cross platform desktop native app to manage fleets of devices in your IIoT ecosystem. Minimizing programming effort to help bring easier access to data verification and trust.
An established platform for your IoT devices and data. Ready for production.
With Scurid’s easy-to-use API-based platform for hardware, sensors, and applications we want to enable the adoption of secure autonomous systems. Scurid is already trusted in production, helping our users achieve a faster and safer go-to-market.