diff --git a/robomaster_pi/conn_vel.py b/robomaster_pi/conn_vel.py index 7229288319ca75f33e298ea23feaca500c16fc18..471885025514ab4ce9046aee7103adf96f154d27 100644 --- a/robomaster_pi/conn_vel.py +++ b/robomaster_pi/conn_vel.py @@ -23,10 +23,8 @@ import ping3 class vel_from_ros_node(Node): def __init__(self, my_ep_chassis): - threading.Timer(1, self.check_connection) super().__init__("vel_from_ros") - self.hostname = "192.168.1.77" self.response = False self.timer = threading.Timer(1, self.check_connection) self.timer.start() @@ -35,14 +33,13 @@ class vel_from_ros_node(Node): def check_connection(self): - print("ja") - self.response = self.isConnected() + self.response = self.check_ip_reachability() if(self.response != True): self.my_ep_chassis.drive_speed(x = 0, y = 0, z = 0.5) def check_ip_reachability(self): - response = ping3.ping("192.168.1.5") + response = ping3.ping("192.168.1.77") if response is not None: return True else: