Airsim base on PX4 v1.9.2

Hi,
is it possible to run the airsim simulator in cooperation with PX4 v1.9.2 or newer?
In version 1.8.2, launched based on this tutorial:
it works fine, but currently i need PX4 1.9.2 version.

Base on PX4 v1.8.2 it compiles as:

make posix_sitl_ekf2 none_iris

in version 1.9.2 it looks like neither posix nor ekf2 module.

@Darek AirSim does not support lockstep yet which was added in PX4 v1.9.2. They are however, working on adding support for it.

In the meantime, you can recompile PX4 with lockstep disabled:
https://dev.px4.io/v1.9.0/en/simulation/index.html#disable-lockstep-simulation

Thanks a lot Julian,
I did it, recompile px4, but it still not want to work.
when I followed tutorial:
~> /PX4/Firmware$ make posix_sitl_ekf2 none_iris

Makefile:469: *** ā€œposix_sitl_ekf2 cannot be the first argument. Use ā€˜make help|list_config_targetsā€™ to get a list of all possible [configuration] targets.ā€. Stop.

so I try to make:

make px4_sitl_default none_iris

The px4 start but it still have not communication with airsim.

How to run px4 in version 1.9.2 to communicate witch AirSim?

Ps.
When I started px4 repo from master I see in PX4 console:
WARN [commander] Preflight Fail: Compass Sensor #0 missing

I suppose you also need to switch from TCP to UDP by switching this to false:

I changed ~/PX4/Firmware/Tools/sitl_gazebo/models/rotors_description/urdf/iris_base.xacro to:

<xacro:arg name=ā€˜use_tcpā€™ default=ā€˜falseā€™ />

next

make clean
make px4_sitl_default none_iris

but PX4 still start on TCP

INFO [simulator] Waiting for simulator to connect on TCP port 4560

Did I miss something? maybe call other model not none_iris?

Oh, Iā€™m stupid. You donā€™t need to switch Gazebo :man_facepalming: but PX4:

https://github.com/PX4/Firmware/blob/7fe257c0c0e729f91afdf1b7d8d9a32d94ddcfc4/ROMFS/px4fmu_common/init.d-posix/rcS#L208

Change this line to:

simulator start -u 14560
1 Like

It works +1:
Julian, many many thanks for your help.

1 Like

Iā€™m trying to run PX4 1.11 (w/ cygwin toolchain) + AirSim 1.3.0 on windows
I got this waring:

pxh> WARN [commander] Takeoff denied! Please disarm and retry
WARN [PreFlightCheck] Preflight Fail: Compass Sensor #0 missing
WARN [PreFlightCheck] Primary compass not found
WARN [PreFlightCheck] Preflight Fail: Accel Sensor #0 missing
WARN [PreFlightCheck] Primary accelerometer not found
WARN [PreFlightCheck] Preflight Fail: Gyro Sensor #0 missing
WARN [PreFlightCheck] Primary gyro not found
WARN [PreFlightCheck] Preflight Fail: Baro Sensor #0 missing

settings.json:

{
   "SettingsVersion": 1.2,
   "SimMode": "Multirotor",
   "Vehicles": {
       "PX4": {
           "VehicleType": "PX4Multirotor",
           "UseSerial": false,
           "UseTcp": true,
           "TcpPort": 4560,
           "ControlPort": 14580,
           "params": {
               "NAV_RCL_ACT": 0,
               "NAV_DLL_ACT": 0,
               "LPE_LAT": 47.641468,
               "LPE_LON": -122.140165,
               "COM_OBL_ACT": 1
           }
       }
   }
}

@bys_1123 can you create a new thread please? This thread is for 1.9.2.