fix: drop the start-footprint check from the back-off pivot
The back-off pivot rejected a robot standing 0.375 m from a charger goal with about
10 deg of yaw ("current footprint does not clear the dock along the approach axis").
With dock_anchor=face the dock is modelled at the goal, which is the docked base pose,
while the real charger face lies 0.40 m behind it. So a rear corner that projected
behind the goal line was read as inside the dock, although it had 0.45 m of clearance.
The robot physically stands at its start pose, and the back-off only moves it away from
the dock, so the check guards nothing. Rotation sweeps and approach legs are still
checked against the costmap when pivot_check_costmap is on. Test: the 29/10 15:36 robot
start now yields backoff_pivot_straight; with the key at 0 it still fails as before.
This commit is contained in:
@@ -980,19 +980,13 @@ bool DockCalc::makePlanMoveToDock(
|
|||||||
const double backoff_length =
|
const double backoff_length =
|
||||||
(backoff_target_longitudinal - start_longitudinal) /
|
(backoff_target_longitudinal - start_longitudinal) /
|
||||||
std::fabs(longitudinal_gain);
|
std::fabs(longitudinal_gain);
|
||||||
double closest_footprint_projection =
|
|
||||||
std::numeric_limits<double>::max();
|
|
||||||
const double relative_yaw = normalizeAngle(start_yaw - approach_yaw);
|
|
||||||
const double cos_relative_yaw = std::cos(relative_yaw);
|
|
||||||
const double sin_relative_yaw = std::sin(relative_yaw);
|
|
||||||
for (const auto& point : footprint_robot)
|
|
||||||
{
|
|
||||||
const double projection = point.x * cos_relative_yaw -
|
|
||||||
point.y * sin_relative_yaw;
|
|
||||||
closest_footprint_projection = std::min(
|
|
||||||
closest_footprint_projection, projection);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// No check of the start footprint against the dock: the robot
|
||||||
|
// physically stands there, and the back-off only moves it away.
|
||||||
|
// With dock_anchor=face the dock is modelled at the goal, which
|
||||||
|
// is the docked base pose, not the real face (the charger apex
|
||||||
|
// sits 0.40 m behind it). That check rejected a robot whose rear
|
||||||
|
// was 0.45 m clear of the charger.
|
||||||
if (!std::isfinite(backoff_length) ||
|
if (!std::isfinite(backoff_length) ||
|
||||||
backoff_length > config_.pivot_backoff_max_distance + kEpsilon)
|
backoff_length > config_.pivot_backoff_max_distance + kEpsilon)
|
||||||
{
|
{
|
||||||
@@ -1001,12 +995,6 @@ bool DockCalc::makePlanMoveToDock(
|
|||||||
" m exceeds pivot_backoff_max_distance " +
|
" m exceeds pivot_backoff_max_distance " +
|
||||||
std::to_string(config_.pivot_backoff_max_distance) + " m";
|
std::to_string(config_.pivot_backoff_max_distance) + " m";
|
||||||
}
|
}
|
||||||
else if (start_longitudinal + closest_footprint_projection <
|
|
||||||
dock_extent + config_.reverse_distance_padding - kEpsilon)
|
|
||||||
{
|
|
||||||
backoff_reason =
|
|
||||||
"current footprint does not clear the dock along the approach axis";
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const int sample_count = std::max(
|
const int sample_count = std::max(
|
||||||
|
|||||||
@@ -560,6 +560,10 @@ void testBackoffPivotRobotFailures()
|
|||||||
const std::vector<robot_geometry_msgs::PoseStamped> starts = {
|
const std::vector<robot_geometry_msgs::PoseStamped> starts = {
|
||||||
pose(0.579, 0.292, 0.0),
|
pose(0.579, 0.292, 0.0),
|
||||||
pose(0.427, 0.155, 0.0),
|
pose(0.427, 0.155, 0.0),
|
||||||
|
// 29/10 15:36: 0.375 m out and yawed about 10 deg, so a rear corner
|
||||||
|
// projects behind the goal line. A removed start-footprint check
|
||||||
|
// rejected this although the real charger face was 0.45 m away.
|
||||||
|
pose(0.375, -0.149, 0.17),
|
||||||
};
|
};
|
||||||
|
|
||||||
for (const auto& start : starts)
|
for (const auto& start : starts)
|
||||||
|
|||||||
Reference in New Issue
Block a user