weixin_39849153
2020-12-28 09:32 阅读 4

mavros connection problem

I've tried to connect from Raspberry Pi 2 running Xbuntu and using an USB to UART (Not FTDI) to pixhawk lateset firmware (updated through QGroundControl) through TELEM2. The sys_companion parameter has been set to 57600 (didn't use 921600 since I have never gotten a connection this way).

Now, there are 3 possible outcomes when I use roslaunch mavros px4.launch (I've also edited the launch file to connect to USB0 and baud rate to 57600). 1.Never gets heartbeat The program gets stuck at MAVROS started. MY ID [1, 240], TARGET ID [1, 1]

2.Still no heart beat, but got this IMU thing, then program gets stuck again MAVROS started. MY ID [1, 240], TARGET ID [1, 1] IMU: High resolution IMU detected!

3.Gets heartbeat, but has an error forcing an exit symbol lookup error: /home/odroid/catkin_ws/devel/lib//libmavros_plugins.so: undefined symbol: _ZN3ros8DurationC1ERKNS_4RateE

Here is one of the diagnostics


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: 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/ttyUSB0:57600
    values: 
      - 
        key: Voltage
        value: -1.00
      - 
        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: 0.000000
      - 
        key: Mean dt (ms)
        value: 0.000000
      - 
        key: Last system time (s)
        value: 0.000000000
      - 
        key: Time offset (s)
        value: 0.000000000

---
header: 
  seq: 41
  stamp: 
    secs: 1450752094
    nsecs: 865901608
  frame_id: ''
status: 
  - 
    level: 1
    name: mavros: FCU connection
    message: not connected
    hardware_id: /dev/ttyUSB0:57600
    values: 
      - 
        key: Received packets:
        value: 0
      - 
        key: Dropped packets:
        value: 0
      - 
        key: Buffer overruns:
        value: 0
      - 
        key: Parse errors:
        value: 0
      - 
        key: Rx sequence number:
        value: 0
      - 
        key: Tx sequence number:
        value: 46
      - 
        key: Rx total bytes:
        value: 35816
      - 
        key: Tx total bytes:
        value: 12915
      - 
        key: Rx speed:
        value: 722.000000
      - 
        key: Tx speed:
        value: 277.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: Unknown
      - 
        key: EPV (m)
        value: Unknown
  - 
    level: 2
    name: mavros: Heartbeat
    message: No events recorded.
    hardware_id: /dev/ttyUSB0:57600
    values: 
      - 
        key: Heartbeats since startup
        value: 0
      - 
        key: Frequency (Hz)
        value: 0.000000
      - 
        key: Vehicle type
        value: Generic
      - 
        key: Autopilot type
        value: Generic
      - 
        key: Mode
        value: ''
      - 
        key: System status
        value: Uninit
  - 
    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: 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/ttyUSB0:57600
    values: 
      - 
        key: Voltage
        value: -1.00
      - 
        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: 0.000000
      - 
        key: Mean dt (ms)
        value: 0.000000
      - 
        key: Last system time (s)
        value: 0.000000000
      - 
        key: Time offset (s)
        value: 0.000000000

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

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

8条回答 默认 最新

  • weixin_39553653 weixin_39553653 2020-12-28 09:32

    Check your hardware connection on TELEM2 (1) to USB bridge (2): Tx1-Rx2, Rx1-Tx2, GND1-GND2.

    Then use terminal program (e.g. miniterm.py from python-serial) to verify that pix sending something (data is unreadable binary stream). Then check connection URL and diagnostics.

    But by your diagnostics i may say that seems pix sending in other protocol than mavlink. Or baud rate mismatches.

    Also you may use strace and socat for debugging.

    点赞 评论 复制链接分享
  • weixin_39643865 weixin_39643865 2020-12-28 09:32

    Hello ,

    I have been having the same issue as mentioned above

    1.Never gets heartbeat The program gets stuck at MAVROS started. MY ID [1, 240], TARGET ID [1, 1].

    i have checked my connections multiple times and its exactly as shown in the pictures. Any solution ??

    Thank you

    Raghu.

    点赞 评论 复制链接分享
  • weixin_39643865 weixin_39643865 2020-12-28 09:32

    Hello, It connected! . a reboot worked. weird!.

    点赞 评论 复制链接分享
  • weixin_39943442 weixin_39943442 2020-12-28 09:32

    hello,i have a question.how to change the baud from 57600 to 115200.

    点赞 评论 复制链接分享
  • weixin_39925959 weixin_39925959 2020-12-28 09:32

    Hi, I am facing a problem. I am using mavros 0.23.3 and ros kinetic setup on an odroid, I am connecting a pixracer via USB. Upon launching the mavros node, I am not able to get the hearbeat connection. I even tried setting the SYS_COMPANION parameter to 921600 as recommended and also did a reboot, but it doesnt seem to be working.

    点赞 评论 复制链接分享
  • weixin_39925959 weixin_39925959 2020-12-28 09:32

    Hi, I am facing a problem. I am using mavros 0.23.3 and ros kinetic setup on an odroid, I am connecting a pixracer via USB. Upon launching the mavros node, I am not able to get the hearbeat connection. I even tried setting the SYS_COMPANION parameter to 921600 as recommended and also did a reboot, but it doesn't seem to be working.

    点赞 评论 复制链接分享
  • weixin_39629352 weixin_39629352 2020-12-28 09:32

    You cannot have QGC to automatically connect to the FCU. Go to QGC settings and disable the option to connect to the Pixhawk and the SiK Radio. And launch: rosrun mavros mavros_node _fcu_url:=/dev/ttyACM0:921600 _gcs_url:=udp-b://127.0.0.1:14555 This works for me.

    点赞 评论 复制链接分享
  • weixin_39622980 weixin_39622980 2020-12-28 09:32

    it is definitely the baud rate, i had the exact same problem even after checking with the rqt_runtime_monitor , my port was correct, the only reason it was not working was due to a mismatch in baud rate, changed it to 115200 and it started working perfectly fine . Hope it helps someone .

    点赞 评论 复制链接分享