Skip to content
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

Nav2 does not work on Jazzy #501

Open
aharshac opened this issue Nov 25, 2024 · 11 comments
Open

Nav2 does not work on Jazzy #501

aharshac opened this issue Nov 25, 2024 · 11 comments
Assignees
Labels
troubleshooting System not working as expected, may be user error.

Comments

@aharshac
Copy link

aharshac commented Nov 25, 2024

Robot Model

Turtlebot4 Standard

ROS distro

Jazzy

Networking Configuration

Discovery Server

OS

Ubuntu 24.04

Built from source or installed?

Installed

Package version

dpkg -l ros-jazzy-turtlebot4* | grep ^ii

ii ros-jazzy-turtlebot4-base 2.0.1-2noble.20241025.080249 arm64 Turtlebot4 Base Node
ii ros-jazzy-turtlebot4-bringup 2.0.1-2noble.20241118.200906 arm64 Turtlebot4 Robot Bringup
ii ros-jazzy-turtlebot4-description 2.0.1-1noble.20241118.200242 arm64 Turtlebot4 Description package
ii ros-jazzy-turtlebot4-diagnostics 2.0.1-2noble.20241025.080252 arm64 Turtlebot4 Diagnostics
ii ros-jazzy-turtlebot4-msgs 2.0.1-1noble.20240926.010643 arm64 Turtlebot4 Messages
ii ros-jazzy-turtlebot4-navigation 2.0.1-1noble.20241118.200018 arm64 Turtlebot4 Navigation
ii ros-jazzy-turtlebot4-node 2.0.1-1noble.20241018.082137 arm64 Turtlebot4 Node
ii ros-jazzy-turtlebot4-robot 2.0.1-2noble.20241118.201548 arm64 Turtlebot4 Robot Metapackage
ii ros-jazzy-turtlebot4-setup 2.0.2-1noble.20241025.080230 arm64 Turtlebot4 setup scripts
ii ros-jazzy-turtlebot4-tests 2.0.1-2noble.20241025.080005 arm64 Turtlebot4 System Tests

Type of issue

Navigation (SLAM, Nav2 etc.)

Expected behaviour

  1. Robot description is published on /robot_description
  2. Nav2 is initialized and robot shall move to goal

Actual behaviour

The same sequence was working on Humble but now does not on jazzy:

  1. Robot description is published on /robot_description, but empty (also seen on Humble)
  2. Nav2 is not initialized
  3. SSH connections to RPi are terminated and reconnected after a moment
  4. Create 3 and RPu do not publish tf
  5. nav2 local and global costmaps are not published

Error messages

Logs to follow.

To Reproduce

  1. rviz2 -d
  2. ros2 launch turtlebot4_navigation slam.launch.py
  3. ros2 launch turtlebot4_navigation nav2.launch.py

Other notes

No response

@aharshac aharshac added the troubleshooting System not working as expected, may be user error. label Nov 25, 2024
@aharshac
Copy link
Author

aharshac commented Nov 25, 2024

1. Turtlebot 4 Intialized

rosgraph_init
Nodes:
/analyzers
/create3_repub
/joint_state_publisher
/joy_linux_node
/launch_ros_1338
/oakd
/oakd_container
/robot_state_publisher
/rplidar_composition
/rqt_gui_py_node_190567
/teleop_twist_joy_node
/turtlebot4_base_node
/turtlebot4_diagnostics
/turtlebot4_node

@aharshac
Copy link
Author

2. slam_toolbox launched

rosgraph_slam_toolbox
Screenshot from 2024-11-25 15-42-10
Robot visualization cannot be seen.

Nodes:
/SlamToolboxPlugin
/SlamToolboxStateUpdateNode
/analyzers
/create3_repub
/joint_state_publisher
/joy_linux_node
/launch_ros_1338
/launch_ros_192027
/oakd
/oakd_container
/robot_state_publisher
/rplidar_composition
/rqt_gui_py_node_190567
/rviz
/rviz_navigation_dialog_action_client
/slam_toolbox
/teleop_twist_joy_node
/transform_listener_impl_581a8b2ebe10
/transform_listener_impl_581a8c196df0
/transform_listener_impl_624c17b81990
/turtlebot4_base_node
/turtlebot4_diagnostics
/turtlebot4_node

@aharshac
Copy link
Author

3. nav2 started

Nodes:
/SlamToolboxPlugin
/SlamToolboxStateUpdateNode
/behavior_server
/bt_navigator
/collision_monitor
/controller_server
/docking_server
/global_costmap/global_costmap
/joint_state_publisher
/launch_ros_1338
/lifecycle_manager_navigation
/local_costmap/local_costmap
/oakd
/oakd_container
/planner_server
/robot_state_publisher
/rqt_gui_py_node_190567
/rviz
/rviz_navigation_dialog_action_client
/smoother_server
/teleop_twist_joy_node
/transform_listener_impl_57a9e45c4340
/transform_listener_impl_581a8b2ebe10
/transform_listener_impl_581a8c196df0
/transform_listener_impl_59c442156410
/turtlebot4_diagnostics
/turtlebot4_node
/velocity_smoother
/waypoint_follower

Topics:
/battery_state
/behavior_server/transition_event
/bt_navigator/transition_event
/clicked_point
/clock
/cmd_vel
/cmd_vel_nav
/collision_monitor/transition_event
/controller_server/transition_event
/diagnostics
/diagnostics_agg
/dock_status
/docking_server/transition_event
/downsampled_costmap
/downsampled_costmap_updates
/function_calls
/global_costmap/costmap
/global_costmap/costmap_raw
/global_costmap/costmap_raw_updates
/global_costmap/costmap_updates
/global_costmap/global_costmap/transition_event
/global_costmap/published_footprint
/global_costmap/voxel_marked_cloud
/hazard_detection
/hmi/buttons
/hmi/display
/hmi/display/message
/hmi/led
/imu
/initialpose
/interface_buttons
/ip
/joint_states
/joy
/local_costmap/clearing_endpoints
/local_costmap/costmap
/local_costmap/costmap_raw
/local_costmap/costmap_raw_updates
/local_costmap/costmap_updates
/local_costmap/footprint
/local_costmap/local_costmap/transition_event
/local_costmap/published_footprint
/local_costmap/static_layer
/local_costmap/static_layer_raw
/local_costmap/static_layer_raw_updates
/local_costmap/static_layer_updates
/local_costmap/voxel_grid
/local_costmap/voxel_layer
/local_costmap/voxel_layer_raw
/local_costmap/voxel_layer_raw_updates
/local_costmap/voxel_layer_updates
/local_costmap/voxel_marked_cloud
/local_plan
/map
/map_updates
/mobile_base/sensors/bumper_pointcloud
/mouse
/oakd/imu/data
/oakd/rgb/preview/camera_info
/oakd/rgb/preview/image_raw
/oakd/rgb/preview/image_raw/compressed
/oakd/rgb/preview/image_raw/compressedDepth
/oakd/rgb/preview/image_raw/theora
/oakd/rgb/preview/image_raw/zstd
/odom
/optimal_trajectory
/parameter_events
/particle_cloud
/plan
/plan_smoothed
/planner_server/transition_event
/robot_description
/rosout
/scan
/smoother_server/transition_event
/speed_limit
/tf
/tf_static
/trajectories
/transformed_global_plan
/velocity_smoother/transition_event
/waypoint_follower/transition_event
/waypoints
/wheel_status

@aharshac
Copy link
Author

After starting nav2, outputs from rviz, slam_toolbox and nav2 hint at time sync issues. Also the image preview from OAK-D lags almost a second behind real-time!

rviz:

[SlamToolboxPlugin]: Waiting for the slam_toolbox node configuration.

slam_toolbox:

[slam_toolbox]: Message Filter dropping message: frame 'rplidar_link' at time 1732530543.461 for reason 'discarding message because the queue is full'

@smatarCPR
Copy link

Hello @aharshac ,
Thank you for reaching out on the Turtlebot 4 Github page. I am very sorry to hear you are encountering issues with the Turtlebot 4. Would it be possible to provide the following details:

  1. What version of the Create3 firmware version are you running? This can be found Create3 Webserver homepage or the Update tab - https://iroboteducation.github.io/create3_docs/webserver/home/ https://iroboteducation.github.io/create3_docs/webserver/update/
  2. Double check the Create3's connect tab and ensure that no Wi-Fi connection is being established on the Create3, this may affect the Discovery server.
  3. Are you running on NAV on the Raspberry Pi or the offboard computer (your computer)?
  4. Are you running on a 2.4 GHz or 5.0 GHz network?

Looking forward to hearing from you soon.
Best Regards,
Saif

@aharshac
Copy link
Author

aharshac commented Nov 29, 2024

Hi @smatarCPR

Here's my config:
Create 3: I.0.0.CycloneDDS (Iron)
RPi4 and PC: Ubuntu 24.04.1 LTS, ROS2 Jazzy

I solved the issues:

  1. These were caused by bandwidth throttling by the WiFi network or due to Fast DDS.
    Solved by using Cyclone DDS and zenoh-plugin-ros2dds between RPi and PC.
  1. Robot description is published on /robot_description, but empty (also seen on Humble)
  2. Nav2 is not initialized
  3. SSH connections to RPi are terminated and reconnected after a moment
  4. Create 3 and RPi do not publish tf
  1. nav2 costmaps not being published was because of use_sim_time being set true by the default config of turtlebot4_navigation.
    Solved by copying the default nav2 config and setting use_sim_time: false. Related issues local costmap, globalmap no map received. ros-navigation/navigation2#4288, No costmaps being published ros-navigation/navigation2#3034

@aharshac
Copy link
Author

aharshac commented Nov 29, 2024

Here's my config for anyone interested:

Create 3

Install I.0.0.CycloneDDS (Iron) firmware and adapt the application settings

ROS 2 Domain ID (default 0): 0
ROS 2 Namespace: /_do_not_use

RPi

export ROS_DOMAIN_ID=0
export ROS_AUTOMATIC_DISCOVERY_RANGE=SUBNET
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export CYCLONEDDS_URI="/home/ubuntu/cyclonedds_zenoh.xml"

cyclonedds_zenoh.xml

<CycloneDDS>
 <Domain>
     <General>
         <Interfaces>
             <NetworkInterface name="usb0"/>
             <!-- For less traffic, force multicast usage on loopback even if not configured.         -->
             <!-- All ROS Nodes and bridges must have this same config, otherwise they won't discover -->
             <!-- <NetworkInterface address="127.0.0.1" multicast="true"/> -->
             <NetworkInterface name="lo" priority="default" multicast="true" />
         </Interfaces>
         <DontRoute>true</DontRoute>
     </General>
 </Domain>
</CycloneDDS>

zenoh_rpi.json5

{
    "mode": "peer",
    "listen": { "endpoints": ["tcp/0.0.0.0:7447"] },
    "plugins": {
        "ros2dds": {
            "namespace": "/bot1",
            // "deny": {
            //     "publishers": [".*/_internal/.*", ".*/_do_not_use/.*"],
            //     "subscribers": [".*/_internal/.*", ".*/_do_not_use/.*"],
            //     "service_servers": [".*/_internal/.*", ".*/_do_not_use/.*"],
            //     "service_clients": [".*/_internal/.*", ".*/_do_not_use/.*"],
            //     "action_servers": [".*/_internal/.*", ".*/_do_not_use/.*"],
            //     "action_clients": [".*/_internal/.*", ".*/_do_not_use/.*"]
            // },
            "allow": {
                "publishers": [
                              ".*/battery_state",
                              // ".*/cliff_intensity",
                              // ".*/cmd_audio",
                              // ".*/cmd_lightring",
                              ".*/cmd_vel",
                              ".*/dock_status",
                              // ".*/hazard_detection",
                              ".*/imu",
                              // ".*/interface_buttons",
                              ".*/ir_intensity",
                              ".*/ir_opcode",
                              ".*/joint_states",
                              // ".*/kidnap_status",
                              // ".*/mobility_monitor/transition_event",
                              // ".*/mouse",
                              ".*/oakd/.*",
                              ".*/odom",
                              ".*/robot_description",
                              ".*/robot_state/transition_event",
                              ".*/scan",
                              // ".*/slip_status",
                              ".*/static_transform/transition_event",
                              // ".*/stop_status",
                              ".*/tf",
                              ".*/tf_static",
                              ".*/wheel_status",
                              // ".*/wheel_ticks",
                              // ".*/wheel_vels",
                              // "/clock",
                              // "/parameter_events",
                              // "/rosout",
                              // "/set_elevator",
                            ],
                "subscribers": [
                              ".*/battery_state",
                              // ".*/cliff_intensity",
                              // ".*/cmd_audio",
                              // ".*/cmd_lightring",
                              ".*/cmd_vel",
                              ".*/dock_status",
                              // ".*/hazard_detection",
                              ".*/imu",
                              // ".*/interface_buttons",
                              ".*/ir_intensity",
                              ".*/ir_opcode",
                              ".*/joint_states",
                              // ".*/kidnap_status",
                              // ".*/mobility_monitor/transition_event",
                              // ".*/mouse",
                              ".*/oakd/.*",
                              ".*/odom",
                              ".*/robot_description",
                              ".*/robot_state/transition_event",
                              ".*/scan",
                              // ".*/slip_status",
                              ".*/static_transform/transition_event",
                              // ".*/stop_status",
                              ".*/tf",
                              ".*/tf_static",
                              ".*/wheel_status",
                              // ".*/wheel_ticks",
                              // ".*/wheel_vels",
                              // "/clock",
                              // "/parameter_events",
                              // "/rosout",
                              // "/set_elevator",
                             ],
                "service_servers": [".*/start_motor", ".*/stop_motor", ".*/reset_pose"],
                "service_clients": [".*/start_motor", ".*/stop_motor", ".*/reset_pose"],
                "action_servers": [".*/dock", ".*/undock"],
                "action_clients": [".*/dock", ".*/undock"],
            },
            "pub_max_frequencies": [
                ".*/image_raw=20",
                ".*/image_raw/.*=20",
                ".*/camera_info=20"
            ]
        },
        "rest": { "http_port": 8000 }
    },
    "scouting": {
        "multicast": {
            "enabled": false
        },
        "gossip": {
            "enabled": false
        }
    }
}

PC

export ROS_DOMAIN_ID=10
export ROS_AUTOMATIC_DISCOVERY_RANGE=SUBNET
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp

zenoh_pc.json5

Replace in zenoh_rpi.json5 "listen": { "endpoints": ["tcp/0.0.0.0:7447"] }, with "connect": { "endpoints": ["tcp/<RPi IP address>:7447"] },

@aharshac
Copy link
Author

aharshac commented Dec 2, 2024

zenoh-bridge-ros2dds setup and usage

echo "deb [trusted=yes] https://download.eclipse.org/zenoh/debian-repo/ /" | sudo tee -a /etc/apt/sources.list.d/zenoh.list > /dev/null
sudo apt update
sudo apt install zenoh-bridge-ros2dds

Install on both RPi and PC

Usage

RPi

zenoh-bridge-ros2dds -c ~/zenoh_rpi.json5

PC

zenoh-bridge-ros2dds -c ~/zenoh_pc.json5

The zenoh bridge should be started manually on both RPi and PC. Adapt the config paths as needed.

@aaronchongth
Copy link

I found that peer mode would still sometimes be flaky, and starting a zenoh router on the host PC, before starting the bridges' with mode client makes it repeatable

@aharshac
Copy link
Author

aharshac commented Dec 5, 2024

@aaronchongth Thanks for the tip!

Do you mean something like this?

PC

  1. zenoh-bridge-ros2dds router
  2. zenoh-bridge-ros2dds -c ~/zenoh_pc.json5 <-- mode changed to client

RPi

zenoh-bridge-ros2dds -c ~/zenoh_rpi.json5 <-- mode changed to client

@aaronchongth
Copy link

@aharshac, it would be using the zenohd command to start a router
you can check out https://zenoh.io/docs/getting-started/installation/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
troubleshooting System not working as expected, may be user error.
Projects
None yet
Development

No branches or pull requests

4 participants