from PYRobot.libs.client import Client from PYRobot.libs.client_camera import ClientCamera import time robot=Client("mybot") robot.show_info() #robot.TOPICS_list("MYgps/X","MYgps/Y","BaseM/mi","BaseM/md","temperatura1/temp") robot.TOPICS(X="MYgps/X",Y="MYgps/Y") robot.TOPICS(mi="BaseM/mi",md="BaseM/md") robot.TOPICS(temp="temperatura1/temp") robot.EVENTS(BM="BaseM/basemotion") robot.EVENTS(GPS="MYgps/gps") robot.SERVICES(base="BaseM/basemotion_interface") robot.SERVICES(cam="camara_frontal/camera") cam=ClientCamera(robot.cam) #Do Here your code for this robot robot.base.set_base(100,100) for x in range(2000): time.sleep(0.1) print(robot.mi,robot.md) print(robot.BM) if "Max" in robot.BM: robot.base.set_base(robot.mi-20,robot.md-20) if "Right" in robot.BM:
from PYRobot.libs.client import Client from PYRobot.libs.client_camera import ClientCamera import time robot = Client("pirobot02") robot.show_info() robot.SERVICES(cam="camara/camera") robot.TOPICS_list("tracker/line") #robot.EVENTS("base_motion") robot.connect() cam = ClientCamera(robot.cam) while True: print(robot.line) time.sleep(0.02) robot.close()
from PYRobot.libs.client import Client from PYRobot.libs.client_camera import ClientCamera import time robot = Client("mybot") robot.show_info() robot.SERVICES(cam="camara_frontal/usbcam_interface") cam = ClientCamera(robot.cam) for x in range(1000): time.sleep(0.05) #print(type(cam.buffer))
from PYRobot.libs.client import Client from PYRobot.libs.client_camera import ClientCamera import time robot = Client("pacobot") robot.show_info() robot.SERVICES(cam="camara/picam_interface") #robot.TOPICS("base","laser","ir","pt") #robot.EVENTS("base_motion") robot.connect() cam = ClientCamera(robot.cam) while True: time.sleep(0.5) robot.close()
from PYRobot.libs.client import Client import time robot = Client("learnbot") robot.show_info() robot.SERVICES("base_motion", "gps_drive", "pantilt_motion") robot.TOPICS("base", "laser") robot.EVENTS("base_motion") def on_base_left(): global robot print("izq") b = robot.base robot.base_motion.set_base(b[0] + 10, b[1] - 10) def on_base_right(): global robot print("der") b = robot.base robot.base_motion.set_base(b[0] - 5, b[1] + 5) def on_base_max(): global robot print("max") robot.add_HANDLER("base_motion::Right", on_base_right) robot.add_HANDLER("base_motion::Left", on_base_left)