Skip to content

Multiple SITL instances on one host connecting to multiple MicroXRCEAgent on different IPs #26560

@JacopoPan

Description

@JacopoPan

Describe problem solved by the proposed feature

I have a setup here where I run:

  • Gazebo and N PX4 SITL instances in one Docker container
  • and I want to connect them to N MicroXRCEAgents (each one in its own separate Docker container)

Each container has its own IP (using docker network) and ROS_DOMAIN_ID

The main motivation is isolating the multi-drone "simulation" (Gazebo + NxSITL) from the "deployable" edge compute autonomy using separate containers

Describe your preferred solution

Right now, I achieve this with

PX4_SYS_AUTOSTART=<%= autostart %> ROS_DOMAIN_ID=<%= drone_id %> 
PX4_UXRCE_DDS_NS="Drone<%= drone_id %>" PX4_UXRCE_DDS_AG_IP=<%= "#{sim_subnet}.90.#{drone_id}" %> PX4_UXRCE_DDS_PORT=8888
/PX4-Autopilot/build/px4_sitl_default/bin/px4 -i <%= sitl_instance %>

and adding a new env variable PX4_UXRCE_DDS_AG_IP here

uxrce_dds_client start -t udp -p $uxrce_dds_port $uxrce_dds_ns

like this

uxrce_dds_client start -t udp -h "${PX4_UXRCE_DDS_AG_IP:-127.0.0.1}" -p $uxrce_dds_port $uxrce_dds_ns

Describe possible alternatives

I'm not sure if this could be done natively/differently and/or more concisely modifying

# set default IP to localhost
param set-default UXRCE_DDS_AG_IP 2130706433 # 127.0.0.1

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions