I have 2 flight controller, pixhawk 6x
and pixhawk 6x Pro
with different system IDs sys_id:1
and sys_id:2
connected to my laptop via type-C cable I want to connect mavros to both flight controller with different namespaces I am running mavproxy as follows
mavproxy.py --master=/dev/ttyACM0 --baudrate=57600 --master=/dev/ttyACM1 --baudrate=57600 --out udp:127.0.0.1:14550 --out udp:127.0.0.1:14551 --out udp:127.0.0.1:14552 --out udp:127.0.0.1:14553 --out udp:127.0.0.1:14554 --out udp:127.0.0.1:14555 --out udp:127.0.0.1:14556 --out udp:127.0.0.1:14557 --out udp:127.0.0.1:14558 --out udp:127.0.0.1:14559
I have the following mavros launch file
<launch>
<group ns="uav1">
<node pkg="mavros" type="mavros_node" name="mavros" required="true" clear_params="true">
<param name="fcu_url" value="udp://:14558@"/>
<param name="gcs_url" value="" />
<param name="target_system_id" value="1" />
<param name="target_component_id" value="1" />
<param name="fcu_protocol" value="v2.0" />
</node>
</group>
<group ns="uav2">
<node pkg="mavros" type="mavros_node" name="mavros" required="true" clear_params="true">
<param name="fcu_url" value="udp://:14559@"/>
<param name="gcs_url" value="" />
<param name="target_system_id" value="2" />
<param name="target_component_id" value="1" />
<param name="fcu_protocol" value="v2.0" />
</node>
</group>
</launch>
Name spacing <group ns="uav1">
<group ns="uav2">
works correctly here is my topic list
/diagnostics
/move_base_simple/goal
/rosout
/rosout_agg
/tf
/tf_static
/uav1/mavlink/from
/uav1/mavlink/gcs_ip
/uav1/mavlink/to
/uav1/mavros/actuator_control
/uav1/mavros/adsb/send
/uav1/mavros/adsb/vehicle
/uav1/mavros/altitude
/uav1/mavros/battery
/uav1/mavros/cam_imu_sync/cam_imu_stamp
/uav1/mavros/camera/image_captured
/uav1/mavros/cellular_status/status
/uav1/mavros/companion_process/status
/uav1/mavros/debug_value/debug
/uav1/mavros/debug_value/debug_float_array
/uav1/mavros/debug_value/debug_vector
/uav1/mavros/debug_value/named_value_float
/uav1/mavros/debug_value/named_value_int
/uav1/mavros/debug_value/send
/uav1/mavros/esc_info
/uav1/mavros/esc_status
/uav1/mavros/esc_telemetry
/uav1/mavros/estimator_status
/uav1/mavros/extended_state
/uav1/mavros/fake_gps/mocap/tf
/uav1/mavros/geofence/waypoints
/uav1/mavros/global_position/compass_hdg
/uav1/mavros/global_position/global
/uav1/mavros/global_position/gp_lp_offset
/uav1/mavros/global_position/gp_origin
/uav1/mavros/global_position/local
/uav1/mavros/global_position/raw/fix
/uav1/mavros/global_position/raw/gps_vel
/uav1/mavros/global_position/raw/satellites
/uav1/mavros/global_position/rel_alt
/uav1/mavros/global_position/set_gp_origin
/uav1/mavros/gps_input/gps_input
/uav1/mavros/gps_rtk/rtk_baseline
/uav1/mavros/gps_rtk/send_rtcm
/uav1/mavros/gpsstatus/gps1/raw
/uav1/mavros/gpsstatus/gps1/rtk
/uav1/mavros/gpsstatus/gps2/raw
/uav1/mavros/gpsstatus/gps2/rtk
/uav1/mavros/hil/actuator_controls
/uav1/mavros/hil/controls
/uav1/mavros/hil/gps
/uav1/mavros/hil/imu_ned
/uav1/mavros/hil/optical_flow
/uav1/mavros/hil/rc_inputs
/uav1/mavros/hil/state
/uav1/mavros/home_position/home
/uav1/mavros/home_position/set
/uav1/mavros/imu/data
/uav1/mavros/imu/data_raw
/uav1/mavros/imu/diff_pressure
/uav1/mavros/imu/mag
/uav1/mavros/imu/static_pressure
/uav1/mavros/imu/temperature_baro
/uav1/mavros/imu/temperature_imu
/uav1/mavros/landing_target/lt_marker
/uav1/mavros/landing_target/pose
/uav1/mavros/landing_target/pose_in
/uav1/mavros/local_position/accel
/uav1/mavros/local_position/odom
/uav1/mavros/local_position/pose
/uav1/mavros/local_position/pose_cov
/uav1/mavros/local_position/velocity_body
/uav1/mavros/local_position/velocity_body_cov
/uav1/mavros/local_position/velocity_local
/uav1/mavros/log_transfer/raw/log_data
/uav1/mavros/log_transfer/raw/log_entry
/uav1/mavros/mag_calibration/report
/uav1/mavros/mag_calibration/status
/uav1/mavros/manual_control/control
/uav1/mavros/manual_control/send
/uav1/mavros/mission/reached
/uav1/mavros/mission/waypoints
/uav1/mavros/mocap/pose
/uav1/mavros/mount_control/command
/uav1/mavros/mount_control/orientation
/uav1/mavros/mount_control/status
/uav1/mavros/nav_controller_output
/uav1/mavros/obstacle/send
/uav1/mavros/odometry/in
/uav1/mavros/odometry/out
/uav1/mavros/onboard_computer/status
/uav1/mavros/param/param_value
/uav1/mavros/play_tune
/uav1/mavros/px4flow/ground_distance
/uav1/mavros/px4flow/raw/optical_flow_rad
/uav1/mavros/px4flow/raw/send
/uav1/mavros/px4flow/temperature
/uav1/mavros/radio_status
/uav1/mavros/rallypoint/waypoints
/uav1/mavros/rangefinder/rangefinder
/uav1/mavros/rc/in
/uav1/mavros/rc/out
/uav1/mavros/rc/override
/uav1/mavros/safety_area/get
/uav1/mavros/safety_area/set
/uav1/mavros/setpoint_accel/accel
/uav1/mavros/setpoint_attitude/cmd_vel
/uav1/mavros/setpoint_attitude/thrust
/uav1/mavros/setpoint_position/global
/uav1/mavros/setpoint_position/global_to_local
/uav1/mavros/setpoint_position/local
/uav1/mavros/setpoint_raw/attitude
/uav1/mavros/setpoint_raw/global
/uav1/mavros/setpoint_raw/local
/uav1/mavros/setpoint_raw/target_attitude
/uav1/mavros/setpoint_raw/target_global
/uav1/mavros/setpoint_raw/target_local
/uav1/mavros/setpoint_trajectory/desired
/uav1/mavros/setpoint_trajectory/local
/uav1/mavros/setpoint_velocity/cmd_vel
/uav1/mavros/setpoint_velocity/cmd_vel_unstamped
/uav1/mavros/state
/uav1/mavros/statustext/recv
/uav1/mavros/statustext/send
/uav1/mavros/sys_status
/uav1/mavros/target_actuator_control
/uav1/mavros/terrain/report
/uav1/mavros/time_reference
/uav1/mavros/timesync_status
/uav1/mavros/trajectory/desired
/uav1/mavros/trajectory/generated
/uav1/mavros/trajectory/path
/uav1/mavros/tunnel/in
/uav1/mavros/tunnel/out
/uav1/mavros/vfr_hud
/uav1/mavros/vibration/raw/vibration
/uav1/mavros/vision_pose/pose
/uav1/mavros/vision_pose/pose_cov
/uav1/mavros/vision_speed/speed_twist_cov
/uav1/mavros/wind_estimation
/uav2/mavlink/from
/uav2/mavlink/gcs_ip
/uav2/mavlink/to
/uav2/mavros/actuator_control
/uav2/mavros/adsb/send
/uav2/mavros/adsb/vehicle
/uav2/mavros/altitude
/uav2/mavros/battery
/uav2/mavros/cam_imu_sync/cam_imu_stamp
/uav2/mavros/camera/image_captured
/uav2/mavros/cellular_status/status
/uav2/mavros/companion_process/status
/uav2/mavros/debug_value/debug
/uav2/mavros/debug_value/debug_float_array
/uav2/mavros/debug_value/debug_vector
/uav2/mavros/debug_value/named_value_float
/uav2/mavros/debug_value/named_value_int
/uav2/mavros/debug_value/send
/uav2/mavros/esc_info
/uav2/mavros/esc_status
/uav2/mavros/esc_telemetry
/uav2/mavros/estimator_status
/uav2/mavros/extended_state
/uav2/mavros/fake_gps/mocap/tf
/uav2/mavros/geofence/waypoints
/uav2/mavros/global_position/compass_hdg
/uav2/mavros/global_position/global
/uav2/mavros/global_position/gp_lp_offset
/uav2/mavros/global_position/gp_origin
/uav2/mavros/global_position/local
/uav2/mavros/global_position/raw/fix
/uav2/mavros/global_position/raw/gps_vel
/uav2/mavros/global_position/raw/satellites
/uav2/mavros/global_position/rel_alt
/uav2/mavros/global_position/set_gp_origin
/uav2/mavros/gps_input/gps_input
/uav2/mavros/gps_rtk/rtk_baseline
/uav2/mavros/gps_rtk/send_rtcm
/uav2/mavros/gpsstatus/gps1/raw
/uav2/mavros/gpsstatus/gps1/rtk
/uav2/mavros/gpsstatus/gps2/raw
/uav2/mavros/gpsstatus/gps2/rtk
/uav2/mavros/hil/actuator_controls
/uav2/mavros/hil/controls
/uav2/mavros/hil/gps
/uav2/mavros/hil/imu_ned
/uav2/mavros/hil/optical_flow
/uav2/mavros/hil/rc_inputs
/uav2/mavros/hil/state
/uav2/mavros/home_position/home
/uav2/mavros/home_position/set
/uav2/mavros/imu/data
/uav2/mavros/imu/data_raw
/uav2/mavros/imu/diff_pressure
/uav2/mavros/imu/mag
/uav2/mavros/imu/static_pressure
/uav2/mavros/imu/temperature_baro
/uav2/mavros/imu/temperature_imu
/uav2/mavros/landing_target/lt_marker
/uav2/mavros/landing_target/pose
/uav2/mavros/landing_target/pose_in
/uav2/mavros/local_position/accel
/uav2/mavros/local_position/odom
/uav2/mavros/local_position/pose
/uav2/mavros/local_position/pose_cov
/uav2/mavros/local_position/velocity_body
/uav2/mavros/local_position/velocity_body_cov
/uav2/mavros/local_position/velocity_local
/uav2/mavros/log_transfer/raw/log_data
/uav2/mavros/log_transfer/raw/log_entry
/uav2/mavros/mag_calibration/report
/uav2/mavros/mag_calibration/status
/uav2/mavros/manual_control/control
/uav2/mavros/manual_control/send
/uav2/mavros/mission/reached
/uav2/mavros/mission/waypoints
/uav2/mavros/mocap/pose
/uav2/mavros/mount_control/command
/uav2/mavros/mount_control/orientation
/uav2/mavros/mount_control/status
/uav2/mavros/nav_controller_output
/uav2/mavros/obstacle/send
/uav2/mavros/odometry/in
/uav2/mavros/odometry/out
/uav2/mavros/onboard_computer/status
/uav2/mavros/param/param_value
/uav2/mavros/play_tune
/uav2/mavros/px4flow/ground_distance
/uav2/mavros/px4flow/raw/optical_flow_rad
/uav2/mavros/px4flow/raw/send
/uav2/mavros/px4flow/temperature
/uav2/mavros/radio_status
/uav2/mavros/rallypoint/waypoints
/uav2/mavros/rangefinder/rangefinder
/uav2/mavros/rc/in
/uav2/mavros/rc/out
/uav2/mavros/rc/override
/uav2/mavros/safety_area/get
/uav2/mavros/safety_area/set
/uav2/mavros/setpoint_accel/accel
/uav2/mavros/setpoint_attitude/cmd_vel
/uav2/mavros/setpoint_attitude/thrust
/uav2/mavros/setpoint_position/global
/uav2/mavros/setpoint_position/global_to_local
/uav2/mavros/setpoint_position/local
/uav2/mavros/setpoint_raw/attitude
/uav2/mavros/setpoint_raw/global
/uav2/mavros/setpoint_raw/local
/uav2/mavros/setpoint_raw/target_attitude
/uav2/mavros/setpoint_raw/target_global
/uav2/mavros/setpoint_raw/target_local
/uav2/mavros/setpoint_trajectory/desired
/uav2/mavros/setpoint_trajectory/local
/uav2/mavros/setpoint_velocity/cmd_vel
/uav2/mavros/setpoint_velocity/cmd_vel_unstamped
/uav2/mavros/state
/uav2/mavros/statustext/recv
/uav2/mavros/statustext/send
/uav2/mavros/sys_status
/uav2/mavros/target_actuator_control
/uav2/mavros/terrain/report
/uav2/mavros/time_reference
/uav2/mavros/timesync_status
/uav2/mavros/trajectory/desired
/uav2/mavros/trajectory/generated
/uav2/mavros/trajectory/path
/uav2/mavros/tunnel/in
/uav2/mavros/tunnel/out
/uav2/mavros/vfr_hud
/uav2/mavros/vibration/raw/vibration
/uav2/mavros/vision_pose/pose
/uav2/mavros/vision_pose/pose_cov
/uav2/mavros/vision_speed/speed_twist_cov
/uav2/mavros/wind_estimation
But when I echo
rostopic echo /uav1/mavros/local_position/pose
I get the following message.
If you see the messages both /uav1/mavros/local_position/pose
and /uav2/mavros/local_position/pose
messages overlap with each other. Here is the first two value of x position from the topic /uav1/mavros/local_position/pose
x: -0.02916666865348816
x: 0.6490780711174011
Following is the terminal output of /uav1/mavros/local_position/pose
header:
seq: 23467
stamp:
secs: 1745242413
nsecs: 858835888
frame_id: "map"
pose:
position:
x: -0.02916666865348816
y: -1.0611013174057007
z: -1.0445711612701416
orientation:
x: 0.039457300056732
y: -0.005572988216542397
z: -0.9531153649868769
w: 0.29997214422822266
---
header:
seq: 23468
stamp:
secs: 1745242413
nsecs: 881462920
frame_id: "map"
pose:
position:
x: 0.6490780711174011
y: -0.6993603110313416
z: -2.2235171794891357
orientation:
x: 0.03941784928943679
y: -0.0055809552879999705
z: -0.9531168822734233
w: 0.29997239710931367
---
header:
seq: 23469
stamp:
secs: 1745242413
nsecs: 896319553
frame_id: "map"
pose:
position:
x: -0.029160529375076294
y: -1.061104655265808
z: -1.0442824363708496
orientation:
x: 0.03938852430249632
y: -0.005581104119058774
z: -0.9531175355495751
w: 0.29997410405667835
both flight controller data on same topic /uav1/mavros/local_position/pose
same for /uav2/mavros/local_position/pose