Skip to content

Commit b1dfa14

Browse files
committed
Changes
1 parent 258aa03 commit b1dfa14

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

pslab/external/motor.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,20 @@ def __init__(self, servos: List[Servo]) -> None:
8787
self.servos = servos
8888

8989
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+
91104
tl_len = len(timeline[0])
92105
if not all(len(tl) == tl_len for tl in timeline):
93106
raise ValueError("All timeline entries must have the same length")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy