-
Notifications
You must be signed in to change notification settings - Fork 97
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
[jsk_robot_startup] Systemd service for speaking at shutdown #1628
base: master
Are you sure you want to change the base?
Conversation
145aa47
to
4c0dac5
Compare
@@ -1,6 +1,17 @@ | |||
jsk_robot_startup | |||
=== | |||
|
|||
## SetUp (Running following commands in the first time) | |||
|
|||
### Install systemd services |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some name to this systemd services and describe it with more details?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added more description
cb03944
I think How about It would be better if they can describe its behavior without making its name too complicated. (hooked at startup and shutdown) |
# Created by VOICEVOX:四国めたん | ||
cd $jsk_robot_startup/data | ||
if [ ! -d /usr/share/sounds/jsk_robot_startup ]; then | ||
sudo mkdir -p /usr/share/sounds/jsk_robot_startup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change the directory to /usr/local/share/sounds/jsk_robot_startup
?
https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s09.html says
Locally installed software must be placed within /usr/local rather than /usr unless it is being installed to replace or upgrade software in /usr. [28]
# Copy scripts | ||
cd $jsk_robot_startup/systemd | ||
if [ ! -d /usr/local/bin/jsk_robot_startup ]; then | ||
sudo mkdir -p /usr/local/bin/jsk_robot_startup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change this directory to /usr/local/src
(maybe /usr/local/share/
) ?
We should not copy these file under the bin
directory if we do not deal with these file as binary executable.
You can get DEVICE_NAME by executing `aplay -L`(e.g. sysdefault:CARD=AUDIO). | ||
```bash | ||
rosrun jsk_robot_startup install_systemd.sh DEVICE_NAME | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add how to uninstall these files installed under /usr/local
.
Please see https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html for requirements and guidelines for file and directory placement under UNIX-like operating systems. |
What is this?
start_sound.service
andstop_sound.service
are installed to tell you when the robot starts and stops. If aplay is not available, beep command is used.Synthesized Japanese voice is played by default(VOICEVOX:四国めたん). To play different sound, put your wave file in
/usr/share/sound/jsk_robot_startup
and update path written in/usr/local/bin/jsk_robot_startup/playsound.sh
.Installation(first time)
To install scripts, run the following command with device name as an argument.
You can get your device name by executing
aplay -L
.The files are overwritten after the second time.
Examples
fetch15
fetch1075
laptop
I confirmed that it works in fetch15, fetch1075 and my laptop using
/sbin/shutdown -h now
andreboot
.This feature is necessary to immediately tell people that the robot shuts down(including non-users).
boot_sound.py
differs in that it cannot work without soundplay.syslog