Skip to content

Commit

Permalink
calibration: turn countdown_ into parameter
Browse files Browse the repository at this point in the history
For smooth slow motions through the zero crossing it can
be helpful to increase the distance before passing through it from low to high.

As a longer default time changes the well-established startup initialization
to the worse (more collisions) it's better to turn it into a parameter without
changing the default.
  • Loading branch information
v4hn authored and pr2 committed Aug 10, 2022
1 parent e3e7cf8 commit 8cf343c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class JointCalibrationController : public pr2_controller_interface::Controller
int state_;
bool announced_calibration_success_;
int countdown_;
int tics_moving_past_calibration_reading_;

double search_velocity_;
double original_position_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ bool JointCalibrationController::init(pr2_mechanism_model::RobotState *robot, ro
return false;
}

tics_moving_past_calibration_reading_ = 200;
node_.getParam("tics_moving_past_calibration_reading", tics_moving_past_calibration_reading_);

bool force_calibration = false;
node_.getParam("force_calibration", force_calibration);

Expand Down Expand Up @@ -227,7 +230,7 @@ void JointCalibrationController::update()
}
}
else
countdown_ = 200;
countdown_ = tics_moving_past_calibration_reading_;
break;
case MOVING_TO_HIGH: {
vc_.setCommand(search_velocity_);
Expand Down

0 comments on commit 8cf343c

Please sign in to comment.