ros-navigation / navigation2

ROS 2 Navigation Framework and System
https://nav2.org/
Other
2.54k stars 1.28k forks source link

Online example is not working on ros2 jazzy #4722

Open davidemannone opened 1 week ago

davidemannone commented 1 week ago

Bug report

Cannot bring to work the "Getting Started" example on Ros2 Jazzy with Ubuntu 24.04, in both binary and source version (even if compilation completes successfully). Logs reports tf frames missing (odom), maps errors and rviz crashs after few seconds, and command terminates execution. As stated I tried first not to install "sudo apt install ros-jazzy-turtlebot3-gazebo", after trying it apt cannot find it and last, even install all of tb3 and also tb4, will not solve the question. Cannot find this path: export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/jazzy/share/turtlebot3_gazebo/models

What should I do to make your example working?

Steps to reproduce issue

Followed your simple and clear guide and when launched it didn't work

Expected behavior

The same as web page

Actual behavior

Starts, rviz closes after few seconds followed by console execution stop. Gazebo remains running

Additional information

Logs reports tf frames missing and rqt and tftree doesn't shows all expected connections

component_container_isolated_88025_1729002265308.log

SteveMacenski commented 1 week ago

So, it looks like our Getting Started (and build/install) guide needs to be updated from the migration to New-Gazebo from Gazebo-Classic. Jazzy / Rolling don't have support for Gazebo Classic anymore since it doesn't ship with those distributions on 24.04.

We are no longer dependent on the TB3 packages and instead use this repo instead for the URDFs and sim files https://github.com/ros-navigation/nav2_minimal_turtlebot_simulation. That step is not required to apt install anything other than packages in the minimal Tb3/4 repo -- which have binaries in Jazzy that you can use. The setting of the Gazebo model paths are also not required anymore (we automated that in the launch files).

Everything else should be the same. If you're open to contributing, I'd love it if you could propose the changes to that instruction set that aligns with the current state of the project using the modern updated gazebo! If nothing else, verifying that the changes i described above are the only changes required would be good and then I can make the updates myself when I have a spare few hours in the airport on the way to ROSCon :-)

davidemannone commented 1 week ago

I'm a novice in Ros2 and Nav2, so I don't have enough confidence and experience yet to make this. But i did some tries and these are the results.

I've installed Ros2 Jazzy following the guide and it comes already with with Gazebo installed too. I had a look to the version and it was Harmonic. I don't know if it is old (classic) or new one and having a search for something new it seems that a new version of Gazebo should be Ignition but I cannot find it (all brings to Gazebo: https://ignitionrobotics.org/). I've found finally this site: https://github.com/gazebosim/ros_gz/tree/jazzy and followed the instructions for install it. After that, Gazebo is still running (using the gz sim commands, as before: just the nav2 example did not run) , but not with ing gazebo. Having a further look I found this https://gazebosim.org/docs/latest/getstarted/ and here https://gazebosim.org/docs/ionic/install_ubuntu/ I found I should use Ionic. Following also this I got all installed correctly and gz is still running but it reports always harmonic. If I do a check with apt for ros-jazzy-gz-ionic and ros-jazzy-gz-harmonic both says they are updated. Maybe there both installed now and gz sim refers just to one? Having a look in opt/ros/jazzy.. /opt, /lib and /share I can find only "gz" (in files or links) and no versions (folders or in names).

I've got the nav2_tb repo you suggested and it compiles. I don't know where to place it correctly: if part of all the other nav2's (inside the suggested nav2_ws/src/navigation2) or elsewhere like the nav2_ws/src. In both cases it compiles well and not doing anything else (not even the exports as you suggested) just sourcing nav2_ws (for the nav2_ws/src/navigation2 or both separate for nav2_ws/src) it still is not running and rviz dies as before.

I trust in your spare airport hours. :)

SteveMacenski commented 1 week ago

Jazzy only supports / ships with the new Gazebo. Ignition is an older naming schema which is deprecated due to trademark issues. its all just called 'Gazebo' now - not confusing at all, right? :wink: So you're definitely using new-Gazebo (or as I jokingly call it sometimes: Gazebo2).

You shouldn't need to download + build the code unless you're on Rolling. You should be able to apt install those packages instead on Jazzy. Please verify that this works for you. At that point, you should just be able to run all the Nav2 demos in nav2_bringup without issue

Let me know :-)

davidemannone commented 1 week ago

It sounds good, but it still wont work. sudo apt install ros-jazzy-navigations2 --> all up to date sudo apt install ros-jazzy-nav2-minimal-tb* --> installed ..tb3-sim, ..tb4-sim, tb4-description source /opt/ros/jazzy/setup.bash --> ok ros2 launch nav2_bringup tb3_simulation_launch.py headless:=False --> as ever: tf errors, rviz starts and closes, gazebo ok with model ros2 launch nav2_bringup tb4_simulation_launch.py headless:=False --> as ever: tf errors, rviz starts and closes, gazebo with model (warehouse) Attached the entire log folder, clean, with just the startup.
logs.zip

SteveMacenski commented 1 week ago

available, tf error: Invalid frame ID "odom" passed to canTransform argument target_frame - frame does not exist

That's usually related to gazebo as the publisher of the odometry data and frames - if you wait for the gazebo window to appear, do you still see these errors afterwards? It can take a moment for gazebo to fully load, especially on the first run while it downloads online mesh assets used in the SDF file

I'm seeing you likely sending a control+c or similar signal to end the program around that time while waiting for things to finish hooking up

davidemannone commented 2 days ago

Oh yes, I did but it still stops alone and first closes RViz and then stops the console; Gazebo remains open and it should be closed by X. I've attached this times logs without breaks and i put also some screenshots of the error report that appears first time after RViz crash. nav2_logs_screenshots.zip

patham9 commented 1 day ago

@davidemannone: Unfortunately ROS2 is realistically speaking Alpha-quality software (that's what is meant with "production-ready" in the OSS community), so expect some manual fiddling for a few days to avoid segfaults, but the good news is that usually there is a way to get stuff to run with enough persistence.

For instance you might need to export QT_QPA_PLATFORM=xcb to hamper Gazebo from crashing in case you are running in a VM, since Gazebo (other than simulators like Webots) is not smart enough to select a working graphics mode by itself or to give meaningful error messages for crashes.

Also Ubuntu Mesa drivers can cause issues in case you are using Ubuntu 24 already. This fixed the Mesa issue for me:

sudo add-apt-repository ppa:kisak/kisak-mesa
sudo apt update
sudo apt upgrade

Additionally you may need to pass some additional parameters. While this contradicts the tutorials, that's what at least seems to be needed for Jazzy to have the relevant nodes spawned up:

export QT_QPA_PLATFORM=xcb
ros2 launch nav2_bringup tb3_simulation_launch.py slam:=True nav:=True headless:=False use_sim_time:=True

Please let me know how that goes for you, if it doesn't work I am willing to share a VM file with you.