Servers by jDrones

Joystick availability trough Python script

@Michael_Oborne Is Joystick available trough python scripting?

Thanks,

regards

which part?
just output or setup?

in python its exposed as
“Joystick”
that will give you things like
AcquireJoystick
start

Mainly output.
I would need to enable joystick with a script and than use one of the buttons inside my code.
Joystick is used by mission planner to fly the copter too.

Thanks in advance

@Michael_Oborne Any hint on how to use it?

Guess not :slight_smile:

for the past few days a few of the devs have been at

so patience
to start the joystick interface you need to provide the joystick name to the start function.

the C# code to star the interface is
// ensure the current mavinterface is use for this joystick
var joy = new Joystick.Joystick(() => MainV2.comPort);
// start the joystick
if (joy.start(cmds[“joy”]))
{
// set it to the global state
MainV2.joystick = joy;
// enable the inputs/outputs
MainV2.joystick.enabled = true;
}

How can this be implemented in a python script?
Sorry for keeping asking questions.

Thanks,

Corrado

You need to pass the current connected mav context to the joystick init. Then the joystick name to start it.

Servers by jDrones