return atan2(this->lfy() - this->lry(), this->lfx() - this->lrx());
}
+Point
+ParkingSlot::lf() const
+{
+ return Point(this->lfx(), this->lfy());
+}
+
+Point
+ParkingSlot::lr() const
+{
+ return Point(this->lrx(), this->lry());
+}
+
+Point
+ParkingSlot::rr() const
+{
+ return Point(this->rrx(), this->rry());
+}
+
+Point
+ParkingSlot::rf() const
+{
+ return Point(this->rfx(), this->rfy());
+}
+
+Line
+ParkingSlot::entry() const
+{
+ return this->entry_;
+}
+
+Line
+ParkingSlot::rear() const
+{
+ return this->rear_;
+}
+
+Line
+ParkingSlot::curb() const
+{
+ return this->curb_;
+}
+
+Line
+ParkingSlot::front() const
+{
+ return this->front_;
+}
+
void
ParkingSlot::set_parking_speed(double s)
{
ParkingSlot::fe(BicycleCar c)
{
assert(this->parallel());
- assert(this->right());
+ bool swapped = false;
+ if (!this->right()) {
+ this->swap_side();
+ swapped = true;
+ }
c.h(this->h());
double clen = -this->offset_ + this->len() - c.df();
double cw = c.w() / 2.0;
}
auto& c1 = entries.front().front();
auto& c2 = entries.back().front();
- return PoseRange(c1, c2);
+ PoseRange p(c1, c2);
+ if (swapped) {
+ this->swap_side();
+ p.reflect(this->entry_);
+ }
+ return p;
}
PoseRange