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

Add background-sound option #166

Merged
merged 1 commit into from
Dec 14, 2024
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
7 changes: 7 additions & 0 deletions config/mower_config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,13 @@
"description": "Sound volume (0-100 or -1). -1 means the volume is managed by the CoverUI.",
"default": -1,
"x-environment-variable": "OM_VOLUME"
},
"OM_BACKGROUND_SOUNDS": {
"type": "boolean",
"title": "Also play background sounds",
"description": "Enable if DFPlayer shall also play background-sounds (beside the informational advert sounds)",
"default": false,
"x-environment-variable": "OM_BACKGROUND_SOUNDS"
}
}
},
Expand Down
10 changes: 9 additions & 1 deletion config/mower_config.sh.example
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,16 @@ export OM_MOWER_GAMEPAD="xbox360"
# Sound volume (%)
# Supported values:
# 0-100 = Set sound volume on OM start, ignoring a previously set volume level (i.e. changed by CoverUI)
# -1 = Don't change a previously set volume level (i.e. changed by CoverUI)
# -1 = Don't change a previously set volume level
# export OM_VOLUME=-1
#
# Background sounds
# Beside some spoken informational advert sounds like "Waiting for RTK GPS" or "Heading back to docking station",
# the current sound implementation might also play some funny background sounds like "I'm singing in the rain" once rain got detected.
# But it will also play background sounds which might unsettle your wife or neighbor.
# That's why it's configured false/off by default. If your wife or neightbor is heavy-duty, you can set it to "true" (on) here:
# export OM_BACKGROUND_SOUNDS=False


################################
## GPS Settings ##
Expand Down
2 changes: 2 additions & 0 deletions src/mower_comms/src/mower_comms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,8 @@ int main(int argc, char **argv) {
paramNh.param("/mower_logic/ignore_charging_current", false) ? OptionState::ON : OptionState::OFF;
llhl_config.options.dfp_is_5v = paramNh.param("dfp_is_5v", false) ? OptionState::ON : OptionState::OFF;
llhl_config.volume = paramNh.param("volume", -1);
llhl_config.options.background_sounds =
paramNh.param("background_sounds", false) ? OptionState::ON : OptionState::OFF;
// ISO-639-1 (2 char) language code
strncpy(llhl_config.language, paramNh.param<std::string>("language", "en").c_str(), 2);

Expand Down
1 change: 1 addition & 0 deletions src/open_mower/launch/include/_comms.launch
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<param name="dfp_is_5v" value="$(optenv OM_DFP_IS_5V False)"/>
<param name="language" value="$(optenv OM_LANGUAGE en)"/>
<param name="volume" value="$(optenv OM_VOLUME -1)"/>
<param name="background_sounds" value="$(optenv OM_BACKGROUND_SOUNDS False)"/>
</node>

<include file="$(find open_mower)/launch/include/_gps.launch" unless="$(optenv OM_NO_GPS False)">
Expand Down