Error in local positioning of Pixhawk4 using ViCON data

Hello Dear Community,

I am having problem in localization of Pixhawk using VICON. The problem is described in detail below:

Problem Description
I followed the procedure given in https://dev.px4.io/v1.9.0/en/ros/external_position_estimation.html and was able to publish vicon data to the topic /mavros/vision_pose/pose and was able to echo /mavros/local_position/pose

However, I am able to see the vicon data in the /mavros/local_position/pose for about 1-2 minute after every reboot and afterwards the local position data reverts back to the x=0, y=0 and z some random value. The orientation quat. is never getting updated (not even for first 1-2 min) and I guess the orientation data is coming from the IMU all the time.

Ground Station Parameters
Running Ubuntu Bionic with ROS Melodic

QGroundControl Parameters
I am using Pixhawk4 with Telem1 configured to 57600 baudrate to use for QGroundControl and Telem2 configured as Onboard with a baudrate of 921600. My Onboard computer is RaspberryPi3 which is running Ubuntu Mate 18. My ROS MASTER is running at ground station (System 76 PC) and Onboard computer makes a connection to the ROS MASTER to get the Vicon data.

EKF2 Parameters

  • Adjust EKF_AID_MASK to fuse vision position and yaw
  • adjust height parameter EKF2_HGT_MODE` to use vision
  • reduce EKF2_EVDELAY to 50ms .

Please let me know how can I resolve this problem.

Regards,
Kashish Dhal

Maybe @TSC21 can help here.

@kashishdhal a log and the console output of MAVROS would help understand what’s happening. Otherwise it’s almost impossible because we are not able to understand what exactly causes the estimator to reset after those two minutes you say.

Hello @TSC21,

First of all, I am sorry as I missed your reply. Here are the console outputs:

Vicon Bridge Output

gnclab@system76-pc:~$ roslaunch vicon_bridge vicon.launch 
... logging to /home/gnclab/.ros/log/04d25742-788f-11ea-a41b-1c697a0794e3/roslaunch-system76-pc-11661.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://system76-pc:33433/

SUMMARY
========

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.3
 * /vicon/datastream_hostport: 192.168.10.1:801
 * /vicon/stream_mode: ClientPull
 * /vicon/tf_ref_frame_id: /world

NODES
  /
    vicon (vicon_bridge/vicon_bridge)

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

setting /run_id to 04d25742-788f-11ea-a41b-1c697a0794e3
process[rosout-1]: started with pid [11682]
started core service [/rosout]
process[vicon-2]: started with pid [11689]
[ INFO] [1586236625.180367757]: Connecting to Vicon DataStream SDK at 192.168.10.1:801 ...
[ INFO] [1586236625.181451126]: .
[ INFO] [1586236626.181651406]: ... connected!
[ INFO] [1586236626.181726361]: Setting Stream Mode to ClientPull: Success
[ INFO] [1586236626.181779709]: Axis Mapping: X-Forward Y-Left Z-Up
[ INFO] [1586236626.181816897]: Version: 1.3.0
[ INFO] [1586236626.181844490]: setting up grab_vicon_pose service server ... 
[ INFO] [1586236626.182993309]: setting up segment calibration service server ... 
[ WARN] [1586236626.185367120]: grab frame returned false
[ INFO] [1586236626.194316189]: creating new object gncQuad/gncQuad ...
[ INFO] [1586236626.194496302]: creating new object aslRover1/aslRover1 ...
[ WARN] [1586236626.198528674]: unable to load zero pose for gncQuad/gncQuad
[ INFO] [1586236626.198628341]: ... done, advertised as " vicon/gncQuad/gncQuad" 
[ WARN] [1586236626.199748257]: unable to load zero pose for aslRover1/aslRover1
[ INFO] [1586236626.199838158]: ... done, advertised as " vicon/aslRover1/aslRover1" 

MAVROS Output

ubuntu@ubuntu:~$ roslaunch mavros px4.launch
... logging to /home/ubuntu/.ros/log/04d25742-788f-11ea-a41b-1c697a0794e3/roslaunch-ubuntu-3189.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://ubuntu:32897/

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:921600
 * /mavros/gcs_url: 
 * /mavros/global_position/child_frame_id: base_link
 * /mavros/global_position/frame_id: map
 * /mavros/global_position/gps_uere: 1.0
 * /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.0003490659 // 0...
 * /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/landing_target/camera/fov_x: 2.0071286398
 * /mavros/landing_target/camera/fov_y: 2.0071286398
 * /mavros/landing_target/image/height: 480
 * /mavros/landing_target/image/width: 640
 * /mavros/landing_target/land_target_type: VISION_FIDUCIAL
 * /mavros/landing_target/listen_lt: False
 * /mavros/landing_target/mav_frame: LOCAL_NED
 * /mavros/landing_target/target_size/x: 0.3
 * /mavros/landing_target/target_size/y: 0.3
 * /mavros/landing_target/tf/child_frame_id: camera_center
 * /mavros/landing_target/tf/frame_id: landing_target
 * /mavros/landing_target/tf/listen: False
 * /mavros/landing_target/tf/rate_limit: 10.0
 * /mavros/landing_target/tf/send: True
 * /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/fcu/odom_child_id_des: base_link
 * /mavros/odometry/fcu/odom_parent_id_des: map
 * /mavros/plugin_blacklist: ['safety_area', '...
 * /mavros/plugin_whitelist: []
 * /mavros/px4flow/frame_id: px4flow
 * /mavros/px4flow/ranger_fov: 0.118682
 * /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_raw/thrust_scaling: 1.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: odom
 * /mavros/vision_pose/tf/listen: False
 * /mavros/vision_pose/tf/rate_limit: 10.0
 * /mavros/vision_speed/listen_twist: True
 * /mavros/vision_speed/twist_cov: True
 * /mavros/wheel_odometry/child_frame_id: base_link
 * /mavros/wheel_odometry/count: 2
 * /mavros/wheel_odometry/frame_id: odom
 * /mavros/wheel_odometry/send_raw: True
 * /mavros/wheel_odometry/send_twist: False
 * /mavros/wheel_odometry/tf/child_frame_id: base_link
 * /mavros/wheel_odometry/tf/frame_id: odom
 * /mavros/wheel_odometry/tf/send: False
 * /mavros/wheel_odometry/use_rpm: False
 * /mavros/wheel_odometry/vel_error: 0.1
 * /mavros/wheel_odometry/wheel0/radius: 0.05
 * /mavros/wheel_odometry/wheel0/x: 0.0
 * /mavros/wheel_odometry/wheel0/y: -0.15
 * /mavros/wheel_odometry/wheel1/radius: 0.05
 * /mavros/wheel_odometry/wheel1/x: 0.0
 * /mavros/wheel_odometry/wheel1/y: 0.15
 * /rosdistro: melodic
 * /rosversion: 1.14.5

NODES
  /
    mavros (mavros/mavros_node)

ROS_MASTER_URI=http://192.168.10.2:11311

process[mavros-1]: started with pid [3200]
[ INFO] [1586137902.426831779]: FCU URL: /dev/ttyUSB0:921600
[ INFO] [1586137902.437712390]: serial0: device: /dev/ttyUSB0 @ 921600 bps
[ INFO] [1586137902.446245242]: GCS bridge disabled
[ INFO] [1586137902.568080557]: Plugin 3dr_radio loaded
[ INFO] [1586137902.577902446]: Plugin 3dr_radio initialized
[ INFO] [1586137902.578287279]: Plugin actuator_control loaded
[ INFO] [1586137902.598533964]: Plugin actuator_control initialized
[ INFO] [1586137902.641531112]: Plugin adsb loaded
[ INFO] [1586137902.659096094]: Plugin adsb initialized
[ INFO] [1586137902.659605668]: Plugin altitude loaded
[ INFO] [1586137902.665318131]: Plugin altitude initialized
[ INFO] [1586137902.665760168]: Plugin cam_imu_sync loaded
[ INFO] [1586137902.668694723]: Plugin cam_imu_sync initialized
[ INFO] [1586137902.669203631]: Plugin command loaded
[ INFO] [1586137902.700866223]: Plugin command initialized
[ INFO] [1586137902.701343427]: Plugin companion_process_status loaded
[ INFO] [1586137902.717302316]: Plugin companion_process_status initialized
[ INFO] [1586137902.717711538]: Plugin debug_value loaded
[ INFO] [1586137902.744187797]: Plugin debug_value initialized
[ INFO] [1586137902.744357205]: Plugin distance_sensor blacklisted
[ INFO] [1586137902.744898297]: Plugin fake_gps loaded
[ INFO] [1586137902.828233057]: Plugin fake_gps initialized
[ INFO] [1586137902.829065075]: Plugin ftp loaded
[ INFO] [1586137902.858753001]: Plugin ftp initialized
[ INFO] [1586137902.859421909]: Plugin global_position loaded
[ INFO] [1586137902.953707279]: Plugin global_position initialized
[ INFO] [1586137902.954307297]: Plugin gps_rtk loaded
[ INFO] [1586137902.967700446]: Plugin gps_rtk initialized
[ INFO] [1586137902.968369575]: Plugin hil loaded
[ INFO] [1586137903.046269242]: Plugin hil initialized
[ INFO] [1586137903.046996464]: Plugin home_position loaded
[ INFO] [1586137903.066411594]: Plugin home_position initialized
[ INFO] [1586137903.067134890]: Plugin imu loaded
[ INFO] [1586137903.119315705]: Plugin imu initialized
[ INFO] [1586137903.120320242]: Plugin landing_target loaded
[ INFO] [1586137903.224361853]: Plugin landing_target initialized
[ INFO] [1586137903.225346056]: Plugin local_position loaded
[ INFO] [1586137903.267522964]: Plugin local_position initialized
[ INFO] [1586137903.268178871]: Plugin log_transfer loaded
[ INFO] [1586137903.286107945]: Plugin log_transfer initialized
[ INFO] [1586137903.286755908]: Plugin manual_control loaded
[ INFO] [1586137903.306805538]: Plugin manual_control initialized
[ INFO] [1586137903.307337742]: Plugin mocap_pose_estimate loaded
[ INFO] [1586137903.331863408]: Plugin mocap_pose_estimate initialized
[ INFO] [1586137903.332334705]: Plugin mount_control loaded
[ INFO] [1586137903.351294816]: Plugin mount_control initialized
[ INFO] [1586137903.351801112]: Plugin obstacle_distance loaded
[ INFO] [1586137903.368901316]: Plugin obstacle_distance initialized
[ INFO] [1586137903.369373723]: Plugin odom loaded
[ INFO] [1586137903.392412816]: Plugin odom initialized
[ INFO] [1586137903.392900723]: Plugin onboard_computer_status loaded
[ INFO] [1586137903.405944334]: Plugin onboard_computer_status initialized
[ INFO] [1586137903.406458334]: Plugin param loaded
[ INFO] [1586137903.418291927]: Plugin param initialized
[ INFO] [1586137903.418756205]: Plugin px4flow loaded
[ INFO] [1586137903.455861593]: Plugin px4flow initialized
[ INFO] [1586137903.456055501]: Plugin rangefinder blacklisted
[ INFO] [1586137903.456543167]: Plugin rc_io loaded
[ INFO] [1586137903.478217371]: Plugin rc_io initialized
[ INFO] [1586137903.478405519]: Plugin safety_area blacklisted
[ INFO] [1586137903.478898593]: Plugin setpoint_accel loaded
[ INFO] [1586137903.499989816]: Plugin setpoint_accel initialized
[ INFO] [1586137903.500549908]: Plugin setpoint_attitude loaded
[ INFO] [1586137903.564235834]: Plugin setpoint_attitude initialized
[ INFO] [1586137903.564849038]: Plugin setpoint_position loaded
[ INFO] [1586137903.683568260]: Plugin setpoint_position initialized
[ INFO] [1586137903.684340778]: Plugin setpoint_raw loaded
[ INFO] [1586137903.747944056]: Plugin setpoint_raw initialized
[ INFO] [1586137903.748647427]: Plugin setpoint_trajectory loaded
[ INFO] [1586137903.780268778]: Plugin setpoint_trajectory initialized
[ INFO] [1586137903.780857538]: Plugin setpoint_velocity loaded
[ INFO] [1586137903.816293371]: Plugin setpoint_velocity initialized
[ INFO] [1586137903.817127612]: Plugin sys_status loaded
[ INFO] [1586137903.884021297]: Plugin sys_status initialized
[ INFO] [1586137903.884660445]: Plugin sys_time loaded
[ INFO] [1586137903.926297019]: TM: Timesync mode: MAVLINK
[ INFO] [1586137903.931607741]: Plugin sys_time initialized
[ INFO] [1586137903.932165075]: Plugin trajectory loaded
[ INFO] [1586137903.960708575]: Plugin trajectory initialized
[ INFO] [1586137903.961262519]: Plugin vfr_hud loaded
[ INFO] [1586137903.964559926]: Plugin vfr_hud initialized
[ INFO] [1586137903.964748315]: Plugin vibration blacklisted
[ INFO] [1586137903.965171889]: Plugin vision_pose_estimate loaded
[ INFO] [1586137904.011642556]: Plugin vision_pose_estimate initialized
[ INFO] [1586137904.012292426]: Plugin vision_speed_estimate loaded
[ INFO] [1586137904.034635130]: Plugin vision_speed_estimate initialized
[ INFO] [1586137904.035606408]: Plugin waypoint loaded
[ INFO] [1586137904.055633037]: Plugin waypoint initialized
[ INFO] [1586137904.055874741]: Plugin wheel_odometry blacklisted
[ INFO] [1586137904.056396649]: Plugin wind_estimation loaded
[ INFO] [1586137904.059645445]: Plugin wind_estimation initialized
[ INFO] [1586137904.059885834]: Autostarting mavlink via USB on PX4
[ INFO] [1586137904.060444556]: Built-in SIMD instructions: ARM NEON
[ INFO] [1586137904.060623297]: Built-in MAVLink package version: 2020.3.3
[ INFO] [1586137904.060799463]: Known MAVLink dialects: common ardupilotmega ASLUAV autoquad icarous matrixpilot paparazzi slugs standard uAvionix ualberta
[ INFO] [1586137904.060949408]: MAVROS started. MY ID 1.240, TARGET ID 1.1
[ INFO] [1586137904.061719074]: IMU: High resolution IMU detected!
[ INFO] [1586137904.851521500]: CON: Got HEARTBEAT, connected. FCU: PX4 Autopilot
[ INFO] [1586137904.860431759]: IMU: High resolution IMU detected!
[ INFO] [1586137905.862318055]: VER: 1.1: Capabilities         0x000000000000e4ef
[ INFO] [1586137905.862621833]: VER: 1.1: Flight software:     010901ff (f8db8650d0000000)
[ INFO] [1586137905.862789462]: VER: 1.1: Middleware software: 010901ff (f8db8650d0000000)
[ INFO] [1586137905.862936222]: VER: 1.1: OS software:         071c00ff (423371c7d4012e72)
[ INFO] [1586137905.863078870]: VER: 1.1: Board hardware:      00000032
[ INFO] [1586137905.863248462]: VER: 1.1: VID/PID:             26ac:0032
[ INFO] [1586137905.863401870]: VER: 1.1: UID:                 3138510c39303736
[ WARN] [1586137905.863614777]: CMD: Unexpected command 520, result 0
[ INFO] [1586137914.852032420]: HP: requesting home position
[ INFO] [1586137919.858158713]: WP: mission received
[ INFO] [1586137924.851956470]: HP: requesting home position
[ INFO] [1586137934.851958815]: HP: requesting home position
[ INFO] [1586137944.851955661]: HP: requesting home position
[ INFO] [1586137954.851955415]: HP: requesting home position
[ INFO] [1586137964.851957983]: HP: requesting home position

PDF file for the vicon data forwarding is attached

viconToMavros.pdf (13.7 KB)

Output from the vision_pose/pose:

I don’t know how to get log file as I am not flying, please help me with that and I may be able to provide you the same.

Regards,
Kashish Dhal

You don’t need to fly. You just need to arm the vehicle (props out if you are not flying). Or enable the log from boot using the SDLOG_MODE PX4 paremeter.

Here is the log file, which I just generated. It is not letting me upload .log file so I added .pdf at the end so please remove that when analyzing.

log_14_2020-4-3-02-20-24_1.ulg.pdf (129.8 KB)

Note: that it is running older version of PX4 which I installed hoping will resolve the problem. However, same thing happens with newer versions as well.

Also, when MAV_1_RATE is decreased it takes longer for this issue to reproduce. When MAV_1_RATE is set to 0 (which is maximum possible value) it takes around 1 min to reset. When I treat my ground station as onboard computer, this issue isn’t reproduced.

Here is another log file when I was feeding the VICON Data

log_17_2020-4-3-03-41-56.ulg.pdf (972.9 KB)

We tried few other combinations to reproduce the same error and here are the results:

  1. RaspberryPi 3 + ROS Melodic + Pixhawk 4 + MAV_1_RATE = 1200 resets local position in 5 min

  2. Odroid XU4 + ROS Kinetic + Pixhawk 4 + MAV_1_RATE = 12000 resets local position in 3 min

  3. Odroid XU4 + ROS Kinetic + Pixhawk 4 + MAV_1_RATE = 4800 resets local position in 8 min

  4. Odroid XU4 + ROS Kinetic + Pixhawk Mini + MAV_1_RATE = 4800 resets local position in 12 min

Hello @TSC21 and @JulianOes, do you have enough data to debug? Please let me know if you need some additional data from my end?

Please upload the logs to https://logs.px4.io and then share the link here.

@JulianOes, please find them here:

https://logs.px4.io/plot_app?log=12c89bde-c6d5-47e9-bdc5-be903209dacb

https://logs.px4.io/plot_app?log=388a6e60-dda4-44b6-a9bc-ea1c053e6a70

1 Like

@TSC21 would be great if you could have a quick look, thx.

Hello, I am also providing the rqt_graph if in case that also help:

@kashishdhal I don’t see anything relevant on the logs you sent. First because they are short - the first one is 2 seconds (?) and the second 38 seconds, and second because they don’t show the behaviour you were describing (“for about 1-2 minute after every reboot and afterwards the local position data reverts back to the x=0, y=0 and z some random value.”).

My first random guess is that you have problems on your ROS network and that time to time you lose the VICON data, which in return results on sending none or invalid data to the Pixhawk, which results in the EKF2 resetting (I can’t see any of that happening on the logs you shared, otherwise you would see EKF2 triggering a log message saying there as a timeout on the vision source).

The other problem that might be happening is that your RPi<->Pixhawk is intermittent or broken. I saw many time people having problems with their serial links between the RPi and the Pixhawk, usually do to bad cabling or to misconfigure settings (on the RPi side, meaning on the MAVROS side). I would check that you have proper cabling on the link.

Hello @TSC21,

Thanks for the reply.

  1. You told me to arm and disarm to get the log file. Please tell me how would I generate the log file which will help you to analyze the issue better?

  2. You said there could be a problem on ROS network side. So the question here is when I echo /mavros/vision_pose/pose topic on RPi side I see VICON data coming even though EKF2 has been reset to 0,0. Also, I am able to fly crazyflie with the same ROS computer, see here: https://www.youtube.com/watch?v=wQSAClv--LISo I guess this options is ruled out? Another question, why it only happens after 1-2 minute (data loss can occur at any time, correct?)

  3. You talked about RPi<->Pixhawk FTDI connection. However, when I tried it on Odroid (see above comments) I was using a different cable. The same thing happened. Also, if cable is broken, how does it work perfectly for 1-2 minutes?

Will wait for your reply.

Hello @TSC21 @JulianOes,

I am still waiting for your reply. Please tell me what to provide and I will be happy to provide you the same.

On the other hand, you can run simulated VICON (as a ROS node with fixed data) in your computer to feed data to Pixhawk to reproduce this issue on your side.

Please help!

Regards,
Kashish Dhal

@kashishdhal,

  1. I said to arm and disarm, but I didn’t said to disarm immediately. Please read about the SDLOG_MODE PX4 parameter: https://dev.px4.io/master/en/advanced/parameter_reference.html#SDLOG_MODE. Set it to use log from boot until shutdown.

  2. I can only assert after seeing in the log what happens after 1-2 minutes after you start streaming the data;

  3. Again, I need to check the log, otherwise I cannot verify the problem.

Also please share a rosbag with the data you are sending through the VICON topic and also include the mavros local position topic.

Hello @TSC21,

I will update you with the data requested. I don’t know why it doesn’t show up in the log file but I was actually feeding the VICON data when I generated the log file and was able to see the local pose topic as well.

But, in any case, I will do it again and send you the updated files.

Thanks!

Regards,
Kashish Dhal

Hello @TSC21,

I am sharing the link when I ran this trial again:

https://logs.px4.io/plot_app?log=55d7974c-851e-42de-86e5-dda1abbd320e

Also, the rosbag file is attached here:

Regards,
Kashish Dhal

Hello @TSC21 @JulianOes,

Do you need additional data? Are we moving forward to resolve it?

Regards,
Kashish Dhal