ros-navigation / navigation2_tutorials

Tutorial code referenced in https://docs.nav2.org/
180 stars 124 forks source link

nav2_gps_waypoint_follower_demo: mapviz error #73

Closed kevinpretell closed 7 months ago

kevinpretell commented 10 months ago

Hi, I'm starting to use nav2 and I was following your tutorial: https://navigation.ros.org/tutorials/docs/navigation2_with_gps.html#

at the "Localization Testing" step when I run the second command ros2 launch nav2_gps_waypoint_follower_demo mapviz.launch.py

I get the following error:

[mapviz-1] [WARN] [1699186927.537189075] [mapviz]: [transform_manager]: No transformer from 'wgs84' to 'map'. If 'map' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [ERROR] [1699186927.537354140] [mapviz]: Error: No transform between wgs84 and map
.
.
[mapviz-1] [WARN] [1699186929.295457865] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [WARN] [1699186929.314493185] [mapviz]: [transform_manager]: No transformer from 'base_link' to 'tf'. If 'base_link' is a /tf frame, it may not have been broadcast recently.

Below is the complete error

ros2 launch nav2_gps_waypoint_follower_demo mapviz.launch.py
[INFO] [launch]: All log files can be found below /home/kevin/.ros/log/2023-11-05-13-22-00-531001-kevin-ThinkPad-T480-7436
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [mapviz-1]: process started with pid [7446]
[INFO] [initialize_origin.py-2]: process started with pid [7448]
[INFO] [static_transform_publisher-3]: process started with pid [7450]
[static_transform_publisher-3] [WARN] [1699186922.433718400] []: Old-style arguments are deprecated; see --help for new-style arguments
[static_transform_publisher-3] [INFO] [1699186922.684386487] [swri_transform]: Spinning until stopped - publishing transform
[static_transform_publisher-3] translation: ('0.000000', '0.000000', '0.000000')
[static_transform_publisher-3] rotation: ('0.000000', '0.000000', '0.000000', '1.000000')
[static_transform_publisher-3] from 'map' to 'origin'
[mapviz-1] Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
[mapviz-1] [INFO] [1699186926.091411025] [mapviz]: Target frame selected: <none>
[initialize_origin.py-2] [INFO] [1699186926.684224944] [initialize_origin]: Origin: auto
[initialize_origin.py-2] [INFO] [1699186926.691551299] [initialize_origin]: Frame: map
[initialize_origin.py-2] /home/kevin/ros2_humble/install/rclpy/local/lib/python3.10/dist-packages/rclpy/qos.py:307: UserWarning: DurabilityPolicy.RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL is deprecated. Use DurabilityPolicy.TRANSIENT_LOCAL instead.
[initialize_origin.py-2]   warnings.warn(
[mapviz-1] [INFO] [1699186927.135734224] [mapviz]: View scale: 1.000000 meters/pixel
[initialize_origin.py-2] [INFO] [1699186927.270977861] [initialize_origin]: Got NavSat message.
[initialize_origin.py-2] [INFO] [1699186927.291337853] [initialize_origin]: Origin from 'navsat' source set to 38.1614563499149, -122.45460631151656, 488.32879648171365
[initialize_origin.py-2] [INFO] [1699186927.305467454] [initialize_origin]: Successfully set origin; unsubscribing.
[mapviz-1] [INFO] [1699186927.306416807] [mapviz]: Subscribing to /local_xy_origin
[mapviz-1] [INFO] [1699186927.359070807] [mapviz]: Found mapviz plugin: mapviz_plugins/attitude_indicator
[mapviz-1] [INFO] [1699186927.359166139] [mapviz]: Found mapviz plugin: mapviz_plugins/coordinate_picker
[mapviz-1] [INFO] [1699186927.359196662] [mapviz]: Found mapviz plugin: mapviz_plugins/disparity
[mapviz-1] [INFO] [1699186927.359220443] [mapviz]: Found mapviz plugin: mapviz_plugins/draw_polygon
[mapviz-1] [INFO] [1699186927.359245504] [mapviz]: Found mapviz plugin: mapviz_plugins/float
[mapviz-1] [INFO] [1699186927.359280008] [mapviz]: Found mapviz plugin: mapviz_plugins/gps
[mapviz-1] [INFO] [1699186927.359312167] [mapviz]: Found mapviz plugin: mapviz_plugins/grid
[mapviz-1] [INFO] [1699186927.359343791] [mapviz]: Found mapviz plugin: mapviz_plugins/image
[mapviz-1] [INFO] [1699186927.359375453] [mapviz]: Found mapviz plugin: mapviz_plugins/laserscan
[mapviz-1] [INFO] [1699186927.359417993] [mapviz]: Found mapviz plugin: mapviz_plugins/marker
[mapviz-1] [INFO] [1699186927.359438878] [mapviz]: Found mapviz plugin: mapviz_plugins/measuring
[mapviz-1] [INFO] [1699186927.359460504] [mapviz]: Found mapviz plugin: mapviz_plugins/multires_image
[mapviz-1] [INFO] [1699186927.359482773] [mapviz]: Found mapviz plugin: mapviz_plugins/navsat
[mapviz-1] [INFO] [1699186927.359519369] [mapviz]: Found mapviz plugin: mapviz_plugins/occupancy_grid
[mapviz-1] [INFO] [1699186927.359553258] [mapviz]: Found mapviz plugin: mapviz_plugins/odometry
[mapviz-1] [INFO] [1699186927.359578606] [mapviz]: Found mapviz plugin: mapviz_plugins/path
[mapviz-1] [INFO] [1699186927.359612085] [mapviz]: Found mapviz plugin: mapviz_plugins/plan_route
[mapviz-1] [INFO] [1699186927.359665948] [mapviz]: Found mapviz plugin: mapviz_plugins/point_click_publisher
[mapviz-1] [INFO] [1699186927.359727957] [mapviz]: Found mapviz plugin: mapviz_plugins/pointcloud2
[mapviz-1] [INFO] [1699186927.359778964] [mapviz]: Found mapviz plugin: mapviz_plugins/pose
[mapviz-1] [INFO] [1699186927.359825089] [mapviz]: Found mapviz plugin: mapviz_plugins/robot_image
[mapviz-1] [INFO] [1699186927.359883716] [mapviz]: Found mapviz plugin: mapviz_plugins/route
[mapviz-1] [INFO] [1699186927.360032253] [mapviz]: Found mapviz plugin: mapviz_plugins/string
[mapviz-1] [INFO] [1699186927.360129547] [mapviz]: Found mapviz plugin: mapviz_plugins/textured_marker
[mapviz-1] [INFO] [1699186927.360264900] [mapviz]: Found mapviz plugin: mapviz_plugins/tf_frame
[mapviz-1] [INFO] [1699186927.360550336] [mapviz]: Found mapviz plugin: mapviz_plugins/tile_map
[mapviz-1] [INFO] [1699186927.366819335] [mapviz]: Loading configuration from /home/kevin/kev_ws/install/nav2_gps_waypoint_follower_demo/share/nav2_gps_waypoint_follower_demo/config/gps_wpf_demo.mvc
[mapviz-1] [INFO] [1699186927.367797404] [mapviz]: fixed frame selected: map
[mapviz-1] [INFO] [1699186927.367930217] [mapviz]: Target frame selected: map
[mapviz-1] [INFO] [1699186927.371868189] [mapviz]: creating: mapviz_plugins/tile_map
[mapviz-1] [WARN] [1699186927.537189075] [mapviz]: [transform_manager]: No transformer from 'wgs84' to 'map'. If 'map' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [ERROR] [1699186927.537354140] [mapviz]: Error: No transform between wgs84 and map
[mapviz-1] [INFO] [1699186927.537915991] [mapviz]: Reorder displays
[mapviz-1] [INFO] [1699186927.543621743] [mapviz]: creating: mapviz_plugins/point_click_publisher
[mapviz-1] [INFO] [1699186928.373131851] [mapviz]: Publishing points to topic: clicked_point
[mapviz-1] [INFO] [1699186928.383323504] [mapviz]: Ready.
[mapviz-1] [INFO] [1699186928.429633950] [mapviz]: Reorder displays
[mapviz-1] [INFO] [1699186928.429773572] [mapviz]: Publishing points to topic: clicked_point
[mapviz-1] [INFO] [1699186928.450993260] [mapviz]: creating: mapviz_plugins/tf_frame
[mapviz-1] [INFO] [1699186928.493739732] [mapviz]: Reorder displays
[mapviz-1] [WARN] [1699186928.496914266] [mapviz]: Waiting for transform.
[mapviz-1] [INFO] [1699186928.497490327] [mapviz]: Setting target frame to to base_link
[mapviz-1] [INFO] [1699186928.504547484] [mapviz]: creating: mapviz_plugins/navsat
[mapviz-1] [INFO] [1699186928.576091935] [mapviz]: Reorder displays
[mapviz-1] [WARN] [1699186928.581271037] [mapviz]: No messages received.
[mapviz-1] [INFO] [1699186928.622145884] [mapviz]: Subscribing to /gps/fix
[mapviz-1] [WARN] [1699186928.669973665] [mapviz]: [transform_manager]: No transformer from 'base_link' to 'map'. If 'base_link' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [INFO] [1699186928.940983553] [mapviz]: OK
[mapviz-1] [WARN] [1699186928.966091841] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [WARN] [1699186928.966204912] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [WARN] [1699186929.295457865] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [WARN] [1699186929.314493185] [mapviz]: [transform_manager]: No transformer from 'base_link' to 'tf'. If 'base_link' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [WARN] [1699186929.334351789] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [WARN] [1699186929.419833049] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [ERROR] [1699186929.432907198] [mapviz]: NETWORK ERROR: Protocol "" is unknown
[mapviz-1] [WARN] [1699186929.440230266] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [WARN] [1699186929.443635410] [mapviz]: [transform_manager]: No transformer from 'base_link' to 'tf'. If 'base_link' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [WARN] [1699186929.454462204] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [ERROR] [1699186929.468745364] [mapviz]: NETWORK ERROR: Protocol "" is unknown
[mapviz-1] [WARN] [1699186929.469391118] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [ERROR] [1699186929.477346367] [mapviz]: NETWORK ERROR: Protocol "" is unknown
[mapviz-1] [INFO] [1699186929.492517608] [mapviz]: OK
[mapviz-1] [INFO] [1699186929.785185251] [mapviz]: OK

How do I fix it? My version of ros2 is humble, i installed mapviz and robot localization as mentioned at the beginning after i copied the folder into my workspace and did build.

kk2491 commented 9 months ago

@kevinpretell I am facing the exact same problem. Were you able to fix the issue and get the demo running ? In my case I am using ROS2 Galactic.

Thank you,
Kishor

kevinpretell commented 8 months ago

@SteveMacenski Sorry to bother you, can you please confirm if the tutorial works correctly on ROS2 Humble or has it been tested without errors? Maybe we need to set up some configuration files first?

Thank you so much for a job well done!

derDieDasJojo commented 8 months ago

I am facing the same problem. There seems to be some transformation missing?

kk2491 commented 8 months ago

@kevinpretell @derDieDasJojo I am not sure if this helps. I upgraded my Ubuntu to 22.04, and installed ROS2 Iron. Now things are working fine. And I am able to run the examples without any issues.

Thank you,
KK

derDieDasJojo commented 8 months ago

@kk2491 thats intresting. I tried to do the same by uninstaling ros2 humble and installing ros2 iron on my ubuntu 22.04. But I still get the same error messages and no map showing:

mapviz-1] [WARN] [1702569695.251569361] [mapviz]: [transform_manager]: Local XY frame has not been initialized.
[mapviz-1] [WARN] [1702569695.252055476] [swri_transform_util::Transformer]: Wgs84Transformer not initialized
[mapviz-1] [WARN] [1702569695.252078702] [swri_transform_util::Transformer]: Wgs84Transformer not initialized
[mapviz-1] [WARN] [1702569695.252112022] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [ERROR] [1702569695.354455995] [mapviz]: [transform_manager]: Could not find a connection between 'map' and 'base_link' because they are not part of the same tree.Tf has two or more unconnected trees.
[mapviz-1] [WARN] [1702569695.354612630] [mapviz]: [transform_manager]: Failed to get tf transform ('base_link' to 'map').  Both frames exist in tf.

I am running the following 3 launch-files:

ros2 launch nav2_gps_waypoint_follower_demo gazebo_gps_world.launch.py
ros2 launch nav2_gps_waypoint_follower_demo dual_ekf_navsat.launch.py
ros2 launch nav2_gps_waypoint_follower_demo mapviz.launch.py

One thing that I have noticed is that gazebo is not showing my robot. I am not sure why.

@kk2491 are you doing anything different here?

kk2491 commented 8 months ago

@derDieDasJojo I just tried again (used the above 3 launch files you have given), I am able to run, and not seeing any errors.

[mapviz-1] [WARN] [1702570871.783404222] [swri_transform_util::Transformer]: Wgs84Transformer not initialized
[mapviz-1] [WARN] [1702570871.783424574] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[initialize_origin.py-2] [INFO] [1702570871.796950703] [initialize_origin]: Got NavSat message.
[initialize_origin.py-2] [INFO] [1702570871.797563044] [initialize_origin]: Origin from 'navsat' source set to 38.161456507517954, -122.45460671020092, 488.33200728707016
[initialize_origin.py-2] [INFO] [1702570871.799589770] [initialize_origin]: Successfully set origin; unsubscribing.
[mapviz-1] [INFO] [1702570871.804339842] [mapviz]: OK
[mapviz-1] [WARN] [1702570871.806684077] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [INFO] [1702570871.806887688] [mapviz]: OK
[mapviz-1] [ERROR] [1702570871.809344947] [mapviz]: NETWORK ERROR: Protocol "" is unknown
[mapviz-1] [WARN] [1702570871.824255350] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [WARN] [1702570871.844636430] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [INFO] [1702570871.864651834] [mapviz]: OK
[mapviz-1] [INFO] [1702570874.432322964] [mapviz]: API Key Set.
[mapviz-1] [INFO] [1702570874.444219597] [mapviz]: OK

I hope the humble was uninstalled cleanly. After installing Iron I had few issues, I removed everything and reinstalled the iron again and it started working.

Thank you,
KK

kevinpretell commented 8 months ago

@kk2491 so you are using humble again and it works? Have you installed any additional packages?

How did you clone and build the project? can you show me the commands you ran to import and build? maybe that's where I'm wrong

thanks

kk2491 commented 8 months ago

@kevinpretell sorry, I had typo. For me it didn't work in humble, and it works fine in iron. Even in iron I ran into few issues, so uninstalled and reinstalled iron again.

Thank you, KK

derDieDasJojo commented 8 months ago

Now I also managed to run it in iron. First I had to install the turtulebot3 packged so gazebo can simulate them: sudo apt install ros-iron-turtlebot3-* Then I had to start it in the opposite direction: 1) ros2 launch nav2_gps_waypoint_follower_demo mapviz.launch.py then add the Bing Key and click Save 2) ros2 launch nav2_gps_waypoint_follower_demo dual_ekf_navsat.launch.py 3) ros2 launch nav2_gps_waypoint_follower_demo gazebo_gps_world.launch.py

Maybe mapviz is expecting tranform messages that are sent only at the beginning by gazebo? Not sure just guessing.

kk2491 commented 8 months ago

You don't have execute in the reverse order, moreover I don't think the order matters. Probably it is due to incomplete removal of previous Ros version.

Anyways I'm happy that you got that running.

Thank you.

marcusvinicius178 commented 7 months ago

Hi @derDieDasJojo @kk2491 @kevinpretell I am facing a similar issue on my attempt, can you please assist me?

The issue is below:

https://robotics.stackexchange.com/questions/107630/interactive-waypoint-follower-script-in-navigation2-gps-waypoint-follower-tutori

Was someone able to run this tutorial successfully in ROS2 Galactic?

RyuseiiSama commented 7 months ago

Hello, i'm using humble and i'm still facing this issue. Seems like my Turtlebot is not showing up as well, and im getting a similar output as follows:

``[mapviz-1] [WARN] [1705901351.835835784] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently. [mapviz-1] [WARN] [1705901351.866320583] [swri_transform_util::Transformer]: Wgs84Transformer not initialized [mapviz-1] [WARN] [1705901351.866380780] [swri_transform_util::Transformer]: Wgs84Transformer not initialized [mapviz-1] [WARN] [1705901351.866419907] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently. [mapviz-1] [WARN] [1705901351.866725651] [swri_transform_util::Transformer]: Wgs84Transformer not initialized [mapviz-1] [WARN] [1705901351.866732839] [swri_transform_util::Transformer]: Wgs84Transformer not initialized [mapviz-1] [WARN] [1705901351.866741152] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently. [mapviz-1] [WARN] [1705901351.882790213] [swri_transform_util::Transformer]: Wgs84Transformer not initialized [mapviz-1] [WARN] [1705901351.882845552] [swri_transform_util::Transformer]: Wgs84Transformer not initialized [mapviz-1] [WARN] [1705901351.882877616] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently. [mapviz-1] [ERROR] [1705901351.987293235] [mapviz]: [transform_manager]: Could not find a connection between 'map' and 'base_link' because they are not part of the same tree.Tf has two or more unconnected trees. [mapviz-1] [WARN] [1705901351.987385667] [mapviz]: [transform_manager]: Failed to get tf transform ('base_link' to 'map'). Both frames exist in tf.

[mapviz-1] [WARN] [1705901351.989952208] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.

[mapviz-1] [ERROR] [1705901352.000022167] [mapviz]: NETWORK ERROR: Protocol "" is unknown

kk2491 commented 7 months ago

@marcusvinicius178 I too had similar issues, and not able to get the system up and running in Galactic. My suggestion would be to try with ROS2 Iron, because I really don't think Galactic would work after all.

Thank you,
KK

marcusvinicius178 commented 7 months ago

Hi @RyuseiiSama it just works in ROS2 IRON OR ROLLING (ONLY UBUNTU 22.04).

In addition you need to launch the files in the following order to make it work:

kartheekmedathati commented 3 months ago

Why does the order matter for this? Curious, as the tutorial on navigation the instructions are in the opposite order.