diff --git a/skel/Desktop/simulated-drone/docker-compose.yaml b/skel/Desktop/simulated-drone/docker-compose.yaml index b13e3e1..9235962 100644 --- a/skel/Desktop/simulated-drone/docker-compose.yaml +++ b/skel/Desktop/simulated-drone/docker-compose.yaml @@ -4,7 +4,7 @@ version: "3.8" services: mavros: image: git.spirirobotics.com/spiri/services-ros1-mavros:master - command: roslaunch mavros px4.launch fcu_url:="udp://:14555@host.docker.internal:${MAVLINK_SIM_PORT:-14550}" + command: roslaunch mavros px4.launch fcu_url:="udp://:${MAVROS_SIM_FCU_PORT}@127.0.0.1:${MAVROS_SIM_GCS_PORT:-14557}" tgt_system:=${DRONE_SYS_ID:-1} environment: - "ROS_MASTER_URI=http://ros-master:${ROS_MASTER_PORT:-11311}" depends_on: @@ -19,6 +19,9 @@ services: nofile: soft: 1024 hard: 524288 + ports: + - "${MAVROS_SIM_FCU_PORT:-14540}:${MAVROS_SIM_FCU_PORT:-14540}/udp" + - "${MAVROS_SIM_GCS_PORT:-14557}:${MAVROS_SIM_GCS_PORT:-14557}/udp" ros-master: image: git.spirirobotics.com/spiri/services-ros1-core:main diff --git a/skel/Desktop/simulated-drone/sim_drone.py b/skel/Desktop/simulated-drone/sim_drone.py index 5fa40d8..b3cd37e 100755 --- a/skel/Desktop/simulated-drone/sim_drone.py +++ b/skel/Desktop/simulated-drone/sim_drone.py @@ -112,7 +112,9 @@ def start(sys_id: int = 1): PX4_GZ_MODEL_POSE=os.environ.get("PX4_GZ_MODEL_POSE") or f"0,{(sys_id-1)}", PX4_INSTANCE="intance_id", ROS_MASTER_PORT=str(11310 + sys_id), - MAVLINK_SIM_PORT=str(14549 + sys_id), + MAVROS_SIM_GCS_PORT=str(14556 + sys_id), + MAVROS_SIM_FCU_PORT=str(14539 + sys_id), + DRONE_SYS_ID=str(sys_id), ): instance_id = sys_id - 1 # PX4 will add 1 to the instance ID to get sysID px4Instance = px4(