iRobotEducation / create3_docs

Documentation for the iRobot® Create®3 Educational Robot
BSD 3-Clause "New" or "Revised" License
49 stars 16 forks source link

Slow Action Server Response #497

Open LuHaofan opened 9 months ago

LuHaofan commented 9 months ago

I recently ordered a turtlebot4 standard for my research, which has an create 3 base. I am trying to drive my turtlebot with the action server using the instructions in the documentation. Specifically, I call this command in my CLI:

ros2 action send_goal /drive_distance irobot_create_msgs/action/DriveDistance \
"distance: 0.5
max_translation_speed: 0.3"

The prompt shows: Waiting for an action server to become available... And then it takes 20~30 seconds before I actually get a response from the robot and it starts to move. This delay is way too long for my application to bear and I wonder how to deal with this issue?

Here is some additional information about my setup and debugging process:

  1. I am using a WLAN network where only one turtlebot is present.
  2. I am using ROS2 Humble and the latest firmware from the irobot create3 website: H.2.3
  3. My operating system is Ubuntu 22.04 and all software packages have been updated to the latest version.
  4. I have sync the clock on my PC and Rasp Pi and icreate 3 using NTP. (But I still see user.notice ntpd: ntpd: reply from [192.168.186.3](http://192.168.186.3/): delay 0.004474 is too high, ignoring in the create 3 log. Not sure how to fix it...)
  5. I tried both CLI and rclpy action client. The delays are similar, both 20~30 seconds.
  6. I log the time at which the goal request is sent and the create3 receives the goal message. The delay between these two is around 20~30 seconds. After the goal message is received, the robot starts actuating quickly.
  7. I tried the other action servers available on create 3 and all of them suffer from this delay issue.
  8. I wrote an action server myself and ran it on a Rasp Pi in the same network and interacted with it using the same way. The delay is negligible.
  9. I monitor the WiFi traffic and notice that create 3 has a lot of uplink data (0.6Mbps) and fewer downlink data (3 kbps) from the create3 robot. This throughput should not saturate the channel and cause the delay issue.

I have searched on the internet but could not find a similar issue. Any help would be appreciated

Thank you so much for your help!

slowrunner commented 8 months ago

@LuHaofan, Disclaimer: I am just a Create3 owner. What follows is my personal opinion.

Haofan, you have "discovered" a secret: There are many things the Create3 performs at 62 to 100 times per second, and a few things on the order of seconds per request, efficiently interleaved by a processor slightly more powerful than what might be considered a micro-controller operating at 70 to 80% and sometimes even 100% CPU at 70% of 59MB available memory.

The driving action servers are useful for initial learning in ROS 2, but have some disadvantages for complex robot environments, such as:

The "slow initiation" of the Create3 native action servers is likely not something that will (or can) be addressed by the iRobot team. If the action servers are useful, great, if not the distributed nature of ROS allows fast, external action servers tailored to users' needs.