Skip to content

Commit 8cf343c

Browse files
v4hnpr2
authored andcommitted
calibration: turn countdown_ into parameter
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.
1 parent e3e7cf8 commit 8cf343c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pr2_calibration_controllers/include/pr2_calibration_controllers/joint_calibration_controller.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class JointCalibrationController : public pr2_controller_interface::Controller
7474
int state_;
7575
bool announced_calibration_success_;
7676
int countdown_;
77+
int tics_moving_past_calibration_reading_;
7778

7879
double search_velocity_;
7980
double original_position_;

pr2_calibration_controllers/src/joint_calibration_controller.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ bool JointCalibrationController::init(pr2_mechanism_model::RobotState *robot, ro
9090
return false;
9191
}
9292

93+
tics_moving_past_calibration_reading_ = 200;
94+
node_.getParam("tics_moving_past_calibration_reading", tics_moving_past_calibration_reading_);
95+
9396
bool force_calibration = false;
9497
node_.getParam("force_calibration", force_calibration);
9598

@@ -227,7 +230,7 @@ void JointCalibrationController::update()
227230
}
228231
}
229232
else
230-
countdown_ = 200;
233+
countdown_ = tics_moving_past_calibration_reading_;
231234
break;
232235
case MOVING_TO_HIGH: {
233236
vc_.setCommand(search_velocity_);

0 commit comments

Comments
 (0)