From 763839af6054fb8fc9ee117536d8f5f82a105bf6 Mon Sep 17 00:00:00 2001 From: Karmanyaah Malhotra Date: Fri, 7 Mar 2025 09:35:28 -0500 Subject: [PATCH] make more music (#133) # PR Summary PR Link: INSERT-LINK-HERE Issue Link: INSERT-LINK-HERE ### Description Add a single line summary describing the purpose of this PR. ### Reviewers Tag reviewers. - Required: - Optional: --- ### Changelog - Add a bulleted list of major changes ### Reviewer Guide This is the most important part! - No one is going to read every line of every PR, so you need to tell the reviewers what they are looking for. - Point out lines you want feedback on or feel unsure about. - Highlight major changes that other members need to know about. ### Testing #### Automatic - Describe test cases that are covered by unit tests #### Manual - Describe any manual testing (launch files, visualizations, etc.) ### Documentation - Link any relevant documentation ### Checklist - [ ] Confirmed all tests pass on a clean build - [ ] Added reviewers in Github - [ ] Posted PR Summary to Discord PR's Channel - [ ] Ran uncrustify on any modified C++ files - [ ] Ran Colcon Lint for any modified CMakeLists.txt or Package.xml Co-authored-by: Omega Jerry --- .../ghost_tank/src/tank_robot_plugin.cpp | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/11_Robots/ghost_tank/src/tank_robot_plugin.cpp b/11_Robots/ghost_tank/src/tank_robot_plugin.cpp index f3d9fe5b..fa5bab45 100644 --- a/11_Robots/ghost_tank/src/tank_robot_plugin.cpp +++ b/11_Robots/ghost_tank/src/tank_robot_plugin.cpp @@ -492,6 +492,7 @@ bool TankRobotPlugin::runAutonFromDriver(std::shared_ptr joy void TankRobotPlugin::toggleBagRecorder(std::shared_ptr joy_data) { + return; if (joy_data->btn_y && joy_data->btn_x && !m_recording_btn_pressed) { m_recording_btn_pressed = true; if (!m_recording) { @@ -698,9 +699,37 @@ void TankRobotPlugin::updateClamp(std::shared_ptr joy_data) void TankRobotPlugin::updateMusic(double current_time, std::shared_ptr joy_data) { static double btn_pressed = 0; - if (joy_data->btn_u && btn_pressed < (current_time - 5)){ - btn_pressed = current_time; - playMusic(""); // should play random when empty + if (true && btn_pressed < (current_time - 5)) + { + static double btn_pressed = 0; + if (btn_pressed < (current_time - 2)) + { + if (joy_data->btn_b) + { + btn_pressed = current_time; + playMusic("rand"); + } + else if (joy_data->btn_x) + { + btn_pressed = current_time; + playMusic("seinfeld"); + } + else if (false) + { + btn_pressed = current_time; + playMusic("awesome"); + } + else if (joy_data->btn_u) + { + btn_pressed = current_time; + playMusic("emotional"); + } + else if (joy_data->btn_a) + { + btn_pressed = current_time; + playMusic("feminominon"); + } + } } }