forked from Telos4/RoboRally
second robot controlled by mpc controller
This commit is contained in:
parent
2f081faee8
commit
c2307261c5
|
@ -3,19 +3,22 @@ import time
|
||||||
|
|
||||||
from robot import ControlledRobot
|
from robot import ControlledRobot
|
||||||
from pid_controller import PIDController
|
from pid_controller import PIDController
|
||||||
|
from mpc_controller import MPCController
|
||||||
from event_listener import EventListener
|
from event_listener import EventListener
|
||||||
|
|
||||||
|
|
||||||
class CommanderBase:
|
class CommanderBase:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.robots = []
|
self.robots = []
|
||||||
self.robots = [ControlledRobot(12, '10.10.11.91')] # , Robot(13, '192.168.1.13'), Robot(14, '192.168.1.14')]
|
self.robots = [ControlledRobot(12, '10.10.11.91'), ControlledRobot(13, '10.10.11.90')] #, Robot(14, '192.168.1.14')]
|
||||||
# self.robots = [ControlledRobot(marker_id=13, ip='10.10.11.90'),
|
# self.robots = [ControlledRobot(marker_id=13, ip='10.10.11.90'),
|
||||||
# ControlledRobot(marker_id=14, ip='10.10.11.89')]
|
# ControlledRobot(marker_id=14, ip='10.10.11.89')]
|
||||||
|
|
||||||
for r in self.robots:
|
for r in self.robots:
|
||||||
r.connect()
|
r.connect()
|
||||||
r.attach_controller(PIDController())
|
|
||||||
|
self.robots[0].attach_controller(PIDController())
|
||||||
|
self.robots[1].attach_controller(MPCController())
|
||||||
|
|
||||||
self.event_listener = EventListener(event_server=('127.0.0.1', 42424))
|
self.event_listener = EventListener(event_server=('127.0.0.1', 42424))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user