Skip to content

Feat/update gps tutorial #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: rolling
Choose a base branch
from

Conversation

stevedanomodolor
Copy link

No description provided.

@stevedanomodolor stevedanomodolor force-pushed the feat/update_gps_tutorial branch 2 times, most recently from 56eb0f0 to 3d4bd8c Compare July 4, 2025 18:13
@stevedanomodolor stevedanomodolor marked this pull request as ready for review July 4, 2025 18:13
Signed-off-by: Stevedan Omodolor <stevedan.o.omodolor@gmail.com>
Signed-off-by: Stevedan Omodolor <stevedan.o.omodolor@gmail.com>
@litch
Copy link

litch commented Jul 6, 2025

Thank you for making this. I was just trying to run this tutorial and failing and jazzy just doesn't want to work with gazebo classic at all.

However, I'm not able to launch it because it seems to be referencing a turtlebot3_waffle_gps.urdf that does not exist in the nav2_minimal_tb3_sim package (at least as currently released). I can make some guesses about what to go change in that package but as-is, this is either dependent on an upstream library change or maybe need to pull that modified turtlebot into this repo?

Edit: Oh, I see you mention the related library package change in the parent issue #114 - I'll test it out.

@stevedanomodolor
Copy link
Author

stevedanomodolor commented Jul 6, 2025

Thank you for making this. I was just trying to run this tutorial and failing and jazzy just doesn't want to work with gazebo classic at all.

However, I'm not able to launch it because it seems to be referencing a turtlebot3_waffle_gps.urdf that does not exist in the nav2_minimal_tb3_sim package (at least as currently released).

It should be there because nav2 used it to run some tests.

I can make some guesses about what to go change in that package but as-is, this is either dependent on an upstream library change or maybe need to pull that modified turtlebot into this repo?

I made some changes, use my branch, below

Edit: Oh, I see you mention the related library package change in the parent issue #114 - I'll test it out.

Now all urdf are in the nav2_min_sim repo
This are the three PRs.
The documentation has been updated too so see the nav2.org PR with the latest instructions
ros-navigation/nav2_minimal_turtlebot_simulation#32

#115

ros-navigation/docs.nav2.org#720

@litch
Copy link

litch commented Jul 6, 2025

I've installed both of your branches, and gz launches ok, but I just get a blank screen. I can launch other simulations just fine, so the system is generally working. I don't see any hard Error messages in my logs that suggest what is failing in this launch, and I get the ros topics publishing as expected. I do receive a number of warnings though:

[gazebo-4] [GUI] [Wrn] [Application.cc:908] [QT] file::/WorldStats/WorldStats.qml:53:3: QML RowLayout: Binding loop detected for property "x"
[gz-3] Warning [Utils.cc:132] [/sdf/model[@name="turtlebot3_waffle"]/link[@name="imu_link"]/sensor[@name="tb3_imu"]/gz_frame_id:<data-string>:L49]: XML Element[gz_frame_id], child of element[sensor], not defined in SDF. Copying[gz_frame_id] as children of [sensor].
[gz-3] Warning [Utils.cc:132] [/sdf/model[@name="turtlebot3_waffle"]/link[@name="gps_link"]/sensor[@name="navsat"]/gz_frame_id:<data-string>:L99]: XML Element[gz_frame_id], child of element[sensor], not defined in SDF. Copying[gz_frame_id] as children of [sensor].
[gz-3] Warning [Utils.cc:132] [/sdf/model[@name="turtlebot3_waffle"]/link[@name="base_scan"]/sensor[@name="hls_lfcd_lds"]/gz_frame_id:<data-string>:L160]: XML Element[gz_frame_id], child of element[sensor], not defined in SDF. Copying[gz_frame_id] as children of [sensor].
[gz-3] Warning [Utils.cc:132] [/sdf/model[@name="turtlebot3_waffle"]/link[@name="camera_link"]/sensor[@name="intel_realsense_r200_depth"]/gz_frame_id:<data-string>:L387]: XML Element[gz_frame_id], child of element[sensor], not defined in SDF. Copying[gz_frame_id] as children of [sensor].

I'm not 100% sure if that's enough to be a fatal error in spawning the gazebo world, and suspect it's related to the changes over here: https://github.com/stevedanomodolor/nav2_minimal_turtlebot_simulation.

I will keep poking around and update if I have something more informative to say (I'm quite a noob on gazebo anything and don't have a great feel for the error messages). And again, thank you for contributing this.

@stevedanomodolor
Copy link
Author

I've installed both of your branches, and gz launches ok, but I just get a blank screen. I can launch other simulations just fine, so the system is generally working. I don't see any hard Error messages in my logs that suggest what is failing in this launch, and I get the ros topics publishing as expected. I do receive a number of warnings though:

[gazebo-4] [GUI] [Wrn] [Application.cc:908] [QT] file::/WorldStats/WorldStats.qml:53:3: QML RowLayout: Binding loop detected for property "x"
[gz-3] Warning [Utils.cc:132] [/sdf/model[@name="turtlebot3_waffle"]/link[@name="imu_link"]/sensor[@name="tb3_imu"]/gz_frame_id:<data-string>:L49]: XML Element[gz_frame_id], child of element[sensor], not defined in SDF. Copying[gz_frame_id] as children of [sensor].
[gz-3] Warning [Utils.cc:132] [/sdf/model[@name="turtlebot3_waffle"]/link[@name="gps_link"]/sensor[@name="navsat"]/gz_frame_id:<data-string>:L99]: XML Element[gz_frame_id], child of element[sensor], not defined in SDF. Copying[gz_frame_id] as children of [sensor].
[gz-3] Warning [Utils.cc:132] [/sdf/model[@name="turtlebot3_waffle"]/link[@name="base_scan"]/sensor[@name="hls_lfcd_lds"]/gz_frame_id:<data-string>:L160]: XML Element[gz_frame_id], child of element[sensor], not defined in SDF. Copying[gz_frame_id] as children of [sensor].
[gz-3] Warning [Utils.cc:132] [/sdf/model[@name="turtlebot3_waffle"]/link[@name="camera_link"]/sensor[@name="intel_realsense_r200_depth"]/gz_frame_id:<data-string>:L387]: XML Element[gz_frame_id], child of element[sensor], not defined in SDF. Copying[gz_frame_id] as children of [sensor].

I'm not 100% sure if that's enough to be a fatal error in spawning the gazebo world, and suspect it's related to the changes over here: https://github.com/stevedanomodolor/nav2_minimal_turtlebot_simulation.

I will keep poking around and update if I have something more informative to say (I'm quite a noob on gazebo anything and don't have a great feel for the error messages). And again, thank you for contributing this.

Someone else also mentioned this to me too about the blank screen. I am not able to reproduce it.
The warnings are not errors, it shouldnt be a problem.

What environment are you using,
Operating system
Docker?

I am currently using the nav2 docker, where I build all the other repo in it, I can share my .dev container for vs code if you are familiar with vs code dev container.

@stevedanomodolor
Copy link
Author

This is where it is installed in the docker container
https://github.com/ros-navigation/navigation2/blob/main/Dockerfile#L186-L205

@litch
Copy link

litch commented Jul 6, 2025

I think found the issue. This line:

64fce3b#diff-2302c3058efb8f702a32ded1a29b2f16814c1ddcf50a9313561540fe0955ab44R96

Seems to reference casing that is not consistent on my machine (ubuntu). I still haven't gotten it to come up cleanly yet but I think that was the main blocker.

@litch
Copy link

litch commented Jul 6, 2025

And yes I'm running in docker and would very much appreciate the devcontainer to try to repro

@stevedanomodolor
Copy link
Author

I am not t home ATM, but Actually I am using the same dev container as in navigation2, uncomment all options to allow visualization in the dev container. I mounted the sim and tutorial repo to the underlay_ws and built there

@stevedanomodolor
Copy link
Author

I think found the issue. This line:

64fce3b#diff-2302c3058efb8f702a32ded1a29b2f16814c1ddcf50a9313561540fe0955ab44R96

Seems to reference casing that is not consistent on my machine (ubuntu). I still haven't gotten it to come up cleanly yet but I think that was the main blocker.

What line exactly, this is a commit that includes multiple changes

@litch
Copy link

litch commented Jul 6, 2025

Sorry the line in question is highlighted at the bottom (but didn't actually zoom there). I think (thought?) it had to do with the casing in that line, but am still not there.

@stevedanomodolor
Copy link
Author

Sorry the line in question is highlighted at the bottom (but didn't actually zoom there). I think (thought?) it had to do with the casing in that line, but am still not there.

I still don't get the line you are referring too. Can you send a screenshot.

@stevedanomodolor
Copy link
Author

Did you source your environment after the build? Might sound silly just to confirm.
If you can send me all the commands you ran until the ros2
ros2 launch nav2_gps_waypoint_follower_demo gazebo_gps_world.launch.py

@stevedanomodolor
Copy link
Author

stevedanomodolor commented Jul 6, 2025

Also I tested mine with the rolling docker

@litch
Copy link

litch commented Jul 6, 2025

I think the problem is related to this block:

   <include>
        <uri>
            https://fuel.gazebosim.org/1.0/OpenRobotics/models/Sonoma Raceway
        </uri>
        <name>sonoma_raceway</name>
        <pose>-287.5 143.5 -7 0 0 0</pose>
    </include>

At least for what I'm experiencing. If I xacro the world.sdf file, and try to launch it with just gz sim world.sdf it just comes up with the blank screen. I can't figure out why. Whereas I am able to gz sim ~/.gz/fuel/<path_to_the_actual_model>/model.sdf the sonoma raceway pops up just fine.

I'm working on a super clean repro in the nav2 dev container because I was working from within my project's dev container, which may be dirty or something.

(I'm using Jazzy for the record)

@stevedanomodolor
Copy link
Author

I think the problem is related to this block:

   <include>
        <uri>
            https://fuel.gazebosim.org/1.0/OpenRobotics/models/Sonoma Raceway
        </uri>
        <name>sonoma_raceway</name>
        <pose>-287.5 143.5 -7 0 0 0</pose>
    </include>

At least for what I'm experiencing. If I xacro the world.sdf file, and try to launch it with just gz sim world.sdf it just comes up with the blank screen. I can't figure out why. Whereas I am able to gz sim ~/.gz/fuel/<path_to_the_actual_model>/model.sdf the sonoma raceway pops up just fine.

I'm working on a super clean repro in the nav2 dev container because I was working from within my project's dev container, which may be dirty or something.

(I'm using Jazzy for the record)

The Sonora model is in the repo actually. This is where it is called from the launch file.

https://github.com/stevedanomodolor/navigation2_tutorials/blob/feat%2Fupdate_gps_tutorial/nav2_gps_waypoint_follower_demo%2Flaunch%2Fgazebo_gps_world.launch.py#L48-L53

Which launch file are you using?

@litch
Copy link

litch commented Jul 6, 2025

Oh. That file does not seem to exist in the branch you are referencing:

https://github.com/stevedanomodolor/nav2_minimal_turtlebot_simulation/tree/feat/update_gps_tutorial/nav2_minimal_tb3_sim/worlds

@litch
Copy link

litch commented Jul 6, 2025

git clone -b feat/update_gps_tutorial https://github.com/stevedanomodolor/navigation2_tutorials.git
git clone -b feat/update_gps_tutorial https://github.com/stevedanomodolor/nav2_minimal_turtlebot_simulation.git

cd nav2_minimal_turtlebot_simulation
colcon build
source install/setup.bash

cd ../navigation2_tutorials
colcon build --packages-select nav2_gps_waypoint_follower_demo 
source install/setup.bash

ros2 launch nav2_gps_waypoint_follower_demo gazebo_gps_world.launch.py

This is how I launch it btw. I'm certain I've got the sourcing happening.

Still waiting on the nav2 dev container to finish building (30 minutes in at this point)

@litch
Copy link

litch commented Jul 6, 2025

It did launch fine in the rolling dev container.

@stevedanomodolor
Copy link
Author

It did launch fine in the rolling dev container.

Can you try the same in jazzy, to see if it works?

@litch
Copy link

litch commented Jul 6, 2025

I may give bringing it up in Jazzy a shot later in the day. Another thing to mention is that Bing Maps API Key (as referenced in the docs) is totally deprecated (swri-robotics/mapviz#851), so i'm not sure the best path forward there (and the mapviz folks don't seem to have a hyper clear answer either) =/

@stevedanomodolor
Copy link
Author

stevedanomodolor commented Jul 6, 2025

I may give bringing it up in Jazzy a shot later in the day. Another thing to mention is that Bing Maps API Key (as referenced in the docs) is totally deprecated (swri-robotics/mapviz#851), so i'm not sure the best path forward there (and the mapviz folks don't seem to have a hyper clear answer either) =/

In the pr of nav2.orgs I explained the use of stadia maps with their API. There is also even an option to have maps locally. Please read my branch of the nav2.orgs😅 not the explanation currently on the nav2 website. I removed the bing option because indeed it is deprecated.

@stevedanomodolor
Copy link
Author

I may give bringing it up in Jazzy a shot later in the day. Another thing to mention is that Bing Maps API Key (as referenced in the docs) is totally deprecated (swri-robotics/mapviz#851), so i'm not sure the best path forward there (and the mapviz folks don't seem to have a hyper clear answer either) =/

Screenshot_2025-07-06-19-13-45-630_com.github.android.jpg

Screenshot_2025-07-06-19-13-00-635_com.github.android.jpg

Screenshot_2025-07-06-19-13-41-128_com.github.android.jpg

@Heet06
Copy link

Heet06 commented Jul 6, 2025

I tried it in jazzy and it shows a blank screen, here are the log files
launch.txt

@stevedanomodolor
Copy link
Author

I tried it in jazzy and it shows a blank screen, here are the log files launch.txt

@Heet06
Are you using exaclty the launch file that Is in the repo?
I can try it later today in jazzy, it should run without any problem but I will double check.

Please to make sure that it is not your environment can you try what @litch did.

git clone -b feat/update_gps_tutorial https://github.com/stevedanomodolor/navigation2_tutorials.git
git clone -b feat/update_gps_tutorial https://github.com/stevedanomodolor/nav2_minimal_turtlebot_simulation.git

cd nav2_minimal_turtlebot_simulation
colcon build
source install/setup.bash

cd ../navigation2_tutorials
colcon build --packages-select nav2_gps_waypoint_follower_demo
source install/setup.bash

ros2 launch nav2_gps_waypoint_follower_demo gazebo_gps_world.launch.py

also build the latest nav2 branch too.

@litch
Copy link

litch commented Jul 6, 2025

Ok. I was working from your repo and put my stadiamaps api key (which was a UUID) and just got a continuous screaming about "NETWORK ERROR: Host requires authentication" and I thought it may be because of the bing api key being blank but it seems I had just pasted my stadiamaps API key wrongly.

Sorry for false alarm. =)

I also found in the docs you have the params for the keyboard to emit stamped correctly. Thank you.

The nav2 dev container didn't seem to have rviz2 in it, so I had to add rviz2 for the final step to work, but yeah I got the whole stack up and running. Phew! That was a lot of work but it's very cool =)

@stevedanomodolor
Copy link
Author

Ok. I was working from your repo and put my stadiamaps api key (which was a UUID) and just got a continuous screaming about "NETWORK ERROR: Host requires authentication" and I thought it may be because of the bing api key being blank but it seems I had just pasted my stadiamaps API key wrongly.

Sorry for false alarm. =)

I also found in the docs you have the params for the keyboard to emit stamped correctly. Thank you.

The nav2 dev container didn't seem to have rviz2 in it, so I had to add rviz2 for the final step to work, but yeah I got the whole stack up and running. Phew! That was a lot of work but it's very cool =)

About the rviz2 thing, I have always wondered why it was not in the docker file by default, always installed it. @SteveMacenski thoughts

@Heet06
Copy link

Heet06 commented Jul 7, 2025

I think the issue is with Gazebo environment variable that needs to be set for gazebo which in docker container is already done, it should be something like this:
gazebo_resource_path = SetEnvironmentVariable( "GZ_SIM_RESOURCE_PATH", model_path )

@Heet06
Copy link

Heet06 commented Jul 7, 2025

I think the issue is with Gazebo environment variable that needs to be set for gazebo which in docker container is already done, it should be something like this: gazebo_resource_path = SetEnvironmentVariable( "GZ_SIM_RESOURCE_PATH", model_path )

Another thing is use sdf for world it works!

@stevedanomodolor
Copy link
Author

stevedanomodolor commented Jul 7, 2025

I think the issue is with Gazebo environment variable that needs to be set for gazebo which in docker container is already done, it should be something like this: gazebo_resource_path = SetEnvironmentVariable( "GZ_SIM_RESOURCE_PATH", model_path )

Another thing is use sdf for world it works!

Happy to hear you got it running on Jazzy. 🎉🎉🎉

we indeed set the variable in the launch file.
https://github.com/stevedanomodolor/nav2_minimal_turtlebot_simulation/blob/main/nav2_minimal_tb3_sim%2Flaunch%2Fspawn_tb3_gps.launch.py#L114-L120

With respect to the SDF file format, .SDF.xacro shouldnt be a problem either. I guess it depends how you set it from your launch file.

In the case you are creating a custom launch file I would recommend you see the following example;

https://github.com/stevedanomodolor/nav2_minimal_turtlebot_simulation/blob/12577c6ad817a3ea0cf2b2a529f14644b656c449/nav2_minimal_tb3_sim/launch/spawn_tb3.launch.py

@Heet06
Copy link

Heet06 commented Jul 7, 2025

My simulation is working and keyboard teleop also works but waffle doesn't move when using nav2 any suggestions if someone knows why and how this happened and I am using all the same things from the repository.

@stevedanomodolor
Copy link
Author

My simulation is working and keyboard teleop also works but waffle doesn't move when using nav2 any suggestions if someone knows why and how this happened and I am using all the same things from the repository.

Can you send me a video or something to understand what you mean?

Copy link
Member

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broadly approved (assuming the other users can get it to work)! Should this be backported into any of the other branches?

@@ -196,10 +195,11 @@ local_costmap:
raytrace_min_range: 0.0
obstacle_max_range: 2.5
obstacle_min_range: 0.0
static_layer:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is used in the configuration


# GPS WPF CHANGE: Remove static layer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you leave these comments in?

always_send_full_costmap: True

# GPS WPF CHANGE: Remove static layer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

@@ -247,19 +249,48 @@ global_costmap:
# ros__parameters:
# yaml_filename: ""

keepout_filter_mask_server:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these be removed since they're not used in this demo? This and the new things below

@stevedanomodolor
Copy link
Author

stevedanomodolor commented Jul 7, 2025

Broadly approved (assuming the other users can get it to work)! Should this be backported into any of the other branches?

Most likely it should, especially for jazzy. @Heet06 mentioned he had an issue with jazzy, not sure if it is special configuration he has on his side or the same as the tutorial. I will test this on the jazzy branch to see if any problem arises.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants