You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I can't to manual control the drone I am 100% sure that drone in Manual flight mode
importrandomfrommavsdkimportSystemimportasynciomanual_inputs= [
[0, 0, 0.5, 0], # no movement
[-1, 0, 0.5, 0], # minimum roll
[1, 0, 0.5, 0], # maximum roll
[0, -1, 0.5, 0], # minimum pitch
[0, 1, 0.5, 0], # maximum pitch
[0, 0, 0.5, -1], # minimum yaw
[0, 0, 0.5, 1], # maximum yaw
[0, 0, 1, 0], # max throttle
[0, 0, 0, 0], # minimum throttle
]
asyncdefrun():
drone=System(mavsdk_server_address='localhost', port=50051)
# await drone.connect(system_address='serial:///dev/ttyACM0')print('Connecting to drone')
awaitdrone.connect(system_address='serial:///dev/tty.usbmodem1103')
status_text_task=asyncio.ensure_future(print_status_text(drone))
print('Waiting for drone to connect...')
asyncforstateindrone.core.connection_state():
ifstate.is_connected:
print(f'-- Connected to drone')
breakprint("-- set manual control values")
awaitdrone.manual_control.set_manual_control_input(
float(0), float(0), float(0.5), float(0)
)
# start manual controlprint("-- Starting manual control")
awaitdrone.manual_control.start_position_control()
whileTrue:
# grabs a random input from the test list# WARNING - your simulation vehicle may crash if its unlucky enoughinput_index=random.randint(0, len(manual_inputs) -1)
input_list=manual_inputs[input_index]
# get current state of roll axis (between -1 and 1)roll=float(input_list[0])
# get current state of pitch axis (between -1 and 1)pitch=float(input_list[1])
# get current state of throttle axis# (between -1 and 1, but between 0 and 1 is expected)throttle=float(input_list[2])
# get current state of yaw axis (between -1 and 1)yaw=float(input_list[3])
awaitdrone.manual_control.set_manual_control_input(
pitch, roll, throttle, yaw)
awaitasyncio.sleep(0.1)
status_text_task.cancel()
asyncdefprint_status_text(drone):
try:
asyncforstatus_textindrone.telemetry.status_text():
print(f'Status: {status_text.type}: {status_text.text}')
exceptasyncio.CancelledError:
returnif__name__=='__main__':
asyncio.run(run())
but when I try to but when I try to start_position_control I get the following:
and in mavsdk server I get this
The text was updated successfully, but these errors were encountered:
Hello, I can't to manual control the drone I am 100% sure that drone in Manual flight mode
but when I try to but when I try to start_position_control I get the following:
and in mavsdk server I get this
The text was updated successfully, but these errors were encountered: