Skip to content

Commit

Permalink
make more music (#133)
Browse files Browse the repository at this point in the history
# 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 <[email protected]>
  • Loading branch information
karmanyaahm and Omega Jerry authored Mar 7, 2025
1 parent 48c407b commit 763839a
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions 11_Robots/ghost_tank/src/tank_robot_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ bool TankRobotPlugin::runAutonFromDriver(std::shared_ptr<JoystickDeviceData> joy

void TankRobotPlugin::toggleBagRecorder(std::shared_ptr<JoystickDeviceData> joy_data)
{
return;
if (joy_data->btn_y && joy_data->btn_x && !m_recording_btn_pressed) {
m_recording_btn_pressed = true;
if (!m_recording) {
Expand Down Expand Up @@ -698,9 +699,37 @@ void TankRobotPlugin::updateClamp(std::shared_ptr<JoystickDeviceData> joy_data)
void TankRobotPlugin::updateMusic(double current_time, std::shared_ptr<JoystickDeviceData> 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");
}
}
}
}

Expand Down

0 comments on commit 763839a

Please sign in to comment.