def __init__(self): RLLDefaultMoveClient.__init__(self) self.is_input_loop_running = True self.mode = self.MODE_CMD self.motion_mode = self.MOVE_PTP self.move_increment = .05 self.rot_increment = pi / 20 self.commands = { "w": lambda: self.relative_motion(x=self.move_increment), "s": lambda: self.relative_motion(x=-self.move_increment), "a": lambda: self.relative_motion(y=self.move_increment), "d": lambda: self.relative_motion(y=-self.move_increment), "q": lambda: self.relative_motion(z=-self.move_increment), "e": lambda: self.relative_motion(z=self.move_increment), "c": lambda: self.get_current_cached_pose(via_cmd=True), "i": lambda: self.relative_motion(ro=self.rot_increment), "k": lambda: self.relative_motion(ro=-self.rot_increment), "j": lambda: self.relative_motion(pi=self.rot_increment), "l": lambda: self.relative_motion(pi=-self.rot_increment), "u": lambda: self.relative_motion(yw=self.rot_increment), "o": lambda: self.relative_motion(yw=-self.rot_increment), "h": self.home, "1": lambda: self.do_pick_place(gripper_open=True), "2": lambda: self.do_pick_place(gripper_open=False), "+": lambda: self.change_increment(.01), "-": lambda: self.change_increment(-.01), "m": self.toggle_relative_mode, "x": self.quit } self._current_pose = None
def main(): from rll_tools.run import run_project_in_background rospy.init_node("pick_place_demo") client = RLLDefaultMoveClient() run_project_in_background(1) client.spin(oneshot=True)
def main(): tests = [ TestData('move_basic', TestBasicMovements), TestData('move_repetition', TestRepeatedMovements), TestData('move_invalid', TestInvalidMovements) ] tests_before = TestData('move_before', TestBeforeProjectRun) execute_before = generate_test_callback("rll_move_before", tests_before, shutdown_func=None) execute = generate_test_callback("rll_move", tests, shutdown_func=shutdown) # wait for the move_iface to start and previous clients to exit time.sleep(8) # setup a regular move client and run the tests in the execute callback rospy.init_node("test_move_iface_client") client = RLLDefaultMoveClient(execute) execute_before(client) run_project_in_background(2) client.spin()
def main(): rospy.init_node('move_client_example') move_client = RLLDefaultMoveClient(execute) move_client.spin(oneshot=True)
def main(): rospy.init_node('hello_world') client = RLLDefaultMoveClient(hello_world) client.spin()