Docker with static ip and outward connection

Hello I am trying to create a docker container that is able to commnunicate with a robotic arm through ethernet.
I have look at the networking documentation but aside from assigning an ip to the docker I have not been able to create a connection.

The docker container is run on an Nvidia Jetson AGV Xavier. An embedded device with ARM.

From what I understand I can assign the docker to an overlay network that I need to create first. These were the commands that I used:

sudo docker swarm init
sudo docker network create -d overlay --subnet=192.168.2.0/25 --aux-address="[MYNETWORK]=192.168.2.11" --attachable [MYNETWORK]
sudo docker run -it --net=[MYNETWORK] --ip=192.168.2.11 [MYDOCKER]

This runs the docker with an ip of 192.168.2.11 and I can confirm that it has an outgoing connection when I ping google.com for instance, however I am not able to ping my robot which is connected with ip 192.168.2.10 on a direct ethernet cable.

I am able to ping the robot when I place my windows system in the proper range.
What my question comes down to is:
Is the failing of the docker to ping the robot caused by something i misconfigured? Is it possible to connect docker to other device, feel a little stupid for asking this? Or should I look for the issue in my ubuntu system and have that in the same ip range also?

With kind regards

Creating an overlay network with the very same ip-range your local lan has, is a good intention, though it is not going to be good, because it will not magicly work as a switc that bridges your overlay network into your local lan.

Did you try to connect your robot from a container connected to an uncustomized overlay network? The container should be able to communicate with the robot.

Thank you for taking the time to reply. I did manage to connect to the robot from my docker container by configuring the host ip address and leaving the docker network out of the equation. I am not sure if this is what you mean with the last part but this will work for use.

It was not. But then again: whatever works!