PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.21k stars 13.38k forks source link

[Bug] Again Stale message error when the gz is running #23259

Closed federicociresola closed 3 months ago

federicociresola commented 3 months ago

Describe the bug

When I run the gazebo I obtain from px4 the following error:

...
ERROR [sensors] Accel #0 fail:  STALE!
ERROR [sensors] Gyro #0 fail:  STALE!
...

I thought that has been resolved with the #22767

To Reproduce

  1. clone the PX4 repository
  2. make px4_sitl gz_x500

Expected behavior

px4 without error during the simulation

Screenshot / Media

Screenshot from 2024-06-11 10-12-10

Flight Log

Software Version

Flight controller

x500

Vehicle type

Multicopter

How are the different components wired up (including port information)

No response

Additional context

No response

PerFrivik commented 3 months ago

Is this a freshly cloned vanilla PX4, also did you try a git submodule update --recursive --init ?

I had a similar issue before and the reason was that the navsat sensor plugin was missing in my .world file.

federicociresola commented 3 months ago

Yes it is a freshly cloned vanilla PX4

I have checked inside the gz folder if the navsat has missed in the default world or the x500 model but them are ok

I have tried also:

StefanoColli commented 3 months ago

How did you install Gazebo? From source or by using the ubuntu.sh script in the px4 repo?

federicociresola commented 3 months ago

I installed it from ROS2 package with the following command

sudo apt install ros-humble-ros-gzgarden

Is it possible that this is the problem?

federicociresola commented 3 months ago

I tried to remove the Gazebo garden installed through ROS2 and I installed gz-garden but there is still the problem

# Remove ros2 gz garden
sudo apt remove ros-humble-ros-gzgarden ros-humble-ros-gzgarden-sim

# Install gz garden from PX4 shell script
./Tools/setup/ubuntu.sh
PerFrivik commented 3 months ago

Can you installing gazebo through the PX4 installation guide? There may be conflicting versions issues, as PX4 does not use the newest GZ version.

https://docs.px4.io/main/en/dev_setup/dev_env_linux_ubuntu.html#simulation-and-nuttx-pixhawk-targets

Please try setting up the dev environment and see if that helps. Let me know if not.

federicociresola commented 3 months ago

you were right there was a conflict in somewhere with Gazebo version of the package manager of Ubuntu and ROS2 Humble.

Thank you all for your help!

I leave here the brute force procedure that I have used (be careful when using it):

# ROS2
sudo apt remove --purge ros-humble-ros-gzgarden*

# Ubuntu apt gazebo
sudo dpkg --list | grep gazebo
sudo apt remove --purge  *gazebo*

# Ubuntu apt ignition
sudo dpkg --list | grep  ignition
sudo apt remove --purge *ignition*

sudo apt autoremove