Plot car on top of lidar scan

master
matssteinweg 2019-12-04 23:29:53 +01:00
parent 26c367d880
commit c16b14f3cf
1 changed files with 2 additions and 2 deletions

View File

@ -294,7 +294,7 @@ class SpatialBicycleModel(ABC):
yaw = np.rad2deg(self.temporal_state.psi) yaw = np.rad2deg(self.temporal_state.psi)
# Draw rectangle # Draw rectangle
car = plt_patches.Rectangle(cog, width=self.l, height=self.w, car = plt_patches.Rectangle(cog, width=self.l, height=self.w,
angle=yaw, facecolor=CAR, edgecolor=CAR_OUTLINE) angle=yaw, facecolor=CAR, edgecolor=CAR_OUTLINE, zorder=20)
# Shift center rectangle to match center of the car # Shift center rectangle to match center of the car
car.set_x(car.get_x() - (self.l/2 * np.cos(self.temporal_state.psi) - car.set_x(car.get_x() - (self.l/2 * np.cos(self.temporal_state.psi) -
@ -306,7 +306,7 @@ class SpatialBicycleModel(ABC):
safety_margin = plt_patches.Ellipse(cog, width=2*self.safety_margin[0], safety_margin = plt_patches.Ellipse(cog, width=2*self.safety_margin[0],
height=2*self.safety_margin[1], height=2*self.safety_margin[1],
angle=yaw, angle=yaw,
fill=False, edgecolor=CAR) fill=False, edgecolor=CAR, zorder=20)
# Add rectangle to current axis # Add rectangle to current axis
ax = plt.gca() ax = plt.gca()