So i downloaded the bluesim simulation from github, and everything is working fine i connected it to Qground and managed to control the vehicle, but then i wanted to run a python script using pymavlink to move the vehicle just forward. i used the scripts form pymavlink Ardusub documentation and changed the port.
here is the script
import time import sys master = mavutil.mavlink_connection('tcp:127.0.0.1:5760') master.wait_heartbeat() def set_rc_channel_pwm(channel_id, pwm=1500): if channel_id < 1 or channel_id > 18: print("Channel does not exist.") return rc_channel_values = [65535 for _ in range(18)] rc_channel_values[channel_id - 1] = pwm master.mav.rc_channels_override_send( master.target_system, master.target_component, *rc_channel_values) while True: try: set_rc_channel_pwm(5, 1600) time.sleep(0.2) print('command sent') except Exception as error: print(error) sys.exit(0)
but i still have errors!