Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Caster calibration controller can calibrate wrong way with user input (ros ticket #3841) #288

Open
ahendrix opened this issue Mar 12, 2013 · 4 comments

Comments

@ahendrix
Copy link
Member

I tried to "help" the casters on PRM calibrate with the motors halted. I spun one the wrong way and it calibrated backwards. Since we're now using upper and lower limits in the calibration flag position, we should not trip the calibration controller until we cross the correct flag.

pr2_calibration_controllers/src/caster_calibration_controller.cpp
{{{
bool switch_state_ = actuator_->state_.calibration_reading_ & 1;
if (switch_state_ != original_switch_state_)
{
}}}

This should check whether we trip the rising or falling edge, and only trigger in that case.

trac data:

@ahendrix
Copy link
Member Author

[watts] This has happened on a texas robot. We've confirmed this on ta113.

We checked the launch files, and verified that our input was correct.

The caster calibration controller needs to be fixed.

@ahendrix
Copy link
Member Author

[wim] To know which of the two flags you hit, you need to know 2 things:

  • did you see a rising or falling edge
  • did you move in the positive or negative direction when the flag was triggered

The problem described in this ticket seems caused by assuming the caster moves in one direction, but a user is pushing it in the other direction.

@ahendrix
Copy link
Member Author

[wim] Fixed in trunk.

wim@prl1:~/boxturtle_wg_all/stacks/pr2_controllers/pr2_calibration_controllers$ svn ci -m "check if calibration happens on correct flag. ticket 3841. check applies to joint and caster calibration controllers"
Sending include/pr2_calibration_controllers/caster_calibration_controller.h
Sending include/pr2_calibration_controllers/joint_calibration_controller.h
Sending src/caster_calibration_controller.cpp
Sending src/joint_calibration_controller.cpp
Transmitting file data ....
Committed revision r36024.

@ahendrix
Copy link
Member Author

[dking] This change adds a ros::Duration(1.0).sleep() which kills the realtime loop every time this scenario is hit. The proper way to add a delay to the update function would be to add another state to state machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant