You have a 0.1s sleep and print calls that take some time of the IO, try to remove both calls.
It’s not possible to access gain values from the joystick input, if you want to change it grammatically, try to use JS_THR_GAIN
parameter or P gain parameters if you are using one of the stabilization flight modes.
For the gripper, is not possible, the PWM output gives an velocity reference for the gripper and not a position.
Check the gripper manual here: “Provide a servo PWM pulse at 1500 μs for no movement. Provide a servo PWM pulse greater than 1530 μs to open gripper. Provide a servo PWM pulse less than 1470 μs to close gripper.”
For the video, we are working on it, probably 0.0.22 version of companion. You can check more about it here.