Replace the Physical Twin with a Digital Twin Prototype and Connect it to a Digital Twin
The digital twin prototype can be used to replace the physical twin during development, including its sensors and actuators. The data from these components are provided through a virtual context. This shift from hardware-in-the-loop to software-in-the-loop development enables faster system development and allows for greater collaboration among developers, as it eliminates the need for each person to have their own PiCar-X and avoids the need to take turns using a physical device.
We have three options at this point:
- The digital twin prototype and the digital twin each start separate Gazebo simulations.
- The digital twin prototype includes the Gazebo simulation, while the digital twin is launched without a simulation, displaying all data in the console or a log.
- The digital twin prototype is launched without a simulation, while the digital twin uses a Gazebo simulation to display the model’s behavior based on the incoming data.
Option 1: Start Digital Twin Prototype and Digital Twin with Separate Gazebo Silumation
You need to change the ROS Master Ports on one of the docker compose files, else they will conflict.
Start the Digital Twin with GAZEBO
# Build and execute the Docker Containers
docker compose -f docker-compose-core.yml build
docker compose -f docker-compose-dtsim.yml build
docker compose -f docker-compose-dtsim.yml up
Start the Digital Twin Prototype with GAZEBO
# Build and execute the Docker Containers
docker compose -f docker-compose-core.yml build
docker compose -f docker-compose-dtp.yml build
docker compose -f docker-compose-dtp.yml up
Send Commands from both directions
- Commands on the DTP
- Commands from the DT
Option 2: Only the Digital Twin Prototype starts a simulation
Start the Digital Twin without GAZEBO
# Build and execute the Docker Containers
docker compose -f docker-compose-core.yml build
docker compose -f docker-compose-dt.yml build
docker compose -f docker-compose-dt.yml up
Start the Digital Twin Prototype with GAZEBO
# Build and execute the Docker Containers
docker compose -f docker-compose-core.yml build
docker compose -f docker-compose-dtp.yml build
docker compose -f docker-compose-dtp.yml up
Print all Incoming Commands on the Digital Twin
- Subscribe to Status on DT
- Commands from the DTP
Option 3: Only the Digital Twin starts a simulation
Start the Digital Twin with GAZEBO
# Build and execute the Docker Containers
docker compose -f docker-compose-core.yml build
docker compose -f docker-compose-dtsim.yml build
docker compose -f docker-compose-dtsim.yml up
Start the Digital Twin Prototype without GAZEBO
# Build and execute the Docker Containers
docker compose -f docker-compose-core.yml build
docker compose -f docker-compose-dtp-no-gazebo.yml build
docker compose -f docker-compose-dtp-no-gazebo.yml up
Print all Incoming Commands on the Digital Twin Prototype
- Subscribe to Commands on the DTP
- Commands from the DT