Back to all posts

Simulating robotics- Simplified and trusted data collection of Digital Twin -Part III

Posted on Apr 24, 2024 in Engineering
Roshan Singh
Roshan Singh
R&D Engineer, Scurid
Simulated Digital Twin
Simulated Digital Twin

Overview

This is the final blog of our three blog series on data capture with Scurid Edge Agent from simulated robotics for digital twin computing. In the previous blogs, we introduced Digital Twin computing in the industrial IoT, and its application, and then we explored how to set up the ARGoS-3 simulator for the experiment.

This blog covers the following:

  1. Set up Scurid Server and Scurid Edge Agent.
  2. Install CockroachDB. This is not a must-have,in this scenario we use it show how data capture and store works with Scurid's built-in DB connector.
  3. Start edge agents to process robot data and store it in the database.

Installing Scurid Server

Download the Scurid Server binary specific to your platform from the Downloads. Follow the steps defined here in the Getting Started - Overview

Installing Scurid Edge Agent

We will need to install 3 agents, i.e. one agent per robot. Follow the Getting Started - Scurid Edge Agent to begin the installation.

This means we will need to go through the following steps for:

  1. Edge agent for robot 1
  1. Edge agent for robot 2
  1. and, Edge agent for robot 3

And finally, each of these new agent installations needs to be registered with the Scurid Server as described in the Getting started guide.

Installing CockroachDB

We will store the data generated by the simulated robots in CockroachDB. In this tutorial CockroachDB is installed with Docker. Follow the guide to get started. Once CockroachDB is installed we will set up the Storage Configuration in the Scurid App.

Configuring Scurid for Storage

  • Open the Scurid App and navigate to Settings > Storage Settings.
  • Select CockroachDB Self Hosted
    CockroachDB Self Hosted
    CockroachDB Self Hosted
  • Configure the CockroachDB connection details.
    connection details
    connection details

Next, we will create a metadata structure for the data we want to receive from the robots. This structure defines how the data is stored in the database. This can be simply created from the Scurid App. Check out the details from the last blog on how to do it, under the section Configure device identity on Scurid Server

Start the Edge Agents

The edge agents are responsible for processing the streamed data from the robots, authenticating and signing it and sending it to the Scurid server for storage. We will now set the Data structure of the agent to the metadata that we created above.

We now proceed to construct the code necessary for interpreting the data stream from the simulation. The requisite code for processing this data stream can be found at the following location Swam robotics sensor data collection

As we have three robots in our simulation, we build three edge agents each specific to a robot.

In order to build the data processing code we need to clone the Swam robotics sensor data collection

Build edge agent for robot 1

For building code for robot 2 make sure to set

$ cd swarm-robotics-sensor-data-collection
$ go build
$ ./swarm-robotics-sensor-data-collection -url localhost:4040 -agentconfig store/config.yaml

Build edge agent for robot 2

For building code for robot 2 make sure to set

const robotID = "fb2"

in robot_listner.go, then execute the following command.

$ go build
$ ./swarm-robotics-sensor-data-collection -url localhost:4041 -agentconfig store/config.yam

Build edge agent for robot 3

For building code for robot 3 set

const robotID = "fb3"

in robot_listner.go, then execute the following command.

$ go build
$ ./swarm-robotics-sensor-data-collection -url localhost:4042 -agentconfig store/config.yaml

That's it, we are now setup with the pipeline to read streaming robot data from the simulation.

Now we start the simulation, the steps for starting the simulation we already covered in the previous blog

Once the simulation starts we can log into CockroachDB to see the results stored.

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.

Get started