StarlingUAS / ProjectStarling

BRL Flight Arena Infrastructure 2.0
Other
17 stars 3 forks source link

All kubernetes deployments now network host #58

Closed mhl787156 closed 3 years ago

mhl787156 commented 3 years ago

This PR moves the simulation of Gazebo and PX4 SITL to run on host network (192.168.xxx.xxx) instead of on kube network (10.24.xxx.xxx). This ensures transparency between all ros nodes (solving Issue #49 ) on all nodes without requiring DDS discovery servers. The changes include the following:

  1. Gazebo and px4 sitl deployments now have networkhost:true Gazebo now no longer requires the services and displays its own used ports. Px4 deployment px4_sim_host is now localhost and is successful at connecting.
  2. By default if ROS DDS detects two nodes are on the same network, they will use Shared Memory Transport to exchange messages. As the two nodes are not in the same namespace (different pods) this causes communication to fail. Therefore a custom FastRTPS profile is added to all base docker images which deal with ROS: base controller, base gazebo sim, mavros, UI.
rob-clarke commented 3 years ago

It's probably worth keeping an eye on https://github.com/eProsima/Fast-DDS/pull/1801 which, as I understand it, adds some additional ways for FastDDS to distinguish hosts.

This should also allow multiple containers to work without using the shared process namespace thanks to the random number added to the process ID. Adding the process namespace might have a similar effect?