Skip to content

Commit

Permalink
defined function to draw course points
Browse files Browse the repository at this point in the history
  • Loading branch information
ShisatoYano committed Dec 10, 2024
1 parent 6ccde1c commit 45c886c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/components/course/cubic_spline_course/cubic_spline_course.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ def __init__(self, x_ref_points, y_ref_points, target_speed_kmph, resolution=0.1
self.speed_array[-1] = 0.0

self.color = color


csc = CubicSplineCourse([0.0, 10.0, 25, 40, 50], [0.0, 4, -12, 20, -13], 10)

def draw(self, axes, elems):
"""
Function to draw points on course
axes: Axes object of figure
elems: List of plot objects
"""

course_plot, = axes.plot(self.x_array, self.y_array, linewidth=0, marker='.', color=self.color, label="Course")
elems.append(course_plot)

0 comments on commit 45c886c

Please sign in to comment.