weixin_39975486
2020-12-27 18:10 阅读 1

Mavros request fail issue

Hello. I'm trying to connect pixhawk to Nvidia jetson TX1 board. I installed ROS Indigo including mavros on TX1. However, everytime I try to use command:$ mavros mavsys mode -c OFFBOARD, it says mavros request fail. When I type $dmesg


[ 8812.276651] usb 1-3.4: new full-speed USB device number 14 using tegra-xhci
[ 8812.301674] usb 1-3.4: string descriptor 0 malformed (err = 2), defaulting to 0x0409
[ 8812.312785] usb 1-3.4: New USB device found, idVendor=26ac, idProduct=0011
[ 8812.312910] usb 1-3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 8812.313012] usb 1-3.4: Product: PX4 BL FMU v2.x
[ 8812.313103] usb 1-3.4: Manufacturer: 3D Robotics
[ 8812.313189] usb 1-3.4: SerialNumber: 0
[ 8812.317142] usb 1-3.4: ep 0x83 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[ 8812.320313] cdc_acm 1-3.4:1.0: This device cannot do calls on its own. It is not a modem.
[ 8812.330279] cdc_acm 1-3.4:1.0: ttyACM0: USB ACM device

So I set fcu_url value to /dev/ttyACM0:57600 in my px4.launch file as below.


<launch>
        <!-- vim: set ft=xml noet : -->
        <!-- example launch script for PX4 based FCU's -->

        <arg name="fcu_url" default="/dev/ttyACM0:57600"></arg>
        <arg name="gcs_url" default=""></arg>
        <arg name="tgt_system" default="1"></arg>
        <arg name="tgt_component" default="1"></arg>
        <arg name="log_output" default="screen"></arg>

        <include file="$(find mavros)/launch/node.launch">
                <arg name="pluginlists_yaml" value="$(find mavros)/launch/px4_pluginlists.yaml"></arg>
                <arg name="config_yaml" value="$(find mavros)/launch/px4_config.yaml"></arg>

                <arg name="fcu_url" value="$(arg fcu_url)"></arg>
                <arg name="gcs_url" value="$(arg gcs_url)"></arg>
                <arg name="tgt_system" value="$(arg tgt_system)"></arg>
                <arg name="tgt_component" value="$(arg tgt_component)"></arg>
                <arg name="log_output" value="$(arg log_output)"></arg>
        </include>
</launch>

After then, I run roscore and roslaunch mavros px4.launch


ubuntu-ubuntu:~/ros_catkin_ws/install_isolated/share/mavros/launch$ roslaunch mavros px4.launch
... logging to /home/ubuntu/.ros/log/896a075a-7d95-11e6-9e8c-00044b5809b8/roslaunch-tegra-ubuntu-1295.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.0.21:33842/

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: ROLL_180
 * /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: ROLL_180
 * /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: ROLL_180
 * /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: ROLL_180
 * /mavros/distance_sensor/sonar_1_sub/subscriber: True
 * /mavros/fcu_url: /dev/ttyACM0: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/local_position/tf/send_fcu: False
 * /mavros/mission/pull_after_gcs: True
 * /mavros/mocap/use_pose: True
 * /mavros/mocap/use_tf: False
 * /mavros/plugin_blacklist: ['safety_area', '...
 * /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: 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/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: indigo
 * /rosversion: 1.11.20

NODES
  /
    mavros (mavros/mavros_node)

ROS_MASTER_URI=http://192.168.0.21:11311

core service [/rosout] found
process[mavros-1]: started with pid [1329]
[ INFO] [1474199232.933956237]: FCU URL: /dev/ttyACM0:57600
[ INFO] [1474199232.934397689]: serial0: device: /dev/ttyACM0 @ 57600 bps
[ INFO] [1474199233.013188434]: GCS bridge disabled
[ INFO] [1474199233.136606797]: Plugin 3dr_radio loaded and initialized
[ INFO] [1474199233.147394097]: Plugin actuator_control loaded and initialized
[ INFO] [1474199233.151594092]: Plugin altitude loaded and initialized
[ INFO] [1474199233.416842076]: Plugin cam_imu_sync loaded and initialized
[ INFO] [1474199233.433452526]: Plugin command loaded and initialized
[ INFO] [1474199233.433578462]: Plugin distance_sensor blacklisted
[ INFO] [1474199233.459200976]: Plugin ftp loaded and initialized
[ INFO] [1474199233.485126506]: Plugin global_position loaded and initialized
[ INFO] [1474199233.487630222]: Plugin hil_controls loaded and initialized
[ INFO] [1474199233.487717616]: Plugin image_pub blacklisted
[ INFO] [1474199233.511452135]: Plugin imu_pub loaded and initialized
[ INFO] [1474199233.531940397]: Plugin local_position loaded and initialized
[ INFO] [1474199233.534377811]: Plugin manual_control loaded and initialized
[ INFO] [1474199233.549304534]: Plugin mocap_pose_estimate loaded and initialized
[ INFO] [1474199233.557574213]: Plugin param loaded and initialized
[ INFO] [1474199233.575298032]: Plugin px4flow loaded and initialized
[ INFO] [1474199233.588493060]: Plugin rc_io loaded and initialized
[ INFO] [1474199233.588586444]: Plugin safety_area blacklisted
[ INFO] [1474199233.600930025]: Plugin setpoint_accel loaded and initialized
[ INFO] [1474199233.641511189]: Plugin setpoint_attitude loaded and initialized
[ INFO] [1474199233.661666017]: Plugin setpoint_position loaded and initialized
[ INFO] [1474199233.694834938]: Plugin setpoint_raw loaded and initialized
[ INFO] [1474199233.704689855]: Plugin setpoint_velocity loaded and initialized
[ INFO] [1474199233.724599062]: Plugin sys_status loaded and initialized
[ INFO] [1474199233.736115519]: Plugin sys_time loaded and initialized
[ INFO] [1474199233.740434731]: Plugin vfr_hud loaded and initialized
[ INFO] [1474199233.740528115]: Plugin vibration blacklisted
[ INFO] [1474199233.769315690]: Plugin vision_pose_estimate loaded and initialized
[ INFO] [1474199233.782049265]: Plugin vision_speed_estimate loaded and initialized
[ INFO] [1474199233.794921798]: Plugin waypoint loaded and initialized
[ INFO] [1474199233.795055129]: Autostarting mavlink via USB on PX4
[ INFO] [1474199233.795149972]: Built-in SIMD instructions: None
[ INFO] [1474199233.795204867]: Built-in MAVLink package version: 2016.5.20
[ INFO] [1474199233.795247418]: Built-in MAVLink dialect: ardupilotmega
[ INFO] [1474199233.795292522]: MAVROS started. MY ID 1.240, TARGET ID 1.1

These are what I got. It does not seem to receive heartbeat. When I type 'rosrun mavros mavsys mode -c OFFBOARD' in this state, it says "Request failed. Check mavros logs".

I check dignostics message via rostopic echo -n1 /diagnostics


header: 
  seq: 116
  stamp: 
    secs: 1474199385
    nsecs: 298692825
  frame_id: ''
status: 
  - 
    level: 1

    name: mavros: FCU connection
    message: not connected
    hardware_id: /dev/ttyACM0:57600
    values: 
      - 
        key: Received packets:
        value: 195
      - 
        key: Dropped packets:
        value: 0
      - 
        key: Buffer overruns:
        value: 0
      - 
        key: Parse errors:
        value: 0
      - 
        key: Rx sequence number:
        value: 97
      - 
        key: Tx sequence number:
        value: 25
      - 
        key: Rx total bytes:
        value: 8116
      - 
        key: Tx total bytes:
        value: 41976
      - 
        key: Rx speed:
        value: 0.000000
      - 
        key: Tx speed:
        value: 397.000000
  - 
    level: 2

    name: mavros: GPS
    message: No satellites
    hardware_id: /dev/ttyACM0: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/ttyACM0: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

In Level 1, it says 'not connected'.
How can I fix this connection problem??
I tried to set baudrate as 57600, 921600 and 1152000 but it did not work. Any advice will be very thankful to me. - I checked out that the connection between pixhawk and my desktop is fine. Only the connection between pixhawk and TX1 is the problem.

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

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

7条回答 默认 最新

  • weixin_39606137 weixin_39606137 2020-12-27 18:10

    It's your hardware issue. We can't really help with that.

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

    Add your user to the dialout group and remove modemmanager. That should fix it.

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

    Thanks for reply mhkabir! Do you mean TX1 when you say hardware??
    I checked out that the communication using ROS without mavlink works fine in TX1(e.g turtlesim tutorial between TX1 and desktop). Also I had set fcu_url in px4.launch as both local host( 127.0.0.1 with gazebo) and serial communication( /dev/ttyACM0:57600) to check if the problem is related with serial communication system of TX1. However both of them did not work. I think the problem is related with mavlink or mavros. Maybe I wrongly installed some packages.. How do you think about that?
    - I'll add my user to the dialout group as you advice and post the result.

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

    It's got nothing to do with mavros or mavlink. Your serial connection isn't setup properly either way.

    Please note that we will also not support any issues you may have while using a USB connection to the flight controller. It is not recommended as a flight interface.

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

    I am having same problem with you yunshin. Do you solve that problem?

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

    I removed modemmanager by cliking 'remove' buttion in Ubuntu Software Center and add my user to the dialout group by run : $sudo usermod -a -G dialout $USER. However it does not seem to work.. I think I have to change connection protocol. Do you mean to use uart( TELEM2 port on pixhawk) to USB( on TX1) connection?? Thanks!

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

    http://dev.px4.io/pixhawk-companion-computer.html

    点赞 评论 复制链接分享