turtlebot / turtlebot4

Turtlebot4 common packages.
Apache License 2.0
105 stars 47 forks source link

Turtlebot4 lite Obstacle avoidance and performance issues #141

Closed stalinADAQ closed 1 year ago

stalinADAQ commented 1 year ago
  1. I am currently using RPI4 with 4GB for turtlebot4 lite. I could use navigation to move the robot from Point A to Point B, but now i would like to add obstacle avoidance while moving from A to B. How to do that ? is it already implemented and or need to be enabled ?
  2. I understand that, there is way to view stereo depth camera from robot_view by enabling in the rviz tool, but it hanging entire process if we enable the stereo depth camera ? Is 4GB ram is not sufficient to monitor the camera ?
  3. While running navigation using "ros2 launch turtlebot4_navigation localization.launch.py map:=office.yaml" "ros2 launch turtlebot4_navigation nav2.launch.py" it is always timed out waiting for odom server and unable fetch the odom topic. How to resolve this issue as well ?
roni-kreinin commented 1 year ago
  1. Nav2 will avoid obstacles by default. You can view the nav2 documentation for more details: https://navigation.ros.org/
  2. Depending on which version of ROS2 you are running, you can try out some different launch files for the camera. For Galactic: https://github.com/luxonis/depthai-ros/blob/galactic/depthai_examples/launch/rgb_stereo_node.launch.py For Humble: Modify https://github.com/turtlebot/turtlebot4_robot/blob/humble/turtlebot4_bringup/config/oakd_lite.yaml to publish the stereo image. See https://github.com/luxonis/depthai-ros/blob/humble/depthai_ros_driver/config/camera.yaml for an example.
  3. If you are using simple discovery, make sure you have connected the Create 3 to your Wi-Fi network. You should be able to echo the /odom topic from either the RPi4 or your PC.
stalinADAQ commented 1 year ago
  1. But in my turtlebot4 lite setup, obstacle avoidance is not working ? I have followed the same documentation as [https://turtlebot.github.io/turtlebot4-user-manual/tutorials/navigation.html]. Kindly advice
  2. The access point used here is mobile hotspot and operating only in 2.4GHz , is it having any performance problem ?
roni-kreinin commented 1 year ago
  1. Have you generated your own map? Which launch files are you using for navigating?
  2. I would highly recommend using a 5GHz access point for the RPi4 especially if you are trying to stream video data. Even at the low resolution that the TurtleBot 4 uses, it can be quite taxing on network usage.
stalinADAQ commented 1 year ago

@roni-kreinin yes, I am using my own map generated from SLAM.

  1. $ ros2 launch turtlebot4_navigation localization.launch.py map:=my_room.yaml $ ros2 launch turtlebot4_navigation nav2.launch.py $ ros2 launch turtlebot4_viz view_robot.launch.py using above three command for starting the navigation.

  2. Another problem is even without camera, it is taking longer time activate navigation. after 5-10 minutes only it starting the navigation ?
roni-kreinin commented 1 year ago

What are the issues with obstacle avoidance? Is the robot driving into obstacles that you can see on the map? As for the activation time, are there any errors being reported by either localization or nav2 in the terminal?

Also, are you running Galactic or Humble?

stalinADAQ commented 1 year ago

Yes, it not detecting obstacles and trying drive into obstacles and failing to doso, if we manually clear the obstacle it going ahead. We are using humble. I don't see any errors, but I will try to collect logs and share to you. Are the launch files are correct?

roni-kreinin commented 1 year ago

The launch files are correct. Can you record your RViz while running navigation and share that here?

stalinADAQ commented 1 year ago

@roni-kreinin please find the attached logs of the three terminal after running the navigation. I could not collect the lengthy log but it should give you insight of the problem. localization_launch.txt nav2_launch.txt RVIZ.txt

roni-kreinin commented 1 year ago

From the RViz errors it looks like there is an issue with the time sync between the RPi and the Create 3. Try calling turtlebot4-ntpd-sync from the RPi4 or accessing the Create 3 webserver and restarting ntpd from the Beta Features tab.

stalinADAQ commented 1 year ago

@roni-kreinin Thanks for pointing me in right direction, after turtlebot4-ntpd-sync, the obstacle avoidance is active in navigation and relatively the time for starting the navigation is less (still about 3-4 minutes of pose estimation). But one problem is, the moment obstacle is detected and not cleared for 3-5 sec, then the navigation in the RVIZ getting feed back as aborted. And hence it is not moving to new target.

Also the initial pose delay is due to wi-fi speed ?

roni-kreinin commented 1 year ago

I would need a screen recording of what is going on to help with this. Try using a program like Peek from the Ubuntu software store to record your screen.

Generally, the pose estimation is pretty instant from when you give the pose estimate in Rviz.

stalinADAQ commented 1 year ago

@roni-kreinin please find the below link for screen recorded video,

https://we.tl/t-sdS0ZHoqSt

I have uploaded in wetranfer due to size limitation. You can see the lag between pose and navigation and also obstacle abort problem at (9:22 minutes in video). Infact this time the response was much better :).

Please check and advise !

stalinADAQ commented 1 year ago

@roni-kreinin waiting for your feedback, after reviewing above video.

roni-kreinin commented 1 year ago

@stalinADAQ From looking at the video, it looks like when you ran ros2 topic list your PC could not see the Create 3 topics. This is why it took so long to start up navigation. Did you run all of this right after booting the robot?

As for the obstacle avoidance, the behaviour looked pretty normal. You can modify the nav2 config if you want to change the behaviour.

Take a look at Nav2 Github and Nav2 Documentation for more details.

stalinADAQ commented 1 year ago

@roni-kreinin

  1. No, I am waiting until ros2 topic list shows all the topics published by create3 and then only running the navigation. But still it is taking 3-5 minutes to start the navigation.
  2. During the course of booting the Create3 platform is showing RED in light ring for few seconds then giving chime sound. Is it normal ? because some times it is un responsive and not able to switch off on/off also ?
  3. Yes, as i also mentioned in the video the obstacle behavior looks normal, but when there is obstacle present for little longer period, the navigation getting aborted. how to resolve this ? Setup : ROS2 Humble 1.1 with Simple Discovery.
  4. Also the turtlebot4-ntpd-sync need to be run every time we startup the ROBOT or only once enough ?
  5. Still Am unable to use the Stereo camera at all, the moment it is enabled in RVIZ the entire process getting hanged.
  6. Should i check Discovery server for better performance or simple discovery is good ?
roni-kreinin commented 1 year ago
  1. This is the list of topics you should see from just the RPi4:

    /battery_state
    /cmd_vel
    /diagnostics
    /dock_status
    /function_calls
    /interface_buttons
    /ip
    /joint_states
    /joy
    /joy/set_feedback
    /parameter_events
    /robot_description
    /rosout
    /tf
    /tf_static
    /wheel_status

    And this is the full list when the Create 3 is publishing too:

    /battery_state
    /cmd_audio
    /cmd_lightring
    /cmd_vel
    /diagnostics
    /dock_status
    /function_calls
    /hazard_detection
    /imu
    /interface_buttons
    /ip
    /ir_intensity
    /ir_opcode
    /joint_states
    /joy
    /joy/set_feedback
    /kidnap_status
    /mobility_monitor/transition_event
    /mouse
    /odom
    /parameter_events
    /robot_description
    /robot_state/transition_event
    /rosout
    /slip_status
    /static_transform/transition_event
    /stop_status
    /tf
    /tf_static
    /wheel_status
    /wheel_ticks
    /wheel_vels

    I usually look for the 3 /wheel_ topics to indicate that the create 3 is up and running. From your video, only the RPi4 topics were up when you launched navigation.

  2. Regarding the red lightring, that seems to be an issue with CycloneDDS on the Create 3. Generally it will go away once the robot has booted and the chimes play. If it gets stuck in that state, you can press and hold the power button for 20-30s to perform a hardware reboot of the Create 3.

  3. For navigation, you could try running SLAM + Nav2 instead of Localization + Nav2. That way you will be creating the map as you navigate, so if you have moving obstacles, they should get picked up on the map.

  4. The ntp sync should be called whenever the clocks are out of sync. I am looking into a better solution for this issue.

  5. For the stereo camera, what changes did you make to enable it?

  6. If you are just running one robot, I would recommend the discovery server. You can then disconnect the Create 3 from Wi-Fi, and the topics may come up faster.

schenkch commented 1 year ago

For me also obstacle avoidance is not working properly with Galactic and the Turtlebot4 Standard. Have you found a solution for the time sync issue yet? For this, do you also recommend the discovery server when just running one robot?

hilary-luo commented 1 year ago

This issue is being closed due to inactivity. If you are still experiencing the issue, feel free to reopen this ticket when you are ready to continue the troubleshooting process.

Vasanth28897 commented 1 year ago

@roni-kreinin I just want to know, by how the obstacle avoidance works in the turtlebot4, when i run these commands... ros2 launch turtlebot4_navigation nav2.launch.py ros2 launch turtlebot4_navigation localisation.launch.py map:=my_map.yaml ros2 launch turtlebot4_viz view_robot.launch.py

with the help of RPI-Lidar or OAK-D camera or both?

hilary-luo commented 1 year ago

@Vasanth28897 The short answer is just the lidar. The long answer is that those commands that you are referring to are launching Nav2. There are a lot of things that you can do with Nav2. All of the default Nav2 settings are contained in the config yaml files. You can modify this behaviour by making your own yaml files and passing them in when you launch nav2 and/or localization.

Vasanth28897 commented 1 year ago

thank you @hilary-luo. I am facing the same obstacle avoidance problem in the turtlebot4 when i run the nav2.launch.py like @stalinADAQ and @schenkch faced. I tried the time-sync command...it didn't work. I am using humble.

hilary-luo commented 1 year ago

@Vasanth28897 I am going to need you to expand on what you mean when you are referring to the "same obstacle avoidance problem". Preferably can you do this in a fresh ticket? Time has changed since then, the software has been updated in various ways so that symptom may have a different reason now.

Vasanth28897 commented 1 year ago

Alright, The lidar cannot hits the costmap around the mapped dynamic obstacle(not in the map during generation)as @hilary-luo mentioned in this issue. (Note: sometimes it hit the static obstacle also).

hilary-luo commented 1 year ago

@Vasanth28897 If I am understanding correctly, you are seeing that the robot is not avoiding dynamic obstacles. This issue is fixed in 1.0.4. You can use it now if you build from source, or it will be released in the next update. The issue and the temporary fix were tracked here: https://github.com/turtlebot/turtlebot4/issues/247

If it is hitting static obstacles then either a) it had issues seeing them (not at lidar height or are too skinny, too reflective or see through etc.) and you may need to block off those areas or if it is not the case, b) you can tune your nav2.yaml parameters to better work for your environment. Different environments and different desired operations will require different parameters.

Vasanth28897 commented 1 year ago

thank you @hilary-luo for the clarification. Will look after this.