Пример #1
0
def real_thing():
    robot = rosebot.RoseBot()
    delegate = shared_gui_delegate_on_robot.Handler(robot)
    mqtt_reciever = com.MqttClient(delegate)
    mqtt_reciever.connect_to_pc()

    while True:
        time.sleep(0.01)
Пример #2
0
def real_thing():
    delegate = shared_gui_delegate_on_robot.Handler(robot)
    mqtt_reveiver = com.MqttClient(delegate)
    mqtt_reveiver.connect_to_pc()

    while True:
        time.sleep(.01)
        if delegate.is_time_to_stop:
            break
def actual_code():
    robot = rosebot.RoseBot()
    delegate = shared_gui_delegate_on_robot.Handler(robot)
    mqtt_reciever = com.MqttClient(delegate)
    delegate.m1_robot_mqtt = mqtt_reciever
    mqtt_reciever.connect_to_pc()
    while True:
        time.sleep(0.01)
        if delegate.is_time_to_stop:
            break
def real_thing():
    robot = rosebot.RoseBot()
    delegate = shared_gui_delegate_on_robot.Handler(robot)
    mqtt_receiver = com.MqttClient(delegate)
    delegate.mqtt_sender = mqtt_receiver
    mqtt_receiver.connect_to_pc()

    while True:
        time.sleep(0.01)
        if delegate.is_time_to_stop:
            break
def real_thing():
    robot = rosebot.RoseBot()
    r = None
    delegate = shared_gui_delegate_on_robot.Handler(robot, r)
    r = com.MqttClient(delegate)
    delegate.r = r
    r.connect_to_pc()

    while True:
        time.sleep(.01)
        if delegate.is_time_to_stop:
            break
Пример #6
0
def real_thing():
    robot = rosebot.RoseBot()
    delegate = shared_gui_delegate_on_robot.Handler(robot)

    mqtt_receiver = com.MqttClient(delegate)
    robot.drive_system.mqtt_sender = mqtt_receiver
    mqtt_receiver.connect_to_pc()
    while True:
        time.sleep(0.01)
        if delegate.need_to_stop:
            print('quit')
            break
def main():
    """
    This code, which must run on the EV3 ROBOT:
      1. Makes the EV3 robot to various things.
      2. Communicates via MQTT with the GUI code that runs on the LAPTOP.
    """
    robot = rosebot.RoseBot()
    delegate = shared_gui_delegate_on_robot.Handler(robot)
    mqtt_receiver = com.MqttClient(delegate)
    robot.drive_system.mqtt_sender = mqtt_receiver
    mqtt_receiver.connect_to_pc()
    while True:
        time.sleep(0.1)
        if delegate.need_to_stop:
            print('quit')
            break
Пример #8
0
def main():
    """
    This code, which must run on the EV3 ROBOT:
      1. Makes the EV3 robot to various things.
      2. Communicates via MQTT with the GUI code that runs on the LAPTOP.
    """

    robot = rosebot.RoseBot()
    delegate = shared_gui_delegate_on_robot.Handler(robot)
    mqtt_receiver = com.MqttClient(delegate)
    mqtt_receiver.connect_to_pc()

    while True:
        time.sleep(0.04)
        if delegate.is_time_to_stop:
            break
        robot.sensor_system.camera.set_signature('SIG4')
        #print(robot.sensor_system.camera.get_biggest_blob())
        mqtt_receiver.send_message("display_camera", [
            robot.sensor_system.camera.get_biggest_blob().center.x,
            robot.sensor_system.camera.get_biggest_blob().center.y,
            robot.sensor_system.camera.get_biggest_blob().height,
            robot.sensor_system.camera.get_biggest_blob().width
        ])