weixin_39659837
2020-12-27 18:10 阅读 2

Low update rate on Mavros topic

This is only bug and feature tracker, please use it to report bugs or request features.

Issue details

Hello everyone, I'm working on a indoor drone project and recently I noticed something bad: the topics are being updating in a very low rate (less than 1Hz) (including the topic mavros/local_position/pose that is important to control the drone on OFFBOARD mode). It's turning the flight control difficult by setposition topic because the drone doesn't know its correct altitude in real time. When I test this test algorithm (fly 1 meter and hold its position), on Gazebo Simulator, the Mavros topics are updating in a nice rate. In order to verify if the problem is the telemetry system, I tested the information update rate on QGroundControl and when I move the drone, the information are instantaneously updated. Then, I suppose the telemetry system (3DR Radio Link) is not the problem.

I'm launching mavros by this command:

roslaunch mavros px4.launch fcu_url:=/dev/ttyUSB0:57600

If there's a way to solve this problem (high latency on topic updating using telemetry) please tell me.

MAVROS version and platform

Mavros: 0.18.4 ROS: Lunar 1.13.7 Ubuntu: 16.04

Autopilot type and version

[ ] ArduPilot [X] PX4

Version: 3.7.1 (PX4FMU_V3) Pixhawk 2

Node logs

started roslaunch server http://lucas-Inspiron-7460:40689/

SUMMARY

CLEAR PARAMETERS * /mavros/

PARAMETERS * /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/id: 2 * /mavros/distance_sensor/sonar_1_sub/orientation: PITCH_270 * /mavros/distance_sensor/sonar_1_sub/subscriber: True * /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: /dev/ttyUSB0:57600 * /mavros/gcs_url: * /mavros/global_position/child_frame_id: base_link * /mavros/global_position/frame_id: map * /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.000349065850399 * /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/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/mocap/use_pose: True * /mavros/mocap/use_tf: False * /mavros/odometry/estimator_type: 3 * /mavros/odometry/frame_tf/desired_frame: ned * /mavros/plugin_blacklist: ['safety_area', '... * /mavros/plugin_whitelist: ['sys_*', 'comman... * /mavros/px4flow/frame_id: px4flow * /mavros/px4flow/ranger_fov: 0.118682389136 * /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_velocity/mav_frame: LOCAL_NED * /mavros/startup_px4_usb_quirk: True * /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: map * /mavros/vision_pose/tf/listen: False * /mavros/vision_pose/tf/rate_limit: 10.0 * /mavros/vision_speed/listen_twist: False * /rosdistro: lunar * /rosversion: 1.13.7

NODES / mavros (mavros/mavros_node)

auto-starting new master process[master]: started with pid [2541] ROS_MASTER_URI=http://localhost:11311

setting /run_id to 9a6d39f0-3495-11e9-b342-d80f99bfeedd process[rosout-1]: started with pid [2554] started core service [/rosout] process[mavros-2]: started with pid [2558] [ INFO] [1550615282.620918500]: FCU URL: /dev/ttyUSB0:57600 [ INFO] [1550615282.628097425]: serial0: device: /dev/ttyUSB0 @ 57600 bps [ INFO] [1550615282.629657172]: GCS bridge disabled [ INFO] [1550615283.005490453]: Plugin 3dr_radio loaded [ INFO] [1550615283.016262520]: Plugin 3dr_radio initialized [ INFO] [1550615283.016922684]: Plugin actuator_control loaded [ INFO] [1550615283.036063147]: Plugin actuator_control initialized [ INFO] [1550615283.180910744]: Plugin adsb loaded [ INFO] [1550615283.199508913]: Plugin adsb initialized [ INFO] [1550615283.200122246]: Plugin altitude loaded [ INFO] [1550615283.205285741]: Plugin altitude initialized [ INFO] [1550615283.205815126]: Plugin cam_imu_sync loaded [ INFO] [1550615283.209386405]: Plugin cam_imu_sync initialized [ INFO] [1550615283.210240304]: Plugin command loaded [ INFO] [1550615283.225353117]: Plugin command initialized [ INFO] [1550615283.225590836]: Plugin debug_value loaded [ INFO] [1550615283.232669245]: Plugin debug_value initialized [ INFO] [1550615283.232908823]: Plugin distance_sensor loaded [ INFO] [1550615283.253243787]: Plugin distance_sensor initialized [ INFO] [1550615283.253403903]: Plugin fake_gps loaded [ INFO] [1550615283.265462310]: Plugin fake_gps initialized [ INFO] [1550615283.265642850]: Plugin ftp loaded [ INFO] [1550615283.299905247]: Plugin ftp initialized [ INFO] [1550615283.300239115]: Plugin global_position loaded [ INFO] [1550615283.321240791]: Plugin global_position initialized [ INFO] [1550615283.321408172]: Plugin hil loaded [ INFO] [1550615283.333517994]: Plugin hil initialized [ INFO] [1550615283.333663254]: Plugin home_position loaded [ INFO] [1550615283.337023981]: Plugin home_position initialized [ INFO] [1550615283.337177924]: Plugin imu loaded [ INFO] [1550615283.343122555]: Plugin imu initialized [ INFO] [1550615283.343296148]: Plugin local_position loaded [ INFO] [1550615283.348493766]: Plugin local_position initialized [ INFO] [1550615283.348663249]: Plugin manual_control loaded [ INFO] [1550615283.351450564]: Plugin manual_control initialized [ INFO] [1550615283.351582959]: Plugin mocap_pose_estimate loaded [ INFO] [1550615283.355063800]: Plugin mocap_pose_estimate initialized [ INFO] [1550615283.355195144]: Plugin obstacle_distance loaded [ INFO] [1550615283.357456969]: Plugin obstacle_distance initialized [ INFO] [1550615283.357587687]: Plugin odom loaded [ INFO] [1550615283.361565989]: Plugin odom initialized [ INFO] [1550615283.361806653]: Plugin param loaded [ INFO] [1550615283.364534712]: Plugin param initialized [ INFO] [1550615283.364671532]: Plugin px4flow loaded [ INFO] [1550615283.369073140]: Plugin px4flow initialized [ INFO] [1550615283.369111163]: Plugin rangefinder blacklisted [ INFO] [1550615283.369312682]: Plugin rc_io loaded [ INFO] [1550615283.372972026]: Plugin rc_io initialized [ INFO] [1550615283.373003278]: Plugin safety_area blacklisted [ INFO] [1550615283.373167387]: Plugin setpoint_accel loaded [ INFO] [1550615283.376406691]: Plugin setpoint_accel initialized [ INFO] [1550615283.377400233]: Plugin setpoint_attitude loaded [ INFO] [1550615283.389351446]: Plugin setpoint_attitude initialized [ INFO] [1550615283.389534840]: Plugin setpoint_position loaded [ INFO] [1550615283.402243938]: Plugin setpoint_position initialized [ INFO] [1550615283.402416765]: Plugin setpoint_raw loaded [ INFO] [1550615283.411808900]: Plugin setpoint_raw initialized [ INFO] [1550615283.411964755]: Plugin setpoint_velocity loaded [ INFO] [1550615283.422231223]: Plugin setpoint_velocity initialized [ INFO] [1550615283.422505372]: Plugin sys_status loaded [ INFO] [1550615283.432547532]: Plugin sys_status initialized [ INFO] [1550615283.432719677]: Plugin sys_time loaded [ INFO] [1550615283.436368915]: TM: Timesync mode: MAVLINK [ INFO] [1550615283.437101900]: Plugin sys_time initialized [ INFO] [1550615283.437253132]: Plugin vfr_hud loaded [ INFO] [1550615283.439465587]: Plugin vfr_hud initialized [ INFO] [1550615283.439567779]: Plugin vibration blacklisted [ INFO] [1550615283.439755275]: Plugin vision_pose_estimate loaded [ INFO] [1550615283.457540915]: Plugin vision_pose_estimate initialized [ INFO] [1550615283.457703193]: Plugin vision_speed_estimate loaded [ INFO] [1550615283.465478522]: Plugin vision_speed_estimate initialized [ INFO] [1550615283.465761859]: Plugin waypoint loaded [ INFO] [1550615283.474218655]: Plugin waypoint initialized [ INFO] [1550615283.474330396]: Autostarting mavlink via USB on PX4 [ INFO] [1550615283.474477571]: Built-in SIMD instructions: SSE, SSE2 [ INFO] [1550615283.474554361]: Built-in MAVLink package version: 2018.11.11 [ INFO] [1550615283.474614431]: Known MAVLink dialects: common ardupilotmega ASLUAV autoquad icarous matrixpilot paparazzi slugs standard uAvionix ualberta [ INFO] [1550615283.474657310]: MAVROS started. MY ID 1.240, TARGET ID 1.1 [ WARN] [1550615283.817167434]: TM: Clock skew detected (-1550615055.508069277 s). Hard syncing clocks. [ INFO] [1550615283.817390639]: IMU: High resolution IMU detected! [ INFO] [1550615284.254528131]: CON: Got HEARTBEAT, connected. FCU: PX4 Autopilot [ WARN] [1550615284.790526019]: GP: No GPS fix [ INFO] [1550615285.531879261]: VER: 1.1: Capabilities 0x000000000000e4ef [ INFO] [1550615285.531966079]: VER: 1.1: Flight software: 01080000 (000000000A0E09B0) [ INFO] [1550615285.532021496]: VER: 1.1: Middleware software: 01080000 (000000000A0E09B0) [ INFO] [1550615285.532076209]: VER: 1.1: OS software: 071600ff (0000000070141D7D) [ INFO] [1550615285.532125921]: VER: 1.1: Board hardware: 00000011 [ INFO] [1550615285.532166168]: VER: 1.1: VID/PID: 26ac:0011 [ INFO] [1550615285.532211826]: VER: 1.1: UID: 3036511438363834 [ INFO] [1550615285.532544347]: IMU: High resolution IMU detected! [ WARN] [1550615285.594104998]: CMD: Unexpected command 520, result 0 [ WARN] [1550615293.929445061]: TM: Clock skew detected (0.027132136 s). Hard syncing clocks.

Diagnostics

``` header: seq: 2138 stamp: secs: 1550618079 nsecs: 476350000 frame_id: '' status: - level: 0 name: "mavros: FCU connection" message: "connected" hardware_id: "/dev/ttyUSB0:57600" values: - key: "Received packets:" value: "3164" - key: "Dropped packets:" value: "0" - key: "Buffer overruns:" value: "0" - key: "Parse errors:" value: "0" - key: "Rx sequence number:" value: "40" - key: "Tx sequence number:" value: "56" - key: "Rx total bytes:" value: "2350842" - key: "Tx total bytes:" value: "915507" - key: "Rx speed:" value: "661.000000" - key: "Tx speed:" value: "320.000000" - level: 2 name: "mavros: GPS" message: "No satellites" hardware_id: "/dev/ttyUSB0:57600" values: - key: "Satellites visible" value: "0" - key: "Fix type" value: "0" - key: "EPH (m)" value: "99.99" - key: "EPV (m)" value: "99.99" - level: 0 name: "mavros: Heartbeat" message: "Normal" hardware_id: "/dev/ttyUSB0:57600" values: - key: "Heartbeats since startup" value: "2793" - key: "Frequency (Hz)" value: "0.999995" - key: "Vehicle type" value: "Quadrotor" - key: "Autopilot type" value: "PX4 Autopilot" - key: "Mode" value: "MANUAL" - key: "System status" value: "Standby" - level: 0 name: "mavros: System" message: "Normal" hardware_id: "/dev/ttyUSB0:57600" values: - key: "Sensor present" value: "0x00000000" - key: "Sensor enabled" value: "0x00000000" - key: "Sensor helth" value: "0x00000000" - key: "CPU Load (%)" value: "28.8" - key: "Drop rate (%)" value: "0.0" - key: "Errors comm" value: "0" - key: "Errors count #1" value: "0" - key: "Errors count #2" value: "0" - key: "Errors count #3" value: "0" - key: "Errors count #4" value: "0" - level: 0 name: "mavros: Battery" message: "Normal" hardware_id: "/dev/ttyUSB0:57600" values: - key: "Voltage" value: "10.18" - key: "Current" value: "0.0" - key: "Remaining" value: "0.0" - level: 2 name: "mavros: Time Sync" message: "No events recorded." hardware_id: "/dev/ttyUSB0:57600" values: - key: "Timesyncs since startup" value: "0" - key: "Frequency (Hz)" value: "0.000000" - key: "Last dt (ms)" value: "9.376617" - key: "Mean dt (ms)" value: "0.000000" - key: "Last system time (s)" value: "3023.959504000" - key: "Time offset (s)" value: "1550615055.404127836"

Check ID

OK. I got messages from 1:1.

Received 371 messages, from 1 addresses sys:comp list of messages 1:1 0, 1, 36, 230, 32, 105, 74, 141, 77, 111, 241, 147, 245, 4, 24, 132, 106, 30

Thanks for the help!

该提问来源于开源项目:mavlink/mavros

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

7条回答 默认 最新

  • weixin_39559750 weixin_39559750 2020-12-27 18:10

    With that baud rate in that telemetry link it looks perfectly normal that you are getting the data at those rates, considering that the link rate profiles of PX4 for these kind of links are quite low. I would follow https://docs.px4.io/en/peripherals/serial_configuration.html and try to setup your link baud rate to 115200.

    点赞 评论 复制链接分享
  • weixin_39659837 weixin_39659837 2020-12-27 18:10

    Dear TSC21,

    Thank you for reply me.

    I followed what you recommended me but I hadn't success. When I change the link baudrate to 115200, I can't access the drone via telemetry. The QGroundControl only displays: "Waiting for Vehicle Connection". I tried to follow that link you posted here and I changed these parameters (aiming to change the baudrate link):

    SER_TEL1_BAUD - from "57600" to "115200" MAV_0_RATE - from "1200" to "115200" MAV_0_MODE - from "0" to "1" (normal -> custom)

    If there's something wrong in this procedure, please, tell me.

    Thank you very much.

    点赞 评论 复制链接分享
  • weixin_39559750 weixin_39559750 2020-12-27 18:10

    Please bring this matter to PX4 Slack.

    点赞 评论 复制链接分享
  • weixin_39659837 weixin_39659837 2020-12-27 18:10

    I solved this issue just changing the parameter "MAV_0_RATE" (from 1200 (default) to 57600) without change baud rate parameters. Previously I was trying to change the SER_TEL1_BAUD parameter (from 57600 to 115200) but it didn't solve the issue and the telemetry didn't work with this baud rate. Then I tested just the MAV_0_RATE and it worked well.

    点赞 评论 复制链接分享
  • weixin_39528697 weixin_39528697 2020-12-27 18:10

    I solved this issue just changing the parameter "MAV_0_RATE" (from 1200 (default) to 57600) without change baud rate parameters. Previously I was trying to change the SER_TEL1_BAUD parameter (from 57600 to 115200) but it didn't solve the issue and the telemetry didn't work with this baud rate. Then I tested just the MAV_0_RATE and it worked well.

    Hi, how did you go about changing the MAV_0_RATE? I've looked for it in the parameter list in Mission Planner but can't find it.

    点赞 评论 复制链接分享
  • weixin_39659837 weixin_39659837 2020-12-27 18:10

    I solved this issue just changing the parameter "MAV_0_RATE" (from 1200 (default) to 57600) without change baud rate parameters. Previously I was trying to change the SER_TEL1_BAUD parameter (from 57600 to 115200) but it didn't solve the issue and the telemetry didn't work with this baud rate. Then I tested just the MAV_0_RATE and it worked well.

    Hi, how did you go about changing the MAV_0_RATE? I've looked for it in the parameter list in Mission Planner but can't find it.

    It depends on the PX4 version you are running. I accessed this parameter by QGroundControl. You can check the parameters here:

    https://docs.px4.io/v1.9.0/en/advanced_config/parameter_reference.html

    If you are not finding the parameter by QGroundControl I recommend you set this parameter by PX4 command line

    点赞 评论 复制链接分享
  • weixin_39605191 weixin_39605191 2020-12-27 18:10

    For anyone who is still looking for a solution.

    I wanted to increase the publishing rate of Odometry & HIGHRES_IMU messages.

    Here's how I solved this problem:

    1- Increase the baud rate of the serial communication by changing these PX4 parameters on QGroundControl, and then reboot the UAV.

    
    SER_TEL1_BAUD - from "57600" to "115200" 
    MAV_0_RATE - from "1200" to "115200" 
    MAV_0_MODE - from "0" to "1" (normal -> custom) 
    

    References:

    https://docs.px4.io/master/en/peripherals/serial_configuration.html#how-to-configure-a-port

    https://github.com/mavlink/mavros/issues/1182#issuecomment-465672331

    2- Change the rate that Mavlink publishes the ODOMETRY/ HIGHRES_IMU messages in. This can be done by writing this command on the microSD card in PX4. How?

    • Remove the card from Pixhawk and connect to your PC. Then go to ./fs/etc/extras.txt

    • If this directory (or part of it) does not exist, create it. Then, inside extras.txt, we should write:

    
    mavlink stream -d /dev/ttyS0 -s HIGHRES_IMU -r 200 
    mavlink stream -d /dev/ttyS0 -s ODOMETRY -r 200 
    

    Reference: https://dev.px4.io/v1.9.0/en/concept/system_startup.html#starting-additional-applications

    For completeness, here is my setup details:

    MAVROS version and platform

    Mavros: 1.4

    ROS: Melodic

    Ubuntu: 18.04

    Autopilot type and version

    PX4

    Version: v1.10.1

    PX4_FMU_V5 (V500)

    NuttX, v7.29.0

    点赞 评论 复制链接分享