for (auto s: starts) {
auto r = this->drive_in_slot(s);
if (r.size() > 0) {
- this->_entries.push_back(r);
+ this->_ispaths.push_back(r);
}
}
- if (this->_entries.size() == 0) {
+ if (this->_ispaths.size() == 0) {
return PoseRange(Pose(0.0, 0.0, 0.0), Pose(0.0, 0.0, 0.0));
}
- if (this->_entries.size() == 1) {
- auto f = this->_entries.front().front();
+ if (this->_ispaths.size() == 1) {
+ auto f = this->_ispaths.front().front();
return PoseRange(f, f);
}
- auto& c1 = this->_entries.front().front();
- auto& c2 = this->_entries.back().front();
+ auto& c1 = this->_ispaths.front().front();
+ auto& c2 = this->_ispaths.back().front();
PoseRange p(c1, c2);
if (swapped) {
this->swap_side();
return p;
}
+void
+ParkingSlot::compute_entries()
+{
+ assert(this->_ispaths.size() > 0);
+ assert(this->right());
+ this->_entries.clear();
+ for (auto p: this->_ispaths) {
+ this->_entries.push_back(p.front());
+ }
+ for (auto& e: this->_entries) {
+ e.sp(e.sp() * -1.0);
+ while (!this->lf().inside_of(e.ccr(), e.iradi())) {
+ e.next();
+ }
+ }
+}
+
PoseRange
ParkingSlot::recompute_entry(PoseRange p)
{