Remote Action
1. Feature Overview
The remote control capability lets the plugin control which camera Pilot's primary view shows. An aircraft usually has multiple cameras (main, FPV, left/right payloads, etc.), and the plugin can switch Pilot's primary video view to a specific one as the workflow requires—for example, switch to FPV to assist takeoff and landing, or switch to a payload camera during a task.
1.1 Capability Overview
| Capability | Description |
|---|---|
| Switch primary camera view | Switch Pilot's primary video view to a specific camera |
1.2 Use Cases
- Takeoff/landing assist: switch to the FPV camera to observe below and around the aircraft
- Task viewing: switch to a payload camera to view the task feed
2. Interface Call Examples
The examples below assume you have completed SDK initialization and the plugin is connected to Pilot (for connection state, see the Plugin Connection State documentation). All interfaces are called through the manager singleton RemoteControlManager.getInstance().
2.1 Switch the Primary Camera View (switchToPrimaryCameraView)
Pass the target camera's ComponentIndexType; the callback is success / failure:
val rcManager = RemoteControlManager.getInstance() // get the manager singleton
rcManager.switchToPrimaryCameraView(
ComponentIndexType.FPV, // target camera: switch to FPV
object : CommonCallbacks.CompletionCallback {
override fun onSuccess() { /* switched */ }
override fun onFailure(error: IDJIError) { /* error.errorCode() */ }
}
)
ComponentIndexType is MSDK's general camera-index enum; common values:
| Value | Meaning |
|---|---|
LEFT_OR_MAIN | Main camera (or left camera) |
FPV | FPV camera |
RIGHT | Right camera |
UP | Upward camera |
3. API Reference
For the full definitions of these interface methods (including parameter enums), see the API documentation: IRemoteControlManager.
IRemoteControlManager is the entry point of the remote control interface, exposing the following methods:
| Item | Description |
|---|---|
IRemoteControlManager | Entry point of the remote control interface |
switchToPrimaryCameraView | Switch Pilot's primary view to a specific camera |
4. FAQ
Q1: The switch callback returns REMOTE_DISCONNECTED?
Calling before the connection is ready (delegate not injected) returns this error immediately. Call after the connection state is CONNECTED, or handle the error and retry in the callback.
Q2: Which ComponentIndexType value should I pass?
It is MSDK's general camera-index enum; choose based on the aircraft's actual camera layout: main / left uses LEFT_OR_MAIN, FPV uses FPV, and right / up use RIGHT / UP. If the target camera does not exist on the current model, the switch fails—check error.errorCode().
Appendix: Error Code Quick Reference
The error codes below come from dji.open.pilot.base.error.RemoteError:
| Error code constant | Trigger | Suggested handling |
|---|---|---|
REMOTE_DISCONNECTED | Called before the connection is ready | Retry after the connection state is CONNECTED; see Q1 |