Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Pico 4 controller emulation #2724

Merged
merged 1 commit into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions alvr/server_core/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ pub fn contruct_openvr_config(session: &SessionConfig) -> OpenvrConfig {
ControllersEmulationMode::Quest2Touch => 1,
ControllersEmulationMode::Quest3Plus => 2,
ControllersEmulationMode::QuestPro => 3,
ControllersEmulationMode::Pico4 => 10,
ControllersEmulationMode::ValveIndex => 20,
ControllersEmulationMode::ViveWand => 40,
ControllersEmulationMode::ViveTracker => 41,
Expand Down
5 changes: 5 additions & 0 deletions alvr/server_core/src/input_mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ pub fn registered_button_set(
.unwrap()
.button_set
.clone(),
ControllersEmulationMode::Pico4 => CONTROLLER_PROFILE_INFO
.get(&PICO4_CONTROLLER_PROFILE_ID)
.unwrap()
.button_set
.clone(),
ControllersEmulationMode::ValveIndex => CONTROLLER_PROFILE_INFO
.get(&INDEX_CONTROLLER_PROFILE_ID)
.unwrap()
Expand Down
25 changes: 25 additions & 0 deletions alvr/server_openvr/src/props.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ fn serial_number(device_id: u64) -> String {
ControllersEmulationMode::Quest3Plus => "2G0YXX0X0000XX_Controller", // 2G0YY Left 2G0YZ Right
ControllersEmulationMode::QuestPro => "230YXXXXXXXXXX_Controller", // 230YT left, 230YV right
ControllersEmulationMode::RiftSTouch
| ControllersEmulationMode::Pico4
| ControllersEmulationMode::ValveIndex
| ControllersEmulationMode::ViveWand
| ControllersEmulationMode::ViveTracker => "ALVR Remote Controller",
Expand Down Expand Up @@ -393,6 +394,30 @@ pub extern "C" fn set_device_openvr_props(device_id: u64) {
}
set_oculus_common_props();
}
ControllersEmulationMode::Pico4 => {
set_prop(TrackingSystemNameString, "vrlink");
set_prop(ManufacturerNameString, "ByteDance");
if left_hand {
set_prop(ModelNumberString, "PICO 4 (Left Controller)");
set_prop(
RenderModelNameString,
"{vrlink}/rendermodels/pico_4_controller_left",
);
set_icons("{vrlink}/icons/left_pico4");
} else if right_hand {
set_prop(ModelNumberString, "PICO 4 (Right Controller)");
set_prop(
RenderModelNameString,
"{vrlink}/rendermodels/pico_4_controller_right",
);
set_icons("{vrlink}/icons/right_pico4");
}
set_prop(ControllerTypeString, "pico_controller");
set_prop(
InputProfilePathString,
"{vrlink}/input/pico_controller_profile.json",
);
}
ControllersEmulationMode::ValveIndex => {
set_prop(TrackingSystemNameString, "indexcontroller");
set_prop(ManufacturerNameString, "Valve");
Expand Down
2 changes: 2 additions & 0 deletions alvr/session/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,8 @@ pub enum ControllersEmulationMode {
Quest3Plus,
#[schema(strings(display_name = "Quest Pro"))]
QuestPro,
#[schema(strings(display_name = "Pico 4"))]
Pico4,
#[schema(strings(display_name = "Valve Index"))]
ValveIndex,
#[schema(strings(display_name = "Vive Wand"))]
Expand Down