Open lmr2693 opened 1 year ago
udp://:14540
. I see a QgcPort option in AirSim, could you try setting it to 14540? Alternatively you could run mavsdk_server with arg mavsdk_server -p 50051 udp://:14550
to use the same port as QGC.Assuming that AirSim runs on the same computer as mavsdk_server, once you change the port, mavsdk_server should detect a system.
1) Thanks for noticing. I'd downloaded the mavsdk_server_win32.exe file from an older issue post. Didn't notice how old the post was. Everything's running on v.1.4 now.
2) QgcPort did not work. :/
Going to install WSL2, PX4, and QGroundControl. If AirSim still an issue, may just scrap airsim and give gazebo a try.
I'll leave this thread open for a couple days, for if I have a question on PX4.
Thanks!
Did you manage to get AirSim to work with QGC, by the way? I mean AirSim should be sending to 127.0.0.1:14550
by default, so QGC should pick it up.
Hello,
I'm quite green in my coding skills and CS knowledge. Any assistance is appreciated.
Issue: The mavsdk code is not connecting to the AirSim drone. I assume its a combo of AirSim json settings and the MAVSDK initialization code and perhaps the mavsdk_server.
Background: I'm on a drone project tasked with autonomously flying UAVs. I've been tasked with setting up a simulator to test the Team's MAVSDK-python code. We've chosen Unreal Engine with AirSim (on Windows) and successfully installed AirSim and run its example PythonClient code. Note that we are not using a controller, so I assume AirSim is defaulting to its built-in controller "SimpleFlight". Will that be a problem with mavsdk?
Text file with the settings and code pasted below: [Settings_Code.txt]
My startup steps are as follows:
1) For manually setting the mavsdk_server to 50051, I downloaded the mavsdk_server.exe file and saved it to the mavsdk bin folder. I manually ran the file as follows:
I exited the command prompt, and then double clicked the actual file. Now the file runs on a different port. Will this be a problem?
2) How should we set the Airsim settings.json file? Is it a problem that we are using AirSim's flight controller and not a PX4? We were hoping to not have to use anything that would require running linux.
Current AirSim settings: { "SettingsVersion": 1.2, "SeeDocsAt": "https://github.com/Microsoft/AirSim/blob/master/docs/settings.md", "SimMode": "Multirotor", "LocalHostIp": "127.0.0.1", "Vehicles": { "SimpleFlight": { "VehicleType": "SimpleFlight", "DefaultVehicleState": "Armed", "LocalHostIp": "127.0.0.1", "ApiServerPort": 41451, "AutoCreate": true, "PawnPath": "", "EnableCollisionPassthrogh": false, "EnableCollisions": true, "AllowAPIAlways": true, "EnableTrace": false, "RC": { "RemoteControlID": 0, "AllowAPIWhenDisconnected": false } } } }
3) To test AirSim, I manually ran mavsdk again (step 1 above), then left the command window open, and ran the MAVSDK code below. (Note: I was able to run AirSim with their PythonClient code.)
import mavsdk import asyncio from mavsdk import System
async def run(): drone = mavsdk.System(mavsdk_server_address='localhost', port=50051) print("Using mavsdk server port 50051")
if name == "main": loop = asyncio.get_event_loop() loop.run_until_complete(run())
The outputs are: