Add copy methods, fix state imports, pass lock
Add copy() to PosArray, DegArray and RadArray to allow easy shallow copies. Change RobotState imports in idle.py and walking.py to use explicit 'from RobotState.RobotState import RobotState' to avoid import issues. In main.py create a threading.Lock and pass it into the controller thread args to prepare for synchronized access in controller_loop.
This commit is contained in:
@@ -15,6 +15,7 @@ import DataTypes as dt
|
||||
|
||||
def main():
|
||||
intent = ControlIntent()
|
||||
lock = threading.Lock()
|
||||
ctx = RobotContext()
|
||||
|
||||
ctx.center_points = dt.PosArray([
|
||||
@@ -29,7 +30,7 @@ def main():
|
||||
|
||||
controller_thread = threading.Thread(
|
||||
target=controller_loop,
|
||||
args=(intent,),
|
||||
args=(intent, lock),
|
||||
daemon=True
|
||||
)
|
||||
controller_thread.start()
|
||||
|
||||
Reference in New Issue
Block a user