Sending motion commands is as easy as:
ros2 launch stretch_core stretch_driver.launch.py
import hello_helpers.hello_misc as hm
node = hm.HelloNode.quick_create('temp')
node.move_to_pose({'joint_lift': 0.4}, blocking=True)
node.move_to_pose({'joint_wrist_yaw': 0.0, 'joint_wrist_roll': 0.0}, blocking=True)
You can also write a ROS2 node to send motion commands:
import hello_helpers.hello_misc as hm
class MyNode(hm.HelloNode):
def __init__(self):
hm.HelloNode.__init__(self)
def main(self):
hm.HelloNode.main(self, 'my_node', 'my_node', wait_for_first_pointcloud=False)
# my_node's main logic goes here
self.move_to_pose({'joint_lift': 0.6}, blocking=True)
self.move_to_pose({'joint_wrist_yaw': -1.0, 'joint_wrist_pitch': -1.0}, blocking=True)
node = MyNode()
node.main()
Copy the above into a file called "example.py" and run it using:
python3 example.py