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

Feature/ll add sound and neopixel #23

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
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "ROS/src/open_mower_ros"]
path = ROS/src/open_mower_ros
url = https://github.com/ClemensElflein/open_mower_ros.git
url = https://github.com/ene9ba/open_mower_ros.git
[submodule "ROS/src/teb_local_planner"]
path = ROS/src/teb_local_planner
url = https://github.com/rst-tu-dortmund/teb_local_planner.git
Expand All @@ -13,3 +13,6 @@
[submodule "ROS/src/xesc_ros"]
path = ROS/src/xesc_ros
url = https://github.com/ClemensElflein/xesc_ros.git
[submodule "ROS/src/mower2smarthome"]
path = ROS/src/mower2smarthome
url = https://github.com/ene9ba/mower2smarthome.git
Binary file removed Firmware/LowLevel/bin/firmware.uf2
Binary file not shown.
72 changes: 72 additions & 0 deletions Firmware/LowLevel/include/soundsystem.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// Created by Elmar Elflein on 18/07/22.
// Copyright (c) 2022 Elmar Elflein. All rights reserved.
//
// This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
//
// Feel free to use the design in your private/educational projects, but don't try to sell the design or products based on it without getting my consent first.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
//
#ifndef _SOUND_SYSTEM_H_
#define _SOUND_SYSTEM_H_

//#include <Arduino.h>
#include <stdint.h>
#include <list>

#include <pins.h>
#include <DFPlayerMini_Fast.h>
#include <soundsystem.h>


#define BUFFERSIZE 100

#define NR_SOUNDFILES 15 // Number of Soundfiles on SD-card



class MP3Sound
{




public:

uint32_t anzSoundfiles; // number of files stored on the SD-card
bool playing;

MP3Sound();

bool begin(int anzsoundsOnSD); // init serial stream and soundmodule, anzsoundOnSD : maximum number of available soundfiles on the SD-card

void playSound(int soundNr); // play soundfile number. This method writes soundfile nr in a list, the method processSounds() (has to run in loop) will play
// the sounds according to the list

void playSoundAdHoc(int soundNr); // play soundfile number immediately whithout waiting until the end of sound

void setvolume(int vol); // scales loudness from 0 to 100 %

int sounds2play(); // returns the number if sounds to play in the list

int processSounds(); // play all sounds from the list. This method has to be calles cyclic, e.g. every second.


private:
std::list <int> active_sounds;
bool sound_available;




};


#endif // _SOUND_SYSTEM_H_ HEADER_FILE
2 changes: 1 addition & 1 deletion Firmware/LowLevel/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ lib_deps =
debug_tool = custom
debug_init_break =
debug_load_mode = always
debug_port = tcp:ubuntu:3333
debug_port = tcp:ubuntu.local:3333

; 133MHz
board_build.f_cpu = 133000000L
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 18 additions & 0 deletions Firmware/LowLevel/soundfiles/GoogleTTS_Strings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- file leading nr -- ------ string to convert ------------

0001 Hi, I am Steve, your open mower green care is my profession
0002 open mower start up successful
0003 Initializing robot operating system
0004 Starting map area recording
0005 waiting for rtk gps signal
0006 calculating map dimensions
0007 initiate mowing sequence
0008 emergency stop button triggered
0009 emergency wheel lift sensor triggered
0010 rain detected, heading back to base
0011 open mower has completed mowing the lawn, heading back to charging station
0012 stay back, autononous robot mower in use
0013 ups, I did it again
0014 Hallo, ich bin Tobi, dein intelligenter Rasemäher, Rasenpflege ist mein Beruf
0015 Hello, I am Tobi, your smart mower, green care ist my profession

1 change: 1 addition & 0 deletions Firmware/LowLevel/src/datatypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#define PACKET_ID_LL_STATUS 1
#define PACKET_ID_LL_IMU 2
#define PACKET_ID_LL_UI_EVENT 3
#define PACKET_ID_LL_HEARTBEAT 0x42


Expand Down
Loading