Exemple #1
0
    def _set_env(self):
        # gym.make doesnt allow to pass arguments, this is kind of workaround for that
        if self._urdf_root is None:
            # look at the default location
            rospack = rospkg.RosPack()
            desp_dir = rospack.get_path("locobot_description")
            self._urdf_root = os.path.join(desp_dir,
                                           "urdf/locobot_description.urdf")
        if self._renders:
            self._p = bullet_client.BulletClient(connection_mode=pybullet.GUI)
        else:
            self._p = bullet_client.BulletClient()

        self._p.setAdditionalSearchPath(pybullet_data.getDataPath())
        self._p.setGravity(0, 0, -10)
        self._plane_id = self._p.loadURDF("plane.urdf")

        if self._collision_check:
            self._sim_robot = self._p.loadURDF(
                self._urdf_root,
                useFixedBase=1,
                flags=self._p.URDF_USE_SELF_COLLISION)
        else:
            self._sim_robot = self._p.loadURDF(self._urdf_root, useFixedBase=1)

        if self._use_real_robot:
            self._real_robot = pyrobot.Robot("locobot")
            time.sleep(self._sleep_after_exc)
Exemple #2
0
    def __init__(self, config: Config) -> None:
        self._config = config

        robot_sensors = []
        for sensor_name in self._config.SENSORS:
            sensor_cfg = getattr(self._config, sensor_name)
            sensor_type = registry.get_sensor(sensor_cfg.TYPE)

            assert sensor_type is not None, "invalid sensor type {}".format(
                sensor_cfg.TYPE)
            robot_sensors.append(sensor_type(sensor_cfg))
        self._sensor_suite = SensorSuite(robot_sensors)

        config_pyrobot = {
            "base_controller": self._config.BASE_CONTROLLER,
            "base_planner": self._config.BASE_PLANNER,
        }

        assert (self._config.ROBOT
                in self._config.ROBOTS), "Invalid robot type {}".format(
                    self._config.ROBOT)
        self._robot_config = getattr(self._config, self._config.ROBOT.upper())

        action_spaces_dict = {}

        self._action_space = self._robot_action_space(self._config.ROBOT,
                                                      self._robot_config)

        self._robot = pyrobot.Robot(self._config.ROBOT,
                                    base_config=config_pyrobot)
    def __init__(self):
        self.root = Tkinter.Tk()
        self.root.title("Cursor Monitor")

        self.underCurVal = Tkinter.StringVar()
        self.underCurCtrl = Tkinter.Entry(self.root, width=25, textvariable=self.underCurVal)
        self.underCurCtrl.pack()
        
        
        self.robot = pyrobot.Robot()
        self.last_data = None

        self.update()
        self.underCurCtrl.focus()
        self.root.mainloop()
def file_upload(driver, locator, path, filenames):
    ele = driver.find_element_by_id(locator)
    ele.click()
    r = pyrobot.Robot()
    if driver.name == 'internet explorer':
        r.wait_for_window("Choose File to Upload", 5)
    elif driver.name == 'firefox':
        r.wait_for_window("File Upload", 5)
    elif driver.name == 'chrome':
        r.wait_for_window("Open", 5)
    time.sleep(5)
    r.type_string(path)
    r.key_press(pyrobot.Keys.enter)
    time.sleep(2)
    r.key_release(pyrobot.Keys.enter)
    time.sleep(5)
    r.type_string(filenames)
    r.key_press(pyrobot.Keys.enter)
    r.key_release(pyrobot.Keys.enter)
    del r
Exemple #5
0
from selenium import webdriver
from selenium.webdriver.support.ui import Select
import pyrobot
import pyautogui
import time

# getting to the form
robot = pyrobot.Robot()
browser = webdriver.Firefox()
browser.maximize_window()
browser.get(
    "https://www.playstation.com/en-in/support/contact-us/contact-form/")
time.sleep(5)
select1 = Select(browser.find_element_by_id("contact_us_type_select"))
time.sleep(0.5)
select1.select_by_visible_text("PlayStation Store refunds and cancellations")
time.sleep(2)

# accepting cookies
browser.find_element_by_id("_evidon-accept-button").click()
browser.find_element_by_id("js-SIEWS1lib-header-CloseIcon").click()
time.sleep(2)
# form filling area
name_area = browser.find_element_by_id("field_4")
name_area.send_keys("Abhiraj Singh")
online_id_area = browser.find_element_by_id("field_5")
online_id_area.send_keys("blundr_strike")
contact_email_address = browser.find_element_by_id("field_6")
contact_email_address.send_keys("*****@*****.**")
sign_in_email = browser.find_element_by_id("field_7")
sign_in_email.send_keys("*****@*****.**")