Making an extension that programmatically drives ROV by interfacing with ardupilot

For a project, we’re trying to transfer a codebase (primarily written in python and javascript) from a DIY ROV to a BlueROV2. To get it to work, we need to re-route our motor control instructions to ardu-pilot. Right now we’re planning on encapsulating our existing codebase as an extension, and somehow communicating the mavlink instructions through either REST or mavlink-routerd. Is this possible? And are mavlink to REST and mavlink-routerd the only options? (We’re trying to minimize latency since our ROV is supposed to be driven remotely.)

Also, for the ardupilot REST api, we’ve been having difficulty finding documentation for formatting requests (we’re assuming we need to provide the request data in JSON, but are yet to find any examples or documentation on how to format these requests).

The best lead we’ve found is here GitHub - mavlink/mavlink2rest: mavlink2rest creates a REST server that provides mavlink information from a mavlink source, but there is still a lot of ambiguity.

We’re also pretty sure that we want to send the data specified here Manual Control (Joystick) Protocol · MAVLink Developer Guide, but again haven’t found documentation for sending via JSON or mavlink-routerd.