Closed mhl787156 closed 3 years ago
StatefulSet generates an ordinal which is exposed through the pod name. The pod name is used as pod hostname. The ordinal itself is not stored so must be parsed from either VEHICLE_NAMESPACE or hostname. hostname was decided in order to reduce differences between px4 and mavros container setup.
Most recent update has two core changes:
PX4_SYSID_SITL_BASE
to set lowest SYSID allocated to SITL. Currently defaults to 150 in sitl.DockerfilePX4_INSTANCE
is set to PX4_SYSID_SITL_BASE + ORDINAL - 1
. The -1
is required in order to align with Mavros target_idMAVROS_TGT_SYSTEM_BASE
set to lowest tgt value. Default is zero set in Mavros Dockerfile. For SITL purposes, this is set identical to PX4_SYSID_SITL_BASE
in the k8 config fileMAVROS_TGT_SYSTEM
is set to PX4_SYSID_SITL_BASE + ORDINAL
This PR implements automatic SYSID allocation for multi-robot applications. it is still WIP. It contains the following
PX4_INSTANCE
mavros_setup.sh
modifiesMAVROS_TGT_SYSTEM
. If it is zero, first a lookup (to be implemented) to /etc/drone.config will be conducted, if no such file exists, it falls back to setting by ip address.xacro_launch.sh
is injected into ros.env.d of the iris Dockerfile. This script generates an sdf model file with the mavlink_tcp_port set to PX4_SITL_PORT which should be 4560 + px4instance. It is saved in /tmp//scripts/
for ease of testingProblems:
Example controller needs to manually specify vehicle through newly added TARGET_SYSTEM environment variable.Now solved with a launch script which autodetects mavros topics being broadcast and runs an example controller for each instance.TODO: