Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Avoid nan command to be processed #283

Closed

Conversation

vincentrou
Copy link

No description provided.

@bmagyar
Copy link
Member

bmagyar commented Jun 28, 2017

Ouch, great find!
Could you please also add a test that fails if this feature is not implemented?

@vincentrou
Copy link
Author

When I send a twist with a NaN in the linear.x, the robot goes backward full speed in gazebo and in real.
But I do not reproduce it with the test class... (published odom always at zero)

@bmagyar
Copy link
Member

bmagyar commented Sep 26, 2017

This will need a rebase and that test. Sorry but I'd really prefer not to add any fixes that are not backed up by a test.

@bmagyar
Copy link
Member

bmagyar commented Nov 30, 2017

I tried to run the test without the fix and I can confirm that this test doesn't really catch the issue.

Could you please try setting the param publish_cmd and see what gets through there?

For more: https://github.com/ros-controls/ros_controllers/blob/kinetic-devel/diff_drive_controller/src/diff_drive_controller.cpp#L292

@bmagyar
Copy link
Member

bmagyar commented Nov 30, 2017

Also we've got a conflict. Could you rebase the PR on the latest kinetic-devel please?

@bmagyar
Copy link
Member

bmagyar commented Jan 11, 2018

Ping @vincentrou

@vincentrou
Copy link
Author

I rebase the PR on kinect in december but I will not have time to do more on this.

@bmagyar bmagyar mentioned this pull request Feb 12, 2020
@martiniil
Copy link
Contributor

martiniil commented Feb 14, 2020

I picked these commits for melodic. However I see a problem: The robot gets stuck during execution of the previous test case testNaN here

  // stop robot (will generate NaN)
  stop();

Due to

        const double lp = left_wheel_joints_[i].getPosition();
        const double rp = right_wheel_joints_[i].getPosition();
        if (std::isnan(lp) || std::isnan(rp))
          return;

the commands are no longer updated even after start(). I am not sure what the intended behaviour (of the controller) is here.

@martiniil
Copy link
Contributor

I tried to run the test without the fix and I can confirm that this test doesn't really catch the issue.

Could you please try setting the param publish_cmd and see what gets through there?

For more: https://github.com/ros-controls/ros_controllers/blob/kinetic-devel/diff_drive_controller/src/diff_drive_controller.cpp#L292

The test passes since the command is never updated during this test case. See my comment above.

@bmagyar bmagyar mentioned this pull request Mar 9, 2020
@bmagyar
Copy link
Member

bmagyar commented Mar 15, 2020

Closing this in favour of #469

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants