Check in Joystick to enable as default

@Michael_Oborne Would it be possible to add a checkbox in the joystick menu that if checked starts the joystick by default when Mission Planner starts?
It would be very convenient for those people who use only joystick or for people that use a self made ground station.

Thanks

Currently the way to do this is via command line args. If you specify a joystick name when starting mission planner it will enable at startup

@Michael_Oborne That would be great, is there a wiki page with what is supported and how to use it?
Any chance could add rtk as an arg?
For RTK i mean to add as an argument the connect button. I havbe mine configurated and i have to enter the page setup every flight and press connect. It would be great if there was an argument that would do the connect button for me.

EDIT: i figured out the joystick arg, i entered after missionplanner.exe the following:

/joy “T.Flight Stick X” /type copter

Where T.Flight Stick X is the name that windows gave to my joystick and copter is the type of firmware i am using.
I looked at the source of Mainv2 and i think i got it right.

Your example looks correct. I should be able to do rtk as well, what is the input you normally use? serial or ntrip etc

I use a correction from an IP server. My ground station is connected to internet. So i configured server ip and mount point but every time i have to go in and press “connect”. Would like MP to authomatically connect when i open it with something like /rtk connect
Connection i use is NTRIP

Thanks

@Michael_Oborne Hi! How do I find out what all commandline args are available for MissionPlanner 1.3.68 on Windows 10? I’d like to have MissionPlanner handle the joystick and pass the stick and button inputs to X-Plane through SITL instead of X-Plane directly handling the joystick and buttons. Do I have to do something like what @Corrado_Steri seems to have done? I tried passing invoking MissionPlanner.exe with --help but that did not seem to work. Also, is there some documentation about the items on the screen that pops up when I click on FLIGHT DATA|Actions|Joystick? Thanks in advance for any pointers to relevant docs or posts.

ive added a /rtk option in the latest beta
eg
/rtk http://user:user@10.1.1.17:2101/RTCMv3.2

the joystick would need to be setup in mission planner first, then you can use the command above to start it up

sitl is not an option to start when MP starts. but you could start it externally, and use the autoconnect to connect on startup.

Just tested in latest beta and it doesn’t start.
Something happens because the button says “stop” in the rtk page, as if it tries to connect.
Do i have to specify ntrip somewhere?

@Michael_Oborne Thank you for responding. As you suggested, I start up AP/SITL explicitly. Then I select the “model” from MP’s SIMULATION screen as “xplane” and click on the plane icon on the bottom row, it automatically connects. It is still not clear as to what the ch # to the left of each of the items in the joystick screen map to in AP/SITL. Thanks.

@Michael_Oborne I have setup the X,Y,Z and Rz axes in MissionPlanner Joystick screen and enabled it, but when I manipulate the throttle or the other axes, I don’t see any changes to what SITL seems to be reading on its rcin channels. Is there an easy way to find out if MP is sending any MAVLink packets to AP/SITL with joystick data? Do I have to also start MissionPlanner.exe with additional arguments before it would send joystick data to AP/SITL? @Corrado_Steri had mentioned /joy etc., but I couldn’t find it in MainV2.cs. Thanks for any help.

make sure you looking in the current code, and running MP beta

@Michael_Oborne I cloned the latest MissionPlanner bits from github, just to look at the sources to see if I can locate anything like commandline options in MainV2. I do not build the MissionPlanner executable on my machine; I installed what I thought was the latest stuff a few days ago (1.3.70 build 1.3.7277.34800) on my Windows 10 PC, and that’s what I use. When I bring up the joystick configuration screen in MP, it does recognize it (T.Flight Hotas X), and I have configured just the X(roll), Y(pitch), Rz(yaw) and Z(throttle) to Channels #1,2,3 and 4 and enabled it. Can I assume that once a connection with AP/SITL is established (and I have even started running a mission) I should be able to see joystick input from MissionPlanner in AP/SITL? Is there a particular MAVLINK message that is used for Joystick data? May be I can look for it in the SITL with gdb … Thank you.

Minor update. I enabled my T.Flight Hotas X joystick in MissionPlanner and set a breakpoint in the GCS_MAVLINK_Plane::handeMessage() in GCS_Mavlink.cpp (in Ardupilot/ArduPlane), but I never hit it when I manipulate the joystick. Is there some way I can check if the MAVLINK_MSG_ID_MANUAL_CONTROL messages are being sent by MissionPlanner? Thanks for any suggestions.

@Corrado_Steri Hi! Do you have the Joystick working now? I have been fighting the joystick problem for awhile and I was wondering if you can help. My setup is this, on a Windows 10 PC: MP(3.1.70)<->AP/SITL(4.0.0 stable)<->X-Plane 11.41. I have made sure that X-Plane does not expect any direct joystick input. I start AP/SITL (–model xplane), then start X-Plane, and finally start MissionPlanner with the following arguments like you figured out: /joy “T.Flight Hotas X” /type plane (I don’t know if this should be something else!). After connecting MP to AP/SITL, I used the Flight Data|Actions|Joystick screen to setup the Roll, Pitch, Yaw and Throttle channels and enabled it. There were no error messages or diagnostics. When I manipulate the joystick, MP does not send any MAVLINK_MSG_ID_MANUAL_CONTROL messages to AP/SITL - I have verified this by setting a breakpoint in AP/SITL where it handles that message. Do you know if I have to setup some MP config param or something? Thanks a lot in advance.

I have the joystick functioning perfectly. Make sure the exact name windows assigns to the joystick because that is the one you have to pass to MP on the startup line.
The name of the joystick you pass to MP on the line it is not needed for the joystick to work it just enables joystick on startup.
The messages the joystick sends to arducopter i don’t think are MANUAL_CONTROL but RC_OVERRIDE.

Corrado

1 Like

Thanks a million, Corrado! I just tested it, and you were absolutely correct; I am getting the joystick input sent via an RC_CHANNELS_OVERRIDE msg. Now all I need to do is figure out how to use it!

@Corrado_Steri In my initial enthusiasm, I overlooked the fact that the RC_CHANNELS_OVERRIDE packets don’t get sent to AP/SITL unless I press the “Disable” button - Yes! - in the joystick setup screen after I manipulate the joystick! It is as though the packets are buffered up in MP and not flushed unless I press “Disable”! This seems very weird … Do you have any idea how to get around this issue? Thanks.

Try starting mission planner without the joystick arg line and enable it inside the program and see if it works. If it does than there is something wrong in the arg line.

@Corrado_Steri Thanks for pointing out that I shouldn’t be duplicating posts! Since I was able to get the joystick data in AP/SITL via an RC_CHANNELS_OVERRIDE msg, I felt that the command line args were probably ok. After some more experimentation, I traced the issue to my using the “SIMULATION” tab in the MP main screen to initiate the connection to AP/SITL! If I simply pressed the Connection icon in the top right corner of MP main screen, then, once I press “Enable” in the Joystick setup screen, I get the RC_CHANNELS_OVERRIDE packets without any more trouble! Thank you for all your help.