Can't play ArduPlane SITL with Xplane 11

Hi everyone!
I tried many times to play ArduPlane SITL with Xplane 11 but I can’t. The situation is as followings. You can see it with my youtube ArduPlane SITL with Xplane 11 - YouTube

  1. First, run Xplane 11 with a Radio Control TX as a joysick. It works well.
  2. Then, run Mission Planner. Open the simulation tab and select xplane model and the stable airplane version.
  3. As soon as the ArduPlane is downloaded, all control surfaces of the Xplane’s aircraft move to their maximum end points and can’t be controlled by the TX.
  4. The Xplane’s joystick setting bars moves well following the TX’s sticks movements.
  5. Xplane’s Data Output settings are; UDP Rate=50.0, Checked the check box of Send network data out put, IP Address=127.0.0.1, Port=49001.
  6. My Mission Planner is 1.3.81 and ArduPlane is V4.4.

Could anyone help me?

I had the same problem, but enabling reverse in RC3 solved it.

thanks a lot for the suggestion, I am also facing the same problem and tried enabling RC3 in reverse, the aircraft’s control surfaces still slightly deviate in a random manner causing the aircraft to divert. Did you change anything else or have suggestions for that?

Check the flight mode. In my case, the control surface vibrated irregularly because the initial flight mode was RTL, but it stabilized when I set to manual mode.

1 Like

Thank you for your suggestion. Reversing RC3 has control surfaces return to their neutral positions. But they move randomly because the flight mode was RTL. Changing flight mode to mannual removed their movements but they do not follow joystick commands.

At first there was a message of “Invalid THR_FS_VALUE for rev throttle”. So I changed it from 950 to 2200 then the message changed to “Radio failsafe on” and RC3=650. It is very strange that RC3 is so small. Do you know why and how I can resolve this issue?

BTW when you move your joysticks the green bars of Radio caliblation page also move in accordance to joystick movements? My green bars do not move. Is it OK?

BTW when you move your joysticks the green bars of Radio caliblation page also move in accordance to joystick movements?

Yes they do.

Is your joystick properly configured?
Please refer to the following link.

The file “xplane_plane.json” must be properly edited to map X-Plane’s Axis to ArduPilot’s RCIN and it must be copied to the directory where you start ArduPilot.

If it is not clear, please show me a screenshot of X-Plane’s Joystick setup screen.

Thank you for your reply.
This is completely new information for me to setup Xplane11 for ArduPilot SITL simulation. So I can’t understand clearly. Please teach me step by step how I can download the “xplane_plane.json” file and how I can edit it and where it must be stored.

This is a screenshot of my Xplane11’s Joystick setup screen.

“xplane_plane.json” template can be found here.

Following is the json file edited for your environment.
You can copy, paste and edit it on notepad. Save it as “xplane_plane.json”.

# XPlane DREF map file for a simple plane
# assumes: Aileron, Elevator, Throttle, Rudder, flaps

{
    "settings" : { "debug" : 0 },

    "sim/operation/override/override_joystick" : { "type" : "fixed", "value" : 1 },
    "sim/operation/override/override_throttles" : { "type" : "fixed", "value" : 1 },

    # forward throttle, up to 4 engines
    "sim/flightmodel/engine/ENGN_thro_use[0]" : { "type" : "range", "range" : 1, "channel" : 3 },
    "sim/flightmodel/engine/ENGN_thro_use[1]" : { "type" : "range", "range" : 1, "channel" : 3 },
    "sim/flightmodel/engine/ENGN_thro_use[2]" : { "type" : "range", "range" : 1, "channel" : 3 },
    "sim/flightmodel/engine/ENGN_thro_use[3]" : { "type" : "range", "range" : 1, "channel" : 3 },

    # control surfaces, using yoke positions not surface overrides
    "sim/joystick/yoke_roll_ratio" : { "type" : "angle", "range" : 1, "channel" : 1 },
    "sim/joystick/yoke_pitch_ratio" : { "type" : "angle", "range" : 1, "channel" : 2 },
    "sim/joystick/yoke_heading_ratio" : { "type" : "angle", "range" : 1, "channel" : 4 },

    # assume flaps on channel 5
    "sim/cockpit2/controls/flap_ratio" : { "type" : "range", "range" : 1, "channel" : 5 },

    # joystick inputs
    "axis1" : { "type" : "joyaxis", "channel" : 1, "input_min" : 0.2, "input_max" : 0.8 },
    "axis2" : { "type" : "joyaxis", "channel" : 2, "input_min" : 0.2, "input_max" : 0.8 },
    "axis3" : { "type" : "joyaxis", "channel" : 3, "input_min" : 0.8, "input_max" : 0.2 },
    "axis4" : { "type" : "joyaxis", "channel" : 4, "input_min" : 0.2, "input_max" : 0.9 },
    "axis5" : { "type" : "joyaxis", "channel" : 5, "input_min" : 0.2, "input_max" : 0.9 },
    "button1" : { "channel" : 6, "mask" : 1 },
    "button2" : { "channel" : 7, "mask" : 2 },
    "button3" : { "type" : "joybutton", "channel" : 8, "mask" : 24 },
    "button4" : { "type" : "joybutton", "channel" : 9, "mask" : 4 }
}

I assume you are running MissionPlanner and X-Plane11 on the same Windows PC. “xplane_plane.json” should be copied to the following folder

Documents\Mission Planner\sitl\xplane

The preparation is now complete.

When you start SITL, ArduPilot.exe will start in a separate window, and if the json file is successfully loaded, you can see a message “Loaded 20 DRefs from xplane_plane.json” in this window. If not, you will see “Loaded 20 DRefs from @ROMFS/models/xplane_plane.json”.

image

Thank you for your quick response.
I have followed your suggestion and could see the message you told me above.
But still the situation has not changed.

  1. When simulation starts all control surfaces go to their end points.
  2. When I reverse throttle channel(RC3) of MP’s radio calibration page, control surfaces return to their neutral positions and move randomly because the flight mode is RTL.
  3. Changing the flight mode to manual, control surfaces movements stop and there appears a message “Invalid THR_FS_VALUE”.
  4. Changing THR_FS_VALUE from 950 to 2200 chages above “Invalid” message to “Prearm: Radio failsafe on” and I can’t move any surfaces by joystick.
  5. There are other many messages such as “Prearm: GPS1: not healthy”, “Prearm: 3D Accel calibration needed”.

Just to be sure, is “Joystick raw axis deflections” checked in the Data Output setting of X-Plane?

Yes it is checked.

Regrettably, this is as far as I can go with text communication alone.
It seems that some types of joysticks work well and some do not.

In my case, InterLink-X worked well and Logitech Gamepad F310 did not.

My joystick is FUTABA T10J TX. I connect it to my PC by FUTABA WSC-1.
I could play Xplane11 SITL with ArduPlane 4.2 with same configulation.
MissionPlannerのSITL機能でX-PLANE 11を動かした。 (youtube.com)

When ArduPlane updated to 4.4 it suddenly became not to work. Do you know why?

If I upload my procedure by video, can you give me some suggestion?

Plane-4.2 and Plane-4.4 have different methods of obtaining RCIN from X-Plane.

Check the “Show in Cockpit” checkbox for the following three items in the Data Output settings.

8 Joystick aileron/elevator/rudder
25 Throttle (commanded)
136 Joystick raw axis deflections

The following image will be displayed on the cockpit screen. Please let me know if each value changes when you move each axis of the joystick.

image

In Plane-4.2, index 8 and 25 were obtained as RCIN.
In Plane-4.4, index 136 is obtained as RCIN.

The latter method is superior to the former because it allows a wider range of aircraft to be controlled.

In my case, depending on the type of joystick the value of Index 136 is fixed to zero even though the value of Index 8 or 25 varies and the RCIN cannot be obtained. This seems to be a problem on the X-Plane side, not on the ArduPilot side.

In my case, Index 8 and 25 varies but Index 136 does not. It fixed to -0,010.
So, considering with your informationit, it must be X-Plane side problem.
But it is very curious that some joystick works and others not. Do you know why?

I don’t know about that either. You might want to give up manual flight of X-Plane via ArduPilot.

What is your objective for performing SITL with X-Plane? If you only want to fly manually, you can do it with X-Plane only.

If you want to use SITL for fully automated missions, from automatic takeoff to automatic landing, you no longer need a joystick.

You are correct! Thank you hatnac. I was out of right way.
My objective is to fly automated aerobatics. It surely be conducted in anto mode only.
I will try soon.
And I will contact with X-Plane producers and report this issue.

Thank you again for your kind support.

I found that the joystick can be used via Mission Planner. Please try it.

I am having just the same problem although I am getting closer now with @hatnac notes, might I have a look at all of your data out ticks @hatnac ? I have an Interlink plus so should be good.

I contacted with X-Plane support. They say I must consult with ArduPilot side on this issue but as I can not understand why, I am contacting again with them.