Connecting the Physical Twin with a Digital Shadow
In this example, we demonstrate how the PiCar-X can be connected to a digital shadow. For this purpose, we created a special Docker container that contains a ROS node, which does not send any commands to the physical twin.
Start the Digital Shadow
We assume at this point that the digital shadow runs on a X64 Linux system (e.g. a server).
# Build and execute the Docker Containers
docker compose -f docker-compose-core.yml build
docker compose -f docker-compose-ds.yml build
docker compose -f docker-compose-ds.yml up
Start the Phyiscal Twin
- arm32v7 (RPi3)
- arm64v8 (RPi4)
Execute Commands on the Physical Twin
# Connect to the RaspberryPi
ssh <user>@<picarx-ip>
# SWITCH INTO THE CONTAINER
docker exec -it picar-x-ackermann_skill-pt-1 /bin/bash
# INSIDE CONTAINER
source /root/catkin_ws/devel/picarx_ackermann_drive/setup.bash
# PUBLISH A MESSAGE TO TURN RIGHT WITH 50 percent motor speed
rostopic pub /picarx/drive/command picarx_msgs/Drive "{speed: 50, angle: 20}"