add checking for up or down with sshkeyboard¨v
This commit is contained in:
@@ -12,8 +12,8 @@ class TestController(Node):
|
||||
def __init__(self):
|
||||
super().__init__('test_controller')
|
||||
self.cli = self.create_client(SetAttitude, 'drone/set_attitude')
|
||||
# while not self.cli.wait_for_service(timeout_sec=1.0):
|
||||
# self.get_logger().info('service not available, waiting again...')
|
||||
while not self.cli.wait_for_service(timeout_sec=1.0):
|
||||
self.get_logger().info('service not available, waiting again...')
|
||||
self.req = SetAttitude.Request()
|
||||
|
||||
self.get_logger().info("Controls:\nW - forward\nS - backward\nA - left\nD - right\nQ - rotate left\nE - rotate right\nSpace - up\nShift - down\nEsc - exit")
|
||||
@@ -65,6 +65,14 @@ class TestController(Node):
|
||||
self.get_logger().info('rotate right')
|
||||
self.send_request(pitch=0.0, yaw=10.0,
|
||||
roll=0.0, thrust=0.0)
|
||||
if key == 'z':
|
||||
self.get_logger().info('down')
|
||||
self.send_request(pitch=0.0, yaw=0.0,
|
||||
roll=0.0, thrust=-0.05)
|
||||
if key == 'space':
|
||||
self.get_logger().info('down')
|
||||
self.send_request(pitch=0.0, yaw=0.0,
|
||||
roll=0.0, thrust=-0.05)
|
||||
# else:
|
||||
# try:
|
||||
# # known keys like spacebar, ctrl
|
||||
|
||||
Reference in New Issue
Block a user