weixin_39587822
2020-12-26 11:07 阅读 7

Mavros connection problem to APM

Issue details

Hi, i am using Pixhack loaded with APM firmware with Rasberry Pi 3 as an onboard computer. It seems that I can't publish mavlink message (setpoint_raw) to APM using MAVROS and the only mavlink message I am able to get from APM is /mavros/state.
Does anybody have a suggestion for me? Thanks a lot in advance!

MAVROS version and platform

Mavros: installed from binary pacakge. "sudo apt-get install ros-kinetic-mavros ros-kinetic-mavros-extras" ROS: Kinetic Ubuntu Mate: 16.04

Autopilot type and version

ArduPilot 3.4

Node logs

Command: roslaunch mavros apm.launch fcu_url:=/dev/ttyAMA0:57600


... logging to /home/ubuntu/.ros/log/309d55c8-edd9-11e6-9d3d-b827ebcda65a/roslaunch-ubuntu-8122.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://192.168.1.199  :34121/

SUMMARY
========

CLEAR PARAMETERS
 * /mavros/

PARAMETERS
 * /mavros/cmd/use_comp_id_system_control: False
 * /mavros/conn/heartbeat_rate: 1.0
 * /mavros/conn/system_time_rate: 0.0
 * /mavros/conn/timeout: 10.0
 * /mavros/conn/timesync_rate: 0.0
 * /mavros/fcu_url: /dev/ttyAMA0:57600
 * /mavros/gcs_url: 
 * /mavros/global_position/frame_id: fcu
 * /mavros/global_position/rot_covariance: 99999.0
 * /mavros/global_position/tf/child_frame_id: fcu_utm
 * /mavros/global_position/tf/frame_id: local_origin
 * /mavros/global_position/tf/send: False
 * /mavros/image/frame_id: px4flow
 * /mavros/imu/angular_velocity_stdev: 0.000349065850399
 * /mavros/imu/frame_id: fcu
 * /mavros/imu/linear_acceleration_stdev: 0.0003
 * /mavros/imu/magnetic_stdev: 0.0
 * /mavros/imu/orientation_stdev: 1.0
 * /mavros/local_position/frame_id: fcu
 * /mavros/local_position/tf/child_frame_id: fcu
 * /mavros/local_position/tf/frame_id: local_origin
 * /mavros/local_position/tf/send: False
 * /mavros/mission/pull_after_gcs: True
 * /mavros/mocap/use_pose: True
 * /mavros/mocap/use_tf: False
 * /mavros/plugin_blacklist: ['actuator_contro...
 * /mavros/plugin_whitelist: []
 * /mavros/px4flow/frame_id: px4flow
 * /mavros/px4flow/ranger_fov: 0.0
 * /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_throttle: False
 * /mavros/setpoint_attitude/tf/child_frame_id: attitude
 * /mavros/setpoint_attitude/tf/frame_id: local_origin
 * /mavros/setpoint_attitude/tf/listen: False
 * /mavros/setpoint_attitude/tf/rate_limit: 10.0
 * /mavros/setpoint_position/tf/child_frame_id: setpoint
 * /mavros/setpoint_position/tf/frame_id: local_origin
 * /mavros/setpoint_position/tf/listen: False
 * /mavros/setpoint_position/tf/rate_limit: 50.0
 * /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/vibration/frame_id: vibration
 * /mavros/vision_pose/tf/child_frame_id: vision
 * /mavros/vision_pose/tf/frame_id: local_origin
 * /mavros/vision_pose/tf/listen: False
 * /mavros/vision_pose/tf/rate_limit: 10.0
 * /mavros/vision_speed/listen_twist: False
 * /rosdistro: kinetic
 * /rosversion: 1.12.6

NODES
  /
    mavros (mavros/mavros_node)

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

setting /run_id to 309d55c8-edd9-11e6-9d3d-b827ebcda65a
process[rosout-1]: started with pid [8146]
started core service [/rosout]
process[mavros-2]: started with pid [8164]
[ INFO]: FCU URL: /dev/ttyAMA0:57600
[ WARN]: init: message from ASLUAV, MSG-ID 201 ignored! Table has different entry.
[ WARN]: init: message from autoquad, MSG-ID 150 ignored! Table has different entry.
[ WARN]: init: message from autoquad, MSG-ID 152 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 150 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 151 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 152 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 153 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 155 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 156 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 157 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 158 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 170 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 171 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 172 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 173 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 174 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 175 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 176 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 177 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 178 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 179 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 180 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 181 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 182 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 183 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 184 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 185 ignored! Table has different entry.
[ WARN]: init: message from matrixpilot, MSG-ID 186 ignored! Table has different entry.
[ WARN]: init: message from paparazzi, MSG-ID 180 ignored! Table has different entry.
[ WARN]: init: message from paparazzi, MSG-ID 181 ignored! Table has different entry.
[ WARN]: init: message from paparazzi, MSG-ID 182 ignored! Table has different entry.
[ WARN]: init: message from paparazzi, MSG-ID 183 ignored! Table has different entry.
[ WARN]: init: message from paparazzi, MSG-ID 184 ignored! Table has different entry.
[ WARN]: init: message from slugs, MSG-ID 170 ignored! Table has different entry.
[ WARN]: init: message from slugs, MSG-ID 172 ignored! Table has different entry.
[ WARN]: init: message from slugs, MSG-ID 173 ignored! Table has different entry.
[ WARN]: init: message from slugs, MSG-ID 176 ignored! Table has different entry.
[ WARN]: init: message from slugs, MSG-ID 177 ignored! Table has different entry.
[ WARN]: init: message from slugs, MSG-ID 179 ignored! Table has different entry.
[ WARN]: init: message from slugs, MSG-ID 180 ignored! Table has different entry.
[ WARN]: init: message from slugs, MSG-ID 181 ignored! Table has different entry.
[ WARN]: init: message from slugs, MSG-ID 184 ignored! Table has different entry.
[ WARN]: init: message from slugs, MSG-ID 185 ignored! Table has different entry.
[ WARN]: init: message from slugs, MSG-ID 186 ignored! Table has different entry.
[ WARN]: init: message from slugs, MSG-ID 188 ignored! Table has different entry.
[ WARN]: init: message from slugs, MSG-ID 191 ignored! Table has different entry.
[ WARN]: init: message from slugs, MSG-ID 192 ignored! Table has different entry.
[ WARN]: init: message from slugs, MSG-ID 193 ignored! Table has different entry.
[ WARN]: init: message from slugs, MSG-ID 194 ignored! Table has different entry.
[ INFO]: serial0: device: /dev/ttyAMA0 @ 57600 bps
[ INFO]: GCS bridge disabled
[ INFO]: Plugin 3dr_radio loaded
[ INFO]: Plugin 3dr_radio initialized
[ INFO]: Plugin actuator_control blacklisted
[ INFO]: Plugin altitude blacklisted
[ INFO]: Plugin cam_imu_sync loaded
[ INFO]: Plugin cam_imu_sync initialized
[ INFO]: Plugin command loaded
[ INFO]: Plugin command initialized
[ INFO]: Plugin distance_sensor blacklisted
[ INFO]: Plugin ftp blacklisted
[ INFO]: Plugin global_position loaded
[ INFO]: Plugin global_position initialized
[ INFO]: Plugin hil_actuator_controls loaded
[ INFO]: Plugin hil_actuator_controls initialized
[ INFO]: Plugin hil_controls loaded
[ INFO]: Plugin hil_controls initialized
[ INFO]: Plugin imu_pub loaded
[ INFO]: Plugin imu_pub initialized
[ INFO]: Plugin local_position loaded
[ INFO]: Plugin local_position initialized
[ INFO]: Plugin manual_control loaded
[ INFO]: Plugin manual_control initialized
[ INFO]: Plugin mocap_fake_gps blacklisted
[ INFO]: Plugin mocap_pose_estimate blacklisted
[ INFO]: Plugin param loaded
[ INFO]: Plugin param initialized
[ INFO]: Plugin px4flow blacklisted
[ INFO]: Plugin rc_io loaded
[ INFO]: Plugin rc_io initialized
[ INFO]: Plugin safety_area blacklisted
[ INFO]: Plugin setpoint_accel loaded
[ INFO]: Plugin setpoint_accel initialized
[ INFO]: Plugin setpoint_attitude blacklisted
[ INFO]: Plugin setpoint_position loaded
[ INFO]: Plugin setpoint_position initialized
[ INFO]: Plugin setpoint_raw loaded
[ INFO]: Plugin setpoint_raw initialized
[ INFO]: Plugin setpoint_velocity loaded
[ INFO]: Plugin setpoint_velocity initialized
[ INFO]: Plugin sys_status loaded
[ INFO]: Plugin sys_status initialized
[ INFO]: Plugin sys_time loaded
[ INFO]: Plugin sys_time initialized
[ INFO]: Plugin vfr_hud loaded
[ INFO]: Plugin vfr_hud initialized
[ INFO]: Plugin vibration blacklisted
[ INFO]: Plugin vision_pose_estimate blacklisted
[ INFO]: Plugin vision_speed_estimate blacklisted
[ INFO]: Plugin waypoint loaded
[ INFO]: Plugin waypoint initialized
[ INFO]: Built-in SIMD instructions: None
[ INFO]: Built-in MAVLink package version: 2016.12.12
[ INFO]: Known MAVLink dialects: common ardupilotmega ASLUAV autoquad matrixpilot paparazzi slugs standard uAvionix ualberta
[ INFO]: MAVROS started. MY ID 1.240, TARGET ID 1.1
[ INFO]: CON: Got HEARTBEAT, connected. FCU: ArduPilotMega / ArduCopter
[ WARN]: VER: broadcast request timeout, retries left 4
[ WARN]: VER: broadcast request timeout, retries left 3
[ WARN]: VER: unicast request timeout, retries left 2
[ WARN]: PR: request list timeout, retries left 2
[ WARN]: PR: request list timeout, retries left 1
[ WARN]: PR: request list timeout, retries left 0
[ WARN]: VER: unicast request timeout, retries left 1
[ WARN]: WP: timeout, retries left 2
[ WARN]: WP: timeout, retries left 1
[ WARN]: WP: timeout, retries left 0
[ERROR]: WP: timed out.
[ WARN]: VER: unicast request timeout, retries left 0
[ WARN]: VER: your FCU don't support AUTOPILOT_VERSION, switched to default capabilities

Diagnostics


header: 
  seq: 172
  stamp: 
    secs: 1486543005
    nsecs: 661088393
  frame_id: ''
status: 
  - 
    level: 0
    name: mavros: FCU connection
    message: connected
    hardware_id: /dev/ttyAMA0:57600
    values: 
      - 
        key: Received packets:
        value: 227
      - 
        key: Dropped packets:
        value: 0
      - 
        key: Buffer overruns:
        value: 0
      - 
        key: Parse errors:
        value: 0
      - 
        key: Rx sequence number:
        value: 161
      - 
        key: Tx sequence number:
        value: 241
      - 
        key: Rx total bytes:
        value: 3859
      - 
        key: Tx total bytes:
        value: 4209
      - 
        key: Rx speed:
        value: 17.000000
      - 
        key: Tx speed:
        value: 34.000000
  - 
    level: 2
    name: mavros: GPS
    message: No satellites
    hardware_id: /dev/ttyAMA0:57600
    values: 
      - 
        key: Satellites visible
        value: 0
      - 
        key: Fix type
        value: 0
      - 
        key: EPH (m)
        value: Unknown
      - 
        key: EPV (m)
        value: Unknown
  - 
    level: 0
    name: mavros: Heartbeat
    message: Normal
    hardware_id: /dev/ttyAMA0:57600
    values: 
      - 
        key: Heartbeats since startup
        value: 226
      - 
        key: Frequency (Hz)
        value: 1.000004
      - 
        key: Vehicle type
        value: Quadrotor
      - 
        key: Autopilot type
        value: ArduPilotMega / ArduCopter
      - 
        key: Mode
        value: STABILIZE
      - 
        key: System status
        value: Standby
  - 
    level: 0
    name: mavros: System
    message: Normal
    hardware_id: /dev/ttyAMA0:57600
    values: 
      - 
        key: Sensor present
        value: 0x00000000
      - 
        key: Sensor enabled
        value: 0x00000000
      - 
        key: Sensor helth
        value: 0x00000000
      - 
        key: CPU Load (%)
        value: 0.0
      - 
        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: 2
    name: mavros: Battery
    message: No data
    hardware_id: /dev/ttyAMA0:57600
    values: 
      - 
        key: Voltage
        value: -1.00
      - 
        key: Current
        value: 0.0
      - 
        key: Remaining
        value: 0

Check ID


OK. I got messages from 1:1.

---
Received 15 messages, from 1 addresses
sys:comp   list of messages
  1:1     0

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

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

5条回答 默认 最新

  • weixin_39553653 weixin_39553653 2020-12-26 11:07

    Check wiring! Looks like has broken Pi Tx -> Pix Rx.

    点赞 评论 复制链接分享
  • weixin_39587822 weixin_39587822 2020-12-26 11:07

    Thanks , In the end I found out it was because we power the rasberry Pi and Pixhack separately and they do not share a common ground..... Stupid mistake. You can close this issue now.

    点赞 评论 复制链接分享
  • weixin_39626298 weixin_39626298 2020-12-26 11:07

    Excuse me. I am a student working on the same project, but I got this error all the time. I reboot the Companion computer and APM many times, but still doesn't work(I have already configured baud rate of Telem1 in apmplanner).This problem confuse me for a week.

    $ roslaunch mavros apm2.launch fcu_url:=/dev/ttyAMA0:57600

    [ INFO] [1494332048.454563862]: GCS URL: udp://@ [ERROR] [1494332048.454735631]: serial0: receive: End of file terminate called after throwing an instance of 'std::system_error' what(): Resource deadlock avoided ================================================================================REQUIRED process [mavros-1] has died! process has died [pid 5719, exit code -6, cmd /opt/ros/kinetic/lib/mavros/mavros_node __name:=mavros __log:=/home/pi/.ros/log/a9df75fc-317b-11e7-ab17-b827ebf230df/mavros-1.log]. log file: /home/pi/.ros/log/a9df75fc-317b-11e7-ab17-b827ebf230df/mavros-1*.log Initiating shutdown! ================================================================================

    i use ROS: Kinetic Ubuntu Mate: 16.04 in raspberrypi3 with APM2.6

    点赞 评论 复制链接分享
  • weixin_39559750 weixin_39559750 2020-12-26 11:07

    did you follow http://ardupilot.org/dev/docs/raspberry-pi-via-mavlink.html until the "Testing the connection" topic? And please this in not related to the presented issue. Please open a new one

    点赞 评论 复制链接分享
  • weixin_39626298 weixin_39626298 2020-12-26 11:07

    I'm sorry. I'm a newbie here and thanks for your suggestion. I will follow this tutorial first. But I'm using ubuntu isn't it different?

    点赞 评论 复制链接分享