I am reaching out to you because I have the following problem. I have a TFmini S Lidar sensor for basic obstacle avoidance. However, during real-world flights, I noticed that the lidar sensor often stops publishing data via mavros. I bought the UART version and set the appropriate parameter in QGC to use the sensor. It is just weird since when I launched mavros on the companion computer in the lab, the TFmini always seemed to publish data. But not so during the flight, as can be seen in the figure below:
I suspected that the vibrations might have caused this problem. However, no similar effect appeared when I shook the UAV or cables in the lab. Does someone else have a similar experience or any idea? Thanks a lot.
TFmini Lidar is directly supported when enabled with SENS_TFMINI_CFG . Before check mavros make sure that PX4 receiving the data correctly. When you powered the pixhawk check “distance_sensor” uORB topic from mavlink console in QGroundControl like this:
you should see some values coming from lidar(Given image there is no sensor on Pixhawk). To listen continuously try “listener distance_sensor -r 10”. If there is no data loss you can focus on mavros part of your application.
Also tfmini lidar has limited range between 0.1-12m. If reading value out of this range may be this can cause that problem.
If in mavlink console data loss exist, you should check your wiring and healty of your hardware I think.
And finally if there is too much hardware connected to your Pixhawk it can cause sensor fault. I observed this one time when I attached too much sensor on pixhawk it was cause problem. When remove one of them which consuming much current solved. You can find more info about current limits here (https://docs.cubepilot.org/user-guides/autopilot/the-cube-module-overview)
I’m not sure but it is sounds like about powering issues, if there is no problem when try in lab and data loss starting in mid air. While you’re testing mavros in lab the other sensors are active ? If not I would try to add components step by step and try to find when data loss start.
Also may be it can be about your telemetry hardware. The screenshot you shared is from onboard logs or from telemetry ? If onboard logs have no data loss it can give you an idea.
Yes. While testing in the lab, all sensors are active. Only the motors are not spinning. But I’ll have a look at it.
I captured this data while flying via ROS on an onboard computer connected to the Pixhawk. I uploaded the logs here for inspection: https://review.px4.io/plot_app?log=19331859-ea18-49d7-8e3d-7677c8dd6f2f
From the distance measurement plot, I cannot tell whether data was captured all the time since it is a line plot. It would just draw a line between the data points if data were missing. So not sure about that.
Distance sensor logging rate is look like 1 hz in logger module. So it is normal I think. Here a distance sensor log from a fixed wing flight I logged.(tfmini S)
Time range is short because it’s rapidly goes out of range. It is look like similar with your log. But although your local position estimate for altitude is about 2 meter your distance sensor measuring different values even while vehicle at level position. I don’t have more idea what can cause this problem but I think you should first make sure that data loss exist.