How do I connect MAVROS to PX4 with UDP ports?
-
Hi,
My end goal is to get PX4 on my drone to listen to MAVROS messages.
I tried running the command
roslaunch mavros px4.launch fcu_url:="udp://127.0.0.1:14560@127.0.0.1:14551"
and then I run the commandrostopic echo /mavros/state/
to see if the connection works. When I runrostopic echo /mavros/state/
sometimes I get either no response and I have to stop it with CTRL+C.In voxl-vision-hub.conf, I have
"en_localhost_mavlink_udp": true,
Do you guys know what I've done wrong? How can I get the
roslaunch mavros px4.launch fcu_url:="udp://127.0.0.1:14560@127.0.0.1:14551"
command to work?Here is what I get when I run
roslaunch mavros px4.launch fcu_url:="udp://127.0.0.1:14560@127.0.0.1:14551"
. Maybe this can provide some guidance:`... logging to /home/root/.ros/log/587e1f04-3972-11ef-af96-00c0cab5aba2/roslaunch-m0054-3978.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.started roslaunch server http://m0054:44561/
SUMMARY
CLEAR PARAMETERS
- /mavros/
PARAMETERS
- /mavros/camera/frame_id: base_link
- /mavros/cmd/use_comp_id_system_control: False
- /mavros/conn/heartbeat_rate: 1.0
- /mavros/conn/system_time_rate: 1.0
- /mavros/conn/timeout: 10.0
- /mavros/conn/timesync_rate: 10.0
- /mavros/distance_sensor/hrlv_ez4_pub/field_of_view: 0.0
- /mavros/distance_sensor/hrlv_ez4_pub/frame_id: hrlv_ez4_sonar
- /mavros/distance_sensor/hrlv_ez4_pub/id: 0
- /mavros/distance_sensor/hrlv_ez4_pub/orientation: PITCH_270
- /mavros/distance_sensor/hrlv_ez4_pub/send_tf: True
- /mavros/distance_sensor/hrlv_ez4_pub/sensor_position/x: 0.0
- /mavros/distance_sensor/hrlv_ez4_pub/sensor_position/y: 0.0
- /mavros/distance_sensor/hrlv_ez4_pub/sensor_position/z: -0.1
- /mavros/distance_sensor/laser_1_sub/id: 3
- /mavros/distance_sensor/laser_1_sub/orientation: PITCH_270
- /mavros/distance_sensor/laser_1_sub/subscriber: True
- /mavros/distance_sensor/lidarlite_pub/field_of_view: 0.0
- /mavros/distance_sensor/lidarlite_pub/frame_id: lidarlite_laser
- /mavros/distance_sensor/lidarlite_pub/id: 1
- /mavros/distance_sensor/lidarlite_pub/orientation: PITCH_270
- /mavros/distance_sensor/lidarlite_pub/send_tf: True
- /mavros/distance_sensor/lidarlite_pub/sensor_position/x: 0.0
- /mavros/distance_sensor/lidarlite_pub/sensor_position/y: 0.0
- /mavros/distance_sensor/lidarlite_pub/sensor_position/z: -0.1
- /mavros/distance_sensor/sonar_1_sub/horizontal_fov_ratio: 1.0
- /mavros/distance_sensor/sonar_1_sub/id: 2
- /mavros/distance_sensor/sonar_1_sub/orientation: PITCH_270
- /mavros/distance_sensor/sonar_1_sub/subscriber: True
- /mavros/distance_sensor/sonar_1_sub/vertical_fov_ratio: 1.0
- /mavros/fake_gps/eph: 2.0
- /mavros/fake_gps/epv: 2.0
- /mavros/fake_gps/fix_type: 3
- /mavros/fake_gps/geo_origin/alt: 408.0
- /mavros/fake_gps/geo_origin/lat: 47.3667
- /mavros/fake_gps/geo_origin/lon: 8.55
- /mavros/fake_gps/gps_rate: 5.0
- /mavros/fake_gps/mocap_transform: True
- /mavros/fake_gps/satellites_visible: 5
- /mavros/fake_gps/tf/child_frame_id: fix
- /mavros/fake_gps/tf/frame_id: map
- /mavros/fake_gps/tf/listen: False
- /mavros/fake_gps/tf/rate_limit: 10.0
- /mavros/fake_gps/tf/send: False
- /mavros/fake_gps/use_mocap: True
- /mavros/fake_gps/use_vision: False
- /mavros/fcu_protocol: v2.0
- /mavros/fcu_url: udp://127.0.0.1:1...
- /mavros/gcs_url:
- /mavros/global_position/child_frame_id: base_link
- /mavros/global_position/frame_id: map
- /mavros/global_position/gps_uere: 1.0
- /mavros/global_position/rot_covariance: 99999.0
- /mavros/global_position/tf/child_frame_id: base_link
- /mavros/global_position/tf/frame_id: map
- /mavros/global_position/tf/global_frame_id: earth
- /mavros/global_position/tf/send: False
- /mavros/global_position/use_relative_alt: True
- /mavros/image/frame_id: px4flow
- /mavros/imu/angular_velocity_stdev: 0.0003490659 // 0...
- /mavros/imu/frame_id: base_link
- /mavros/imu/linear_acceleration_stdev: 0.0003
- /mavros/imu/magnetic_stdev: 0.0
- /mavros/imu/orientation_stdev: 1.0
- /mavros/landing_target/camera/fov_x: 2.0071286398
- /mavros/landing_target/camera/fov_y: 2.0071286398
- /mavros/landing_target/image/height: 480
- /mavros/landing_target/image/width: 640
- /mavros/landing_target/land_target_type: VISION_FIDUCIAL
- /mavros/landing_target/listen_lt: False
- /mavros/landing_target/mav_frame: LOCAL_NED
- /mavros/landing_target/target_size/x: 0.3
- /mavros/landing_target/target_size/y: 0.3
- /mavros/landing_target/tf/child_frame_id: camera_center
- /mavros/landing_target/tf/frame_id: landing_target
- /mavros/landing_target/tf/listen: False
- /mavros/landing_target/tf/rate_limit: 10.0
- /mavros/landing_target/tf/send: True
- /mavros/local_position/frame_id: map
- /mavros/local_position/tf/child_frame_id: base_link
- /mavros/local_position/tf/frame_id: map
- /mavros/local_position/tf/send: False
- /mavros/local_position/tf/send_fcu: False
- /mavros/mission/pull_after_gcs: True
- /mavros/mission/use_mission_item_int: True
- /mavros/mocap/use_pose: True
- /mavros/mocap/use_tf: False
- /mavros/mount/debounce_s: 4.0
- /mavros/mount/err_threshold_deg: 10.0
- /mavros/mount/negate_measured_pitch: False
- /mavros/mount/negate_measured_roll: False
- /mavros/mount/negate_measured_yaw: False
- /mavros/odometry/fcu/odom_child_id_des: base_link
- /mavros/odometry/fcu/odom_parent_id_des: map
- /mavros/plugin_blacklist: ['safety_area', '...
- /mavros/plugin_whitelist: []
- /mavros/px4flow/frame_id: px4flow
- /mavros/px4flow/ranger_fov: 0.118682
- /mavros/px4flow/ranger_max_range: 5.0
- /mavros/px4flow/ranger_min_range: 0.3
- /mavros/safety_area/p1/x: 1.0
- /mavros/safety_area/p1/y: 1.0
- /mavros/safety_area/p1/z: 1.0
- /mavros/safety_area/p2/x: -1.0
- /mavros/safety_area/p2/y: -1.0
- /mavros/safety_area/p2/z: -1.0
- /mavros/setpoint_accel/send_force: False
- /mavros/setpoint_attitude/reverse_thrust: False
- /mavros/setpoint_attitude/tf/child_frame_id: target_attitude
- /mavros/setpoint_attitude/tf/frame_id: map
- /mavros/setpoint_attitude/tf/listen: False
- /mavros/setpoint_attitude/tf/rate_limit: 50.0
- /mavros/setpoint_attitude/use_quaternion: False
- /mavros/setpoint_position/mav_frame: LOCAL_NED
- /mavros/setpoint_position/tf/child_frame_id: target_position
- /mavros/setpoint_position/tf/frame_id: map
- /mavros/setpoint_position/tf/listen: False
- /mavros/setpoint_position/tf/rate_limit: 50.0
- /mavros/setpoint_raw/thrust_scaling: 1.0
- /mavros/setpoint_velocity/mav_frame: LOCAL_NED
- /mavros/startup_px4_usb_quirk: False
- /mavros/sys/disable_diag: False
- /mavros/sys/min_voltage: 10.0
- /mavros/target_component_id: 1
- /mavros/target_system_id: 1
- /mavros/tdr_radio/low_rssi: 40
- /mavros/time/time_ref_source: fcu
- /mavros/time/timesync_avg_alpha: 0.6
- /mavros/time/timesync_mode: MAVLINK
- /mavros/vibration/frame_id: base_link
- /mavros/vision_pose/tf/child_frame_id: vision_estimate
- /mavros/vision_pose/tf/frame_id: odom
- /mavros/vision_pose/tf/listen: False
- /mavros/vision_pose/tf/rate_limit: 10.0
- /mavros/vision_speed/listen_twist: True
- /mavros/vision_speed/twist_cov: True
- /mavros/wheel_odometry/child_frame_id: base_link
- /mavros/wheel_odometry/count: 2
- /mavros/wheel_odometry/frame_id: odom
- /mavros/wheel_odometry/send_raw: True
- /mavros/wheel_odometry/send_twist: False
- /mavros/wheel_odometry/tf/child_frame_id: base_link
- /mavros/wheel_odometry/tf/frame_id: odom
- /mavros/wheel_odometry/tf/send: False
- /mavros/wheel_odometry/use_rpm: False
- /mavros/wheel_odometry/vel_error: 0.1
- /mavros/wheel_odometry/wheel0/radius: 0.05
- /mavros/wheel_odometry/wheel0/x: 0.0
- /mavros/wheel_odometry/wheel0/y: -0.15
- /mavros/wheel_odometry/wheel1/radius: 0.05
- /mavros/wheel_odometry/wheel1/x: 0.0
- /mavros/wheel_odometry/wheel1/y: 0.15
- /rosdistro: melodic
- /rosversion: 1.14.13
NODES
/
mavros (mavros/mavros_node)auto-starting new master
process[master]: started with pid [3992]
ROS_MASTER_URI=http://localhost:11311setting /run_id to 587e1f04-3972-11ef-af96-00c0cab5aba2
process[rosout-1]: started with pid [4003]
started core service [/rosout]
process[mavros-2]: started with pid [4011]
[ INFO] [1720034875.774184619]: FCU URL: udp://127.0.0.1:14560@127.0.0.1:14551
[ INFO] [1720034875.778019723]: udp0: Bind address: 127.0.0.1:14560
[ INFO] [1720034875.778069411]: udp0: Remote address: 127.0.0.1:14551
[ INFO] [1720034875.778128421]: GCS bridge disabled
[ INFO] [1720034875.786959775]: Plugin 3dr_radio loaded
[ INFO] [1720034875.788031754]: Plugin 3dr_radio initialized
[ INFO] [1720034875.788097223]: Plugin actuator_control loaded
[ INFO] [1720034875.789775036]: Plugin actuator_control initialized
[ INFO] [1720034875.793380088]: Plugin adsb loaded
[ INFO] [1720034875.806434306]: Plugin adsb initialized
[ INFO] [1720034875.806548786]: Plugin altitude loaded
[ INFO] [1720034875.809585452]: Plugin altitude initialized
[ INFO] [1720034875.809666286]: Plugin cam_imu_sync loaded
[ INFO] [1720034875.817432015]: Plugin cam_imu_sync initialized
[ INFO] [1720034875.818696858]: Plugin camera loaded
[ INFO] [1720034875.820721442]: Plugin camera initialized
[ INFO] [1720034875.820930088]: Plugin cellular_status loaded
[ INFO] [1720034875.824257327]: Plugin cellular_status initialized
[ INFO] [1720034875.824446442]: Plugin command loaded
[ INFO] [1720034875.833272223]: Plugin command initialized
[ INFO] [1720034875.833472744]: Plugin companion_process_status loaded
[ INFO] [1720034875.837013525]: Plugin companion_process_status initialized
[ INFO] [1720034875.837201858]: Plugin debug_value loaded
[ INFO] [1720034875.844404150]: Plugin debug_value initialized
[ INFO] [1720034875.844493213]: Plugin distance_sensor blacklisted
[ INFO] [1720034875.844678890]: Plugin esc_status loaded
[ INFO] [1720034875.846252796]: Plugin esc_status initialized
[ INFO] [1720034875.846446494]: Plugin esc_telemetry loaded
[ INFO] [1720034875.847439463]: Plugin esc_telemetry initialized
[ INFO] [1720034875.847668629]: Plugin fake_gps loaded
[ INFO] [1720034875.862576494]: Plugin fake_gps initialized
[ INFO] [1720034875.862743108]: Plugin ftp loaded
[ INFO] [1720034875.868335504]: Plugin ftp initialized
[ INFO] [1720034875.868468942]: Plugin geofence loaded
[ INFO] [1720034875.871055244]: Plugin geofence initialized
[ INFO] [1720034875.871183890]: Plugin global_position loaded
[ INFO] [1720034875.880378994]: Plugin global_position initialized
[ INFO] [1720034875.880466598]: Plugin gps_input loaded
[ INFO] [1720034875.881994671]: Plugin gps_input initialized
[ INFO] [1720034875.882074463]: Plugin gps_rtk loaded
[ INFO] [1720034875.883738733]: Plugin gps_rtk initialized
[ INFO] [1720034875.883831702]: Plugin gps_status loaded
[ INFO] [1720034875.885728942]: Plugin gps_status initialized
[ INFO] [1720034875.885808056]: Plugin guided_target loaded
[ INFO] [1720034875.888165296]: Plugin guided_target initialized
[ INFO] [1720034875.888255608]: Plugin hil loaded
[ INFO] [1720034875.894711494]: Plugin hil initialized
[ INFO] [1720034875.895299931]: Plugin home_position loaded
[ INFO] [1720034875.897735504]: Plugin home_position initialized
[ INFO] [1720034875.897820765]: Plugin imu loaded
[ INFO] [1720034875.905221233]: Plugin imu initialized
[ INFO] [1720034875.905759567]: Plugin landing_target loaded
[ INFO] [1720034875.914256806]: Plugin landing_target initialized
[ INFO] [1720034875.914359515]: Plugin local_position loaded
[ INFO] [1720034875.922657536]: Plugin local_position initialized
[ INFO] [1720034875.923111806]: Plugin log_transfer loaded
[ INFO] [1720034875.925616963]: Plugin log_transfer initialized
[ INFO] [1720034875.925694515]: Plugin mag_calibration_status loaded
[ INFO] [1720034875.928898369]: Plugin mag_calibration_status initialized
[ INFO] [1720034875.928985556]: Plugin manual_control loaded
[ INFO] [1720034875.931920036]: Plugin manual_control initialized
[ INFO] [1720034875.932013577]: Plugin mocap_pose_estimate loaded
[ INFO] [1720034875.934142744]: Plugin mocap_pose_estimate initialized
[ INFO] [1720034875.934243317]: Plugin mount_control loaded
[ WARN] [1720034875.937349463]: Could not retrive negate_measured_roll parameter value, using default (0)
[ WARN] [1720034875.937620817]: Could not retrive negate_measured_pitch parameter value, using default (0)
[ WARN] [1720034875.937873056]: Could not retrive negate_measured_yaw parameter value, using default (0)
[ WARN] [1720034875.938745869]: Could not retrive debounce_s parameter value, using default (4.000000)
[ WARN] [1720034875.939002744]: Could not retrive err_threshold_deg parameter value, using default (10.000000)
[ INFO] [1720034875.939233629]: Plugin mount_control initialized
[ INFO] [1720034875.939775088]: Plugin nav_controller_output loaded
[ INFO] [1720034875.940403733]: Plugin nav_controller_output initialized
[ INFO] [1720034875.940500869]: Plugin obstacle_distance loaded
[ INFO] [1720034875.942063108]: Plugin obstacle_distance initialized
[ INFO] [1720034875.942141806]: Plugin odom loaded
[ INFO] [1720034875.944601129]: Plugin odom initialized
[ INFO] [1720034875.944678733]: Plugin onboard_computer_status loaded
[ INFO] [1720034875.945881442]: Plugin onboard_computer_status initialized
[ INFO] [1720034875.945968317]: Plugin param loaded
[ INFO] [1720034875.947392379]: Plugin param initialized
[ INFO] [1720034875.947470713]: Plugin play_tune loaded
[ INFO] [1720034875.948681077]: Plugin play_tune initialized
[ INFO] [1720034875.948758421]: Plugin px4flow loaded
[ INFO] [1720034875.952277119]: Plugin px4flow initialized
[ INFO] [1720034875.952368317]: Plugin rallypoint loaded
[ INFO] [1720034875.953838942]: Plugin rallypoint initialized
[ INFO] [1720034875.953881963]: Plugin rangefinder blacklisted
[ INFO] [1720034875.953956129]: Plugin rc_io loaded
[ INFO] [1720034875.958129150]: Plugin rc_io initialized
[ INFO] [1720034875.958164931]: Plugin safety_area blacklisted
[ INFO] [1720034875.958345504]: Plugin setpoint_accel loaded
[ INFO] [1720034875.960882744]: Plugin setpoint_accel initialized
[ INFO] [1720034875.960975140]: Plugin setpoint_attitude loaded
[ INFO] [1720034875.965657119]: Plugin setpoint_attitude initialized
[ INFO] [1720034875.966128994]: Plugin setpoint_position loaded
[ INFO] [1720034875.979281650]: Plugin setpoint_position initialized
[ INFO] [1720034875.979597692]: Plugin setpoint_raw loaded
[ INFO] [1720034875.988543421]: Plugin setpoint_raw initialized
[ INFO] [1720034875.988656598]: Plugin setpoint_trajectory loaded
[ INFO] [1720034875.996899358]: Plugin setpoint_trajectory initialized
[ INFO] [1720034875.997014515]: Plugin setpoint_velocity loaded
[ INFO] [1720034876.008902692]: Plugin setpoint_velocity initialized
[ INFO] [1720034876.009045296]: Plugin sys_status loaded
[ INFO] [1720034876.017746858]: Plugin sys_status initialized
[ INFO] [1720034876.017867223]: Plugin sys_time loaded
[ INFO] [1720034876.021094254]: TM: Timesync mode: MAVLINK
[ INFO] [1720034876.025475400]: TM: Not publishing sim time
[ INFO] [1720034876.026241963]: Plugin sys_time initialized
[ INFO] [1720034876.026339723]: Plugin terrain loaded
[ INFO] [1720034876.026709150]: Plugin terrain initialized
[ INFO] [1720034876.026795921]: Plugin trajectory loaded
[ INFO] [1720034876.029857275]: Plugin trajectory initialized
[ INFO] [1720034876.029946442]: Plugin tunnel loaded
[ INFO] [1720034876.031674567]: Plugin tunnel initialized
[ INFO] [1720034876.031766702]: Plugin vfr_hud loaded
[ INFO] [1720034876.032100765]: Plugin vfr_hud initialized
[ INFO] [1720034876.032145713]: Plugin vibration blacklisted
[ INFO] [1720034876.032214983]: Plugin vision_pose_estimate loaded
[ INFO] [1720034876.036746598]: Plugin vision_pose_estimate initialized
[ INFO] [1720034876.036831077]: Plugin vision_speed_estimate loaded
[ INFO] [1720034876.038851233]: Plugin vision_speed_estimate initialized
[ INFO] [1720034876.038944619]: Plugin waypoint loaded
[ INFO] [1720034876.041435713]: Plugin waypoint initialized
[ INFO] [1720034876.041480660]: Plugin wheel_odometry blacklisted
[ INFO] [1720034876.041566233]: Plugin wind_estimation loaded
[ INFO] [1720034876.044150296]: Plugin wind_estimation initialized
[ INFO] [1720034876.044288838]: Built-in SIMD instructions: ARM NEON
[ INFO] [1720034876.044343473]: Built-in MAVLink package version: 2022.12.30
[ INFO] [1720034876.044360973]: Known MAVLink dialects: common ardupilotmega ASLUAV AVSSUAS all cubepilot development icarous matrixpilot paparazzi standard storm32 uAvionix ualberta
[ INFO] [1720034876.044389983]: MAVROS started. MY ID 1.240, TARGET ID 1.1`