microsoft / AirSim

Open source simulator for autonomous vehicles built on Unreal Engine / Unity, from Microsoft AI & Research
https://microsoft.github.io/AirSim/
Other
16.31k stars 4.54k forks source link

How to get Airsim in Windows to send data to Px4 with Gazebo backend in WSL2 ? #4877

Open schakour opened 1 year ago

schakour commented 1 year ago

Question

What's your question ?

Not able to connect px4 to GazeboDrone, it shows "Waiting for connection - XXXXXXXXXXXXXXXXXXX"

Include context on what you are trying to achieve

The objective is: Using GazeboDrone and Airsm, I would like render the visualization of a drone using Airsim but the phyiscs engine from Gazebo, such that the sensor data is provided by Airsim.

Context details

Px4 is running in WSL2 in a docker container Airsim (latest)/UE(4.27) are running in Windows 10 [settings.json](https://gist.github.com/schakour/23dde08b19843105115975cb625f72d0) ### Include details of what you already did to find answers I cloned the Airsim repo and built it in WSL2 using GCC8 and G++8 I followed the steps in : [https://microsoft.github.io/AirSim/gazebo_drone/](url) I used the clang compiled environment provided in : [https://github.com/microsoft/AirSim/releases](url) As well as the instruction here: [https://microsoft.github.io/AirSim/px4_sitl_wsl2/](url) Including the modification of the ./GazeboDrone's main.cpp of: `msr::airlib::MultirotorRpcLibClient client("my_ip_address");` The part that I didn't find is the env var : PX4_SIM_HOST_ADDR in > ROMFS/px4fmu_common/init.d-posix/rcS and when I go into this file to add `# If PX4_SIM_HOST_ADDR environment variable is empty use localhost. if [ -z "${PX4_SIM_HOST_ADDR}" ]; then echo "PX4 SIM HOST: localhost" simulator start -c $simulator_tcp_port else echo "PX4 SIM HOST: $PX4_SIM_HOST_ADDR" simulator start -t $PX4_SIM_HOST_ADDR $simulator_tcp_port fi` I don't find anywhere a call like this : ` simulator start` Note that this is fork of PX4 that's been modified for R&D