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)
BlueSim starts its own SITL instance, where it communicates via an intern json protocol for simulation.
If you want to use mavlink as a bridge, you’ll need to run SITL using the README instructions and with an argument for the mavlink endpoint for you script.
so the script i am using will work for the ROV in real world but won’t for the bluesim, is there any other simulation that you can hint me for to try the scripts, also about the readme you mean this ?https://github.com/bluerobotics/bluesim/blob/master/README.md
the gazebo simulation needs gazebo 7 or 8 and when ever I try downloading it the does not install and askes me to install gazebo 11, and what do you mean by SITL directly with QGC and mavproxy may you point me to where should i look for theses?