RethinkRobotics-opensource / rosnodejs

Client library for writing ROS nodes in JavaScript with nodejs

Home Page:http://wiki.ros.org/rosnodejs/overview

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect timeout handling in _waitForActionServerToStart of ActionClientInterface

tziem opened this issue · comments

commented

I think the timeout handling in _waitForActionServerToStart of ActionClientInterface is incorrect.
No matter how big the timeout value is, the method comes back immediately with false.

 _waitForActionServerToStart(timeoutMs, start) {
    return setTimeoutP(100)
    .then(() => {
      if (this.isServerConnected()) {
        return true;
      }
      else if (timeoutMs > 0 && start + timeoutMs > Date.now()) {
        return false;
      }
      else {
        return this._waitForActionServerToStart(timeoutMs, start);
      }
    });
  }

If I'm not wrong, the if statement should be:

if (timeoutMs > 0 && start + timeoutMs < Date.now())