iRobotEducation / create3_examples

Example nodes to drive the iRobot® Create® 3 Educational Robot
BSD 3-Clause "New" or "Revised" License
51 stars 12 forks source link

Coverage Server Does Not Notify Action Client No Create3 Found or max_duration exceeded #8

Closed slowrunner closed 2 years ago

slowrunner commented 2 years ago

I have successfully built the coverage server and dance examples, and see the coverage server accept an explore goal, and start executing the goal.

I do not have the create3_sim built/running yet, so I would have expected the action server to either reject the goal, or fail the goal during execution, and further I would have expected the server to fail the goal after execution reached the max_duration specified.

For the command:

$ ros2 action send_goal /coverage create3_examples_msgs/action/Coverage "{explore_duration:{sec: 60, nanosec: 0}, max_duration:{sec: 120,nanosec: 0}}"
1635117690.493283 [0]       ros2: using network interface wlan0 (udp/10.0.0.29) selected arbitrarily from: wlan0, wlan1
Waiting for an action server to become available...
Sending goal:
     explore_duration:
  sec: 60
  nanosec: 0
max_duration:
  sec: 120
  nanosec: 0

Goal accepted with ID: 2c92ceee7e39452998119399ce611d06

the server reports:

~/create3ros/create3_examples_ws$ ros2 run create3_coverage create3_coverage
1635117665.400946 [0] create3_co: using network interface wlan0 (udp/10.0.0.29) selected arbitrarily from: wlan0, wlan1
[INFO] [1635117665.480589509] [create3_coverage]: Node created!
[INFO] [1635117690.802468310] [create3_coverage]: Accepting goal request
[INFO] [1635117690.805057962] [create3_coverage]: Executing goal

and appears to ignore the max_duration.

alsora commented 2 years ago

The examples require that a create 3 robot is present (either a real or a simulated one).

The max duration timeout is ignored because the action is not actually being started. Although the "Executing goal" message is printed, the example will then wait to know if the robot is on its dock or not before starting to drive it, and the timer starts only after that.

Currently we wait forever because the assumption is that you have the robot and it will eventually be discovered.

We can improve this by checking that all individual topics / services used by the test are present before starting.

Thank you for the report. I will open a PR to fix it