StarlingUAS / FenswoodScenario

Fenswood Farm as a scenario for Starling
1 stars 3 forks source link

No Gazebo access on Windows #4

Closed arthurrichards77 closed 3 years ago

arthurrichards77 commented 3 years ago

Can't access localhost:8080 on Windows - just get connection refused, and Docker Desktop shows no ports available. Output messages show Gazebo listening on 8080 though. Suspect problem is that host networking is not permitted on Windows.

Tried with a modified version of the compose file as below. That enabled me to get a Gazebo window up in my browser but also gave lots of error messages from mavros, indicating that it could no longer find the FCU URL, presumably due to the network change,

`version: '3'

services: simhost: image: uobflightlabstarling/starling-sim-iris-ap:latest volumes:

mhl787156 commented 3 years ago

Ah right, this was the issue I mentioned in our meeting, proposal is to have a linux version which runs network host and a windows version (with correct settings) which runs a docker network.

Will push a fix soon

arthurrichards77 commented 3 years ago

Thanks @mhl787156 - hopefully this is just a matter of folding back in some of the clever addressing that has worked elsewhere. Sorry if the need for Windows support is a pain but I think it's important - part of the appeal of the Starling approach to this project is that we don't need to support students trying to go dual-boot or install VMs on their own laptops, including all the Linux admin that they chose to avoid in the first place. This way, we just have to support Docker for everyone. With Linux only, we have to support Docker AND Linux.

mhl787156 commented 3 years ago

Yeah you are correct there, a requirement for starling was to be multi-platform anyway. I think in this particular case we forgot that net=host via docker (and docker-compose) was only supported on linux with our last update!

arthurrichards77 commented 3 years ago

Fails for me on Windows - did you have it working...? Looks like it's still looking for the FCU on localhost. Was the old stuff about detecting the right IP address put back in as well as the network?

mavros_1           | [run_ros1.sh-1] [ INFO] [1635493438.164464500]: FCU URL: tcp://127.0.0.1:5760?ids=1,240
mavros_1           | [run_ros1.sh-1] [ INFO] [1635493438.167159500]: tcp0: Server address: 127.0.0.1:5760
mavros_1           | [run_ros1.sh-1] [FATAL] [1635493438.533177500]: FCU: DeviceError:tcp:connect: Connection refused

Note on priority it's fine for the Nov 3rd video to be developed from a Linux deployment, so this can wait until after the other developments for the video.

mhl787156 commented 3 years ago

@rob-clarke when you said you hadn't put in the port stuff, is that for this exact use case when gazebo/sitl/mavros are running in different containers? Or for kubernetes specifically? I think we are going to need the AP equivalents to the following within the SITL container

rob-clarke commented 3 years ago

The ArduPilot side should be relatively straightforward using the --sim-address, --sim-port-in & --sim-port-out options. I'll have a look this afternoon/evening

rob-clarke commented 3 years ago

The ap-sim-address branch has an initial stab at allowing the configuration. We will need to figure out how to pass the IPs/if we need to do lookup from hostnames in the entrypoints. Haven't looked at port configuration yet as shouldn't be needed for a single instance.

Set AP_SIM_ADDRESS on the ArduPilot SITL to point to the Gazebo container and AP_SITL_ADDRESS on the Gazebo container to point to the SITL.

Will likely need to add *_HOST variations on these as compose files tend not to expose IPs.

arthurrichards77 commented 3 years ago

OK - we'll talk on Monday about this, but I'm confused for two reasons:

  1. the error message I was seeing was related, I think, to the MAVROS container talking to the SITL instance. Maybe I missed other errors related to the SITL<->Gazebo link, but the main recurring one was definitely MAVROS<->SITL.
  2. I had no such problems on the main Starling single-drone sim docker-compose app. Has something been taken out? Or is this a result of the switch to Ardupilot? I feel like all the capability to look up IP addresses of other containers in the network must already exist. Is it just a matter of re-applying it here or am I missing a more fundamental challenge?
rob-clarke commented 3 years ago

On 1, yes likely the SITL <-> Gazebo problems were hidden by the MAVROS ones. MAVROS_FCU_URL will need to be adjusted to point to the SITL container. This was not a problem with network host as everything was using loopback IP.

The same thing applies to the SITL -> Gazebo link but some more mechanics need to be in place to make the adjustment. Regarding 2, yes this is ArduPilot specific, we hadn't yet got a method of exposing how to set the IPs used by the SITL to talk to the sim. The new branch adds that.

The SITL, and ArduPilot's Gazebo plug-in, won't be able to cope with plain hostnames so we'll need to add the host -> IP lookups. We've already done something similar for the PX4 images so this shouldn't be a problem.