mavlink / mavros

MAVLink to ROS gateway with proxy for Ground Control Station
Other
868 stars 988 forks source link

Not going in Position Hold mode when using Vision Position Estimate #1134

Closed trishantroy closed 5 years ago

trishantroy commented 5 years ago

Issue details

Hey, I am using Pixhawk in my quadcopter. I have created a rosnode (/loc_vpe) to publish data on the /mavros/vision_pose/pose topic, taking x,y data from SLAM, z from TFMini (from /mavros/altitude topic) and orientation data from Pixhawk's imu (from /mavros/imu/data topic), time stamp: ros::Time::now(), header: "map" [Is this correct?] When I run the node, I am getting data on the /mavros/local_position/pose topic. I have set "EKF2_AID_MASK" as 8 ()tried with 24 as well) and "EKF2_HGT_MODE" as Range Sensor.

When I switch to Position mode using transmitter, there is a red light blinking instead of a green one. This means that the Pixhawk is unable to get it's position, right? What should I do to solve the issue? Thanks in advance.

rqt_graph: image

MAVROS version and platform

Mavros: How to check this? Installed a month ago. ROS: ?Kinetic? Ubuntu: ?16.04?

Autopilot type and version

[ ] PX4: 1.8.1 px4fmu-v2 default

Node logs

umic@umic-nuc-i5:~/mavros_ws$ roslaunch mavros px4.launch 
... logging to /home/umic/.ros/log/f5935d76-fae5-11e8-b36f-f8633f4a7ab3/roslaunch-umic-nuc-i5-7699.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.32:41163/

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/ttyACM0: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: []
 * /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: kinetic
 * /rosversion: 1.12.14

NODES
  /
    mavros (mavros/mavros_node)

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

setting /run_id to f5935d76-fae5-11e8-b36f-f8633f4a7ab3
process[rosout-1]: started with pid [7723]
started core service [/rosout]
process[mavros-2]: started with pid [7741]
[ INFO] [1544272621.644949782]: FCU URL: /dev/ttyACM0:57600
[ INFO] [1544272621.646588068]: serial0: device: /dev/ttyACM0 @ 57600 bps
[ INFO] [1544272621.647021741]: GCS bridge disabled
[ INFO] [1544272621.656251284]: Plugin 3dr_radio loaded
[ INFO] [1544272621.658033264]: Plugin 3dr_radio initialized
[ INFO] [1544272621.658139935]: Plugin actuator_control loaded
[ INFO] [1544272621.661219364]: Plugin actuator_control initialized
[ INFO] [1544272621.663328634]: Plugin adsb loaded
[ INFO] [1544272621.666473100]: Plugin adsb initialized
[ INFO] [1544272621.666616215]: Plugin altitude loaded
[ INFO] [1544272621.667594258]: Plugin altitude initialized
[ INFO] [1544272621.667707030]: Plugin cam_imu_sync loaded
[ INFO] [1544272621.668297508]: Plugin cam_imu_sync initialized
[ INFO] [1544272621.668439832]: Plugin command loaded
[ INFO] [1544272621.673265207]: Plugin command initialized
[ INFO] [1544272621.673400350]: Plugin debug_value loaded
[ INFO] [1544272621.677721653]: Plugin debug_value initialized
[ INFO] [1544272621.677902781]: Plugin distance_sensor loaded
[ INFO] [1544272621.696114269]: Plugin distance_sensor initialized
[ INFO] [1544272621.696290967]: Plugin fake_gps loaded
[ INFO] [1544272621.708295570]: Plugin fake_gps initialized
[ INFO] [1544272621.708493624]: Plugin ftp loaded
[ INFO] [1544272621.715777619]: Plugin ftp initialized
[ INFO] [1544272621.715938240]: Plugin global_position loaded
[ INFO] [1544272621.729210735]: Plugin global_position initialized
[ INFO] [1544272621.729391232]: Plugin hil loaded
[ INFO] [1544272621.740699743]: Plugin hil initialized
[ INFO] [1544272621.740867994]: Plugin home_position loaded
[ INFO] [1544272621.744278521]: Plugin home_position initialized
[ INFO] [1544272621.744436398]: Plugin imu loaded
[ INFO] [1544272621.750713048]: Plugin imu initialized
[ INFO] [1544272621.750855838]: Plugin local_position loaded
[ INFO] [1544272621.755885534]: Plugin local_position initialized
[ INFO] [1544272621.756037220]: Plugin manual_control loaded
[ INFO] [1544272621.758903304]: Plugin manual_control initialized
[ INFO] [1544272621.759038852]: Plugin mocap_pose_estimate loaded
[ INFO] [1544272621.762394985]: Plugin mocap_pose_estimate initialized
[ INFO] [1544272621.762524421]: Plugin obstacle_distance loaded
[ INFO] [1544272621.764649198]: Plugin obstacle_distance initialized
[ INFO] [1544272621.764767632]: Plugin odom loaded
[ INFO] [1544272621.768067982]: Plugin odom initialized
[ INFO] [1544272621.768297681]: Plugin param loaded
[ INFO] [1544272621.770879874]: Plugin param initialized
[ INFO] [1544272621.771015888]: Plugin px4flow loaded
[ INFO] [1544272621.777315361]: Plugin px4flow initialized
[ INFO] [1544272621.777467805]: Plugin rangefinder loaded
[ INFO] [1544272621.778134888]: Plugin rangefinder initialized
[ INFO] [1544272621.778300952]: Plugin rc_io loaded
[ INFO] [1544272621.781741962]: Plugin rc_io initialized
[ INFO] [1544272621.781782711]: Plugin safety_area blacklisted
[ INFO] [1544272621.781916114]: Plugin setpoint_accel loaded
[ INFO] [1544272621.784899861]: Plugin setpoint_accel initialized
[ INFO] [1544272621.785135819]: Plugin setpoint_attitude loaded
[ INFO] [1544272621.794149788]: Plugin setpoint_attitude initialized
[ INFO] [1544272621.794330584]: Plugin setpoint_position loaded
[ INFO] [1544272621.806501982]: Plugin setpoint_position initialized
[ INFO] [1544272621.806685203]: Plugin setpoint_raw loaded
[ INFO] [1544272621.814540884]: Plugin setpoint_raw initialized
[ INFO] [1544272621.814697378]: Plugin setpoint_velocity loaded
[ INFO] [1544272621.819832892]: Plugin setpoint_velocity initialized
[ INFO] [1544272621.820095388]: Plugin sys_status loaded
[ INFO] [1544272621.828424405]: Plugin sys_status initialized
[ INFO] [1544272621.828598251]: Plugin sys_time loaded
[ INFO] [1544272621.831697231]: TM: Timesync mode: MAVLINK
[ INFO] [1544272621.832409265]: Plugin sys_time initialized
[ INFO] [1544272621.832551507]: Plugin vfr_hud loaded
[ INFO] [1544272621.833800500]: Plugin vfr_hud initialized
[ INFO] [1544272621.833837781]: Plugin vibration blacklisted
[ INFO] [1544272621.833969070]: Plugin vision_pose_estimate loaded
[ INFO] [1544272621.840856675]: Plugin vision_pose_estimate initialized
[ INFO] [1544272621.841012272]: Plugin vision_speed_estimate loaded
[ INFO] [1544272621.843840092]: Plugin vision_speed_estimate initialized
[ INFO] [1544272621.844018031]: Plugin waypoint loaded
[ INFO] [1544272621.848467874]: Plugin waypoint initialized
[ INFO] [1544272621.848521020]: Autostarting mavlink via USB on PX4
[ INFO] [1544272621.848643189]: Built-in SIMD instructions: SSE, SSE2
[ INFO] [1544272621.848665925]: Built-in MAVLink package version: 2018.4.4
[ INFO] [1544272621.848693144]: Known MAVLink dialects: common ardupilotmega ASLUAV autoquad icarous matrixpilot paparazzi slugs standard uAvionix ualberta
[ INFO] [1544272621.848715011]: MAVROS started. MY ID 1.240, TARGET ID 1.1
[ INFO] [1544272621.931049104]: IMU: Attitude quaternion IMU detected!
[ INFO] [1544272621.932031883]: IMU: High resolution IMU detected!
[ WARN] [1544272621.934572931]: TM: Clock skew detected (-1544271054.594539881 s). Hard syncing clocks.
[ INFO] [1544272622.128383305]: CON: Got HEARTBEAT, connected. FCU: PX4 Autopilot
[ INFO] [1544272622.147116754]: IMU: Attitude quaternion IMU detected!
[ INFO] [1544272622.147860890]: IMU: High resolution IMU detected!
[ INFO] [1544272623.137134974]: VER: 1.1: Capabilities         0x000000000000e4ef
[ INFO] [1544272623.137176543]: VER: 1.1: Flight software:     01080000 (00000000A83B7F29)
[ INFO] [1544272623.137206810]: VER: 1.1: Middleware software: 01080000 (00000000A83B7F29)
[ INFO] [1544272623.137234035]: VER: 1.1: OS software:         071600ff (0000000070141D7D)
[ INFO] [1544272623.137260064]: VER: 1.1: Board hardware:      00000011
[ INFO] [1544272623.137284213]: VER: 1.1: VID/PID:             26ac:0011
[ INFO] [1544272623.137310432]: VER: 1.1: UID:                 3137510333343537
[ WARN] [1544272623.137472766]: CMD: Unexpected command 520, result 0
[ INFO] [1544272632.129836466]: HP: requesting home position
[ INFO] [1544272637.132474789]: WP: mission received
[ INFO] [1544272642.129490489]: HP: requesting home position
[ INFO] [1544272652.129262043]: HP: requesting home position
[ INFO] [1544272662.129381774]: HP: requesting home position
[ INFO] [1544272672.128978285]: HP: requesting home position
[ INFO] [1544272682.129142995]: HP: requesting home position

Diagnostics

umic@umic-nuc-i5:~$ rostopic echo -n1 /diagnostics
header: 
  seq: 339
  stamp: 
    secs: 1544273058
    nsecs: 849866353
  frame_id: ''
status: 
  - 
    level: 0
    name: "mavros: FCU connection"
    message: "connected"
    hardware_id: "/dev/ttyACM0:57600"
    values: 
      - 
        key: "Received packets:"
        value: "18941"
      - 
        key: "Dropped packets:"
        value: "0"
      - 
        key: "Buffer overruns:"
        value: "0"
      - 
        key: "Parse errors:"
        value: "0"
      - 
        key: "Rx sequence number:"
        value: "91"
      - 
        key: "Tx sequence number:"
        value: "173"
      - 
        key: "Rx total bytes:"
        value: "6559136"
      - 
        key: "Tx total bytes:"
        value: "525241"
      - 
        key: "Rx speed:"
        value: "22486.000000"
      - 
        key: "Tx speed:"
        value: "2210.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: 0
    name: "mavros: Heartbeat"
    message: "Normal"
    hardware_id: "/dev/ttyACM0:57600"
    values: 
      - 
        key: "Heartbeats since startup"
        value: "437"
      - 
        key: "Frequency (Hz)"
        value: "1.000003"
      - 
        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/ttyACM0:57600"
    values: 
      - 
        key: "Sensor present"
        value: "0x00000000"
      - 
        key: "Sensor enabled"
        value: "0x00000000"
      - 
        key: "Sensor helth"
        value: "0x00000000"
      - 
        key: "CPU Load (%)"
        value: "37.4"
      - 
        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/ttyACM0:57600"
    values: 
      - 
        key: "Voltage"
        value: "65.54"
      - 
        key: "Current"
        value: "-0.0"
      - 
        key: "Remaining"
        value: "-1.0"
  - 
    level: 0
    name: "mavros: Time Sync"
    message: "Normal"
    hardware_id: "/dev/ttyACM0:57600"
    values: 
      - 
        key: "Timesyncs since startup"
        value: "4368"
      - 
        key: "Frequency (Hz)"
        value: "10.000036"
      - 
        key: "Last dt (ms)"
        value: "-0.026828"
      - 
        key: "Mean dt (ms)"
        value: "0.016995"
      - 
        key: "Last system time (s)"
        value: "2004.282824000"
      - 
        key: "Time offset (s)"
        value: "1544271054.549984455"
---

Check ID

umic@umic-nuc-i5:~$ rosrun mavros checkid
OK. I got messages from 1:1.

---
Received 5185 messages, from 1 addresses
sys:comp   list of messages
  1:1     0, 1, 2, 4, 140, 141, 147, 132, 30, 31, 32, 36, 74, 77, 83, 340, 102, 230, 105, 111, 241, 245
trishantroy commented 5 years ago

I am sorry for opening the issue. It was working now! The only change I did was change the frame_id to map. It was base_link earlier. May this have been a possible reason for the problem earlier?

vipin3690 commented 1 year ago

@trishantroy Where did you changed the frame id? Can you please explain , i am having the same issue