Open sashacomn opened 11 months ago
UPDATE
Looks like there are some issue with sockets. In SIM_Webots_Python.cpp there are while loop in recv_fdm method. So this loop is working until it will get some reply from Webots app. But for some reasons webots send messages but this messages is not reaching sitl in port (9003)
Sorry, I only just saw this. What OS are you running SITL on, and are you trying to use WSL if you are using windows?
Sorry, I only just saw this. What OS are you running SITL on, and are you trying to use WSL if you are using windows?
Yeah, I’ve used Windows 10 and WSL 2.
The issue is probably that the SITL or Webots sockets are not both connecting (Webots is getting data from SITL, but maybe not the other way around). Have you set the sitl-address in iris.wbt
as suggested in the warning block on the wiki page? If you have I can take a look later tonight.
@sashacomn I was able to reproduce what you are seeing by commenting out the code in the webots controller that sends data to the SITL. It would seem that data is correctly being sent from the SITL to webots (as webots detects the SITL), but not the other way around. I think that either your windows firewall is blocking this communication, or you need to add your WSL2 IP to iris.wbt
with a text editor. Copying from the wiki:
You may also need to add WSL’s IP found with "hostname -I" to iris.wbt so it looks something like this:
Iris {
controller "ardupilot_vehicle_controller"
controllerArgs [
"--motors"
"m1_motor, m2_motor, m3_motor, m4_motor"
"--sitl-address"
"172.x.x.x"
]
}
@IanBurwell.
I also have an issue where SITL cannot connect to Webots. I have Windows 11 and using WSL2. I followed the tutorial for the first-time setup and I added sitl address to iris.wbt param file as per instructions. And I get a MAV> link 1 down.
I am actually wandering whether the underlying issue is related to another existing issue with Airsim. Open issue #25257 (https://github.com/ArduPilot/ardupilot/issues/25257). That issue is recent and also shared by other issuers and discussed in the Ardupilot forum. This is a place that Ardupilot tutorial pointed to to get WSL2 and Airsim on Windows to talk. See the most recent posts on the bottom of https://discuss.ardupilot.org/t/gsoc-2019-airsim-simulator-support-for-ardupilot-sitl-part-ii/46395/23).
Before I tried to get Webots - SITL to work, I was trying to get Airsim (Colosseum) and SITL to connect and could not. I followed the instructions carefully. I am able to run SITL and Airsim separately without issues, so it seems to me the issue is with the connection. Since I am having an issue with Webots - SITL connection as well, I wander whether it is an issue between WLS and Windows, perhaps caused by a recent Windows update. I am only guessing. I checked and saw that my firewall's inbound rules allow for "webot-bin" and "UnrealEditor".
Update: Tried again after disabling firewall. Did not help. Also I do not have any external antivirus software. I also do not have NordVPN turned on.
ardupilot/Tools/autotest/sim_vehicle.py -v ArduCopter -w --model webots-python --add-param-file=ardupilot/libraries/SITL/examples/Webots_Python/params/iris.parm
Bug report
Issue details
When I'm running sitl with webots-python model I'm getting issue with mavlink connection. It says "MAV>link 1 down" This is command which I've used to start SITL:
Tools/autotest/sim_vehicle.py -v ArduCopter -w --model webots-python --add-param-file=libraries/SITL/examples/Webots_Python/params/iris.parm --sim-address=172.17.208.1
Issue happens only when use
--model webots-python
. Webots on C works fine, another models also works perfect, onlywebots-python
have mavlink issue on my sideVersion Copter 4.4
Platform [ ] All [ ] AntennaTracker [X] Copter [ ] Plane [ ] Rover [ ] Submarine
Airframe type X
Hardware type SITL
Logs This is console logs when sitl starting
Logs from SITL:
In Webots 2023a I have opened
iris.wbt
. Then runned sitl. Console in webots shows this: