DroneKit: Move a Servo by sending RC signals from Raspberry Pi to PixHawk

I need help figuring out how to code a problem where the Raspberry Pi is able to send RC signals to PixHawk via mavlink. This is supposed to work in non-GPS environments. I have connected RPI and PixHawk through TELEM 2 and PixHawk’s RX, TX

I read this guide where it sends a message command_long for moving a servo: Move a Servo — Dev documentation

So I want to try implementing the command_long message using this code

msg = vehicle.message_factory.command_long_encode(
0, 0,    # target_system, target_component
mavutil.mavlink.MAV_CMD_DO_CHANGE_SPEED, #command
0, #confirmation
heading,    # param 1, yaw in degrees
0,          # param 2, yaw speed deg/s
1,          # param 3, direction -1 ccw, 1 cw
is_relative, # param 4, relative offset 1, absolute angle 0
0, 0, 0)    # param 5 ~ 7 not used
# send command to vehicle
vehicle.send_mavlink(msg)

I don’t know if it works though but I’ve been looking for python codes that can send rc signals without gps-dependence and I can’t seem to find one. So if this does not work, I want to ask if are there any python scripts or commands where RPi can send RC Signal to Pixhawl via Mavlink?