Multiple Vehicle Connection
Oden can be connected to several vehicles at the same time from a single operator station. This is useful for monitoring a fleet or rapidly switching control between vehicles without having to tear down and re-establish the connection each time.
Requirements
To connect to multiple vehicle the vehicles in question cannot be a project based connection, i.e they cannot have a project attached to them which get downloaded and open on connection. Talk to the Voysys team to see if your licenses are project based or not.
The operating side need also to be running webview and layout the videos through the web api.
Connecting to multiple vehicles
Each vehicle is connected individually by sending a fleet_connect message with the vehicle name. Repeat the call for every vehicle that should be connected:
const odenClient = getOrCreateOdenLayoutClient();
odenClient.sendNamedUserMessage("fleet_connect", { vehicle_name: "vehicle_a" });
odenClient.sendNamedUserMessage("fleet_connect", { vehicle_name: "vehicle_b" });
A vehicle is disconnected the same way using fleet_disconnect. See Vehicle management for the full web view API.
Once connected, feedback data from every vehicle is delivered together in the ocp_vehicle_user_data message. The vehicle_feedback field is a map keyed by vehicle name so each vehicle’s telemetry, faults, and latency can be displayed side by side.
Selecting the active vehicle
OCP can only forward gamepad input to one vehicle at a time. The receiving vehicle is chosen by the active_vehicle field in the ocp_client_user_data message:
odenClient.sendNamedUserMessage("ocp_client_user_data", {
active_vehicle: "vehicle_a",
client_user_data: {
vehicle_a: { user_data: {/* ... */}, ocp_disable_gamepad: false },
vehicle_b: { user_data: {/* ... */}, ocp_disable_gamepad: false },
}
});
Switching between vehicles is done by changing the active_vehicle value; no reconnection is needed. See Operator Side for the full message format.
Limitations
-
Only one active vehicle for gamepad input. OCP sends gamepad input to the vehicle named in
active_vehicle. All other connected vehicles raise theVehicleControlInactivefault while they are not selected. -
active_vehiclemust be set with multiple vehicles. If it is omitted while more than one vehicle is connected, no vehicle receives input andVehicleControlInactiveis raised on all of them. -
Client data must be provided per vehicle. The
client_user_datamap should contain an entry for every connected vehicle that should receive user data; vehicles missing from the map will not receive anyclient_user_data. -
Input is still routed through OCP. If gamepad input is handled entirely outside OCP (via
client_data),active_vehiclecan still be used as an indicator of the selected vehicle and theVehicleControlInactivefault reflects that selection.