File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,20 @@ def __init__(self, servos: List[Servo]) -> None:
87
87
self .servos = servos
88
88
89
89
def run_schedule (self , timeline : List [List [int ]], time_step : float = 1.0 ) -> None :
90
- """Move servos based on a time-based angle schedule."""
90
+ """Run a time-based schedule to move servos.
91
+
92
+ Parameters
93
+ ----------
94
+ timeline : List[List[int]]
95
+ A list of timesteps,where each sublist represents one timestep,
96
+ with angles corresponding to each servo.
97
+
98
+ time_step : float, optional
99
+ Delay in seconds between each timestep. Default is 1.0.
100
+ """
101
+ if len (timeline [0 ]) != len (self .servos ):
102
+ raise ValueError ("Each timestep must specify an angle for every servo" )
103
+
91
104
tl_len = len (timeline [0 ])
92
105
if not all (len (tl ) == tl_len for tl in timeline ):
93
106
raise ValueError ("All timeline entries must have the same length" )
You can’t perform that action at this time.
0 commit comments