AUTHOR : Tsung-Han Brian Lee
LICENSE : MIT
In terminal of Audio Server Machine
# Modify username and ip for your case
$ git clone https://github.com/bobolee1239/ros-robotic-va.git
$ cd ros-robotic-va/script
$ chmod +x audio_server.py
$ ./audio_server.py <audio_server_ip_addr> <audio_server_port_num>
# or
$ python ./audio_server.py <audio_server_ip_addr> <audio_server_port_num>
In terminal of machine A
# Modify username and ip for your case
$ ssh [email protected]
$ cd ~/catkin_ws/src/
$ git clone https://github.com/bobolee1239/ros-robotic-va.git
$ cd ~/catkin_ws
$ catkin_make
$ export ROS_MASTER_URI="http://<machine_A_ip_addr>:11311"
$ export ROS_IP="<machine_A_ip_addr>"
$ roslaunch ros-robotic-va simpleVA_mic.launch
In terminal of machine B
# Modify username and ip for your case
$ ssh [email protected]
$ cd ~/catkin_ws/src/
$ git clone https://github.com/bobolee1239/ros-robotic-va.git
$ cd ~/catkin_ws
$ catkin_make
$ export ROS_MASTER_URI="http://<machine_A_ip_addr>:11311"
$ export ROS_IP="<machine_B_ip_addr>"
$ # you might want to execute in root permission, see following
$ roslaunch ros-robotic-va simpleVA_motor.launch
Environment
- Tested Operating System :
Ubuntu 16
|Raspian Strench
|ROS Kinetic
- Python Dependencies:
SimpleWebSocketServer
,websocket-client
,pyaudio
,pyusb
,webrtcvad
, andpocketsphinx
Make sure you have up-to-date version of pip, setuptools and wheel before install python dependencies
$ python3 -m pip install --upgrade pip setuptools wheel
Device Firmware (can be found in github/respeaker)
- Respeaker 8 mics DFU (Device Firmware Upgrade)
- Drivers for Raspberry Pi
To access USB device without root permission, you can add a udev .rules
file to /etc/udev/rules.d
$ echo 'SUBSYSTEM=="usb", MODE="0666"' | sudo tee -a /etc/udev/rules.d/60-usb.rules
$ sudo udevadm control -R # then re-plug the usb device
To access GPIO pins on Raspberry Pi without root permission on ROS node
$ sudo su
$ source /opt/ros/kinetic/setup.bash
$ source /home/pi/catkin_ws/devel/setup.bash
First, you need to install catkin-tools
and rospkg
.
$ pip3 install catkin-tools rospkg
or
$ python3 -m pip install catkin-tools rospkg
Second, invoke Python 3 interpreter at the beginning of Python scripts.
1 #!/usr/bin/env python3
Congrats! You can develop in Python 3 now.
Configure dictionary.txt
and keyword.txt
in script/beamforming/assets/pocketsphinx-data
directory
- specific explanation CLICK HERE
- For more keywords dictionary CLICK HERE
simply modify method beamforming
of class UCA
in scripts/beamforming/uca.py
# FILE: scripts/beamforming/uca.py
class UCA(object):
...
def beamforming(self, chunks):
...
for chunk in chunks:
##
# IMPLEMENT YOUR ALGORITHM FOLLOWING, GOOD LUCK!
##
...
...
Python3 in ROS
- https://www.cnblogs.com/h46incon/p/6207145.html
- https://github.com/OTL/cozmo_driver#super-hack-to-run-rospy-from-python3
Respeaker Microphone Array