반응형
Revise from
https://github.com/furushchev/respeaker_ros
respeaker_ros
A ROS Package for Respeaker Mic Array
Supported Devices
Preparation
1. Install reaspeaker
Update Firmware
$ sudo apt-get update
$ sudo apt-get install python-usb
$ sudo pip install pyusb click
$ cd ~
$ git clone https://github.com/jstar0525/usb_4_mic_array.git
$ cd usb_4_mic_array
$ sudo python dfu.py --download 6_channels_firmware.bin # The 6 channels version
# if you want to use 1 channel,then the command should be like:
$ sudo python dfu.py --download 1_channel_firmware.bin
Tuning
$ cd ~/usb_4_mic_array
$ python tuning.py -p
DOA (Direction of Arrival)
$ cd ~/usb_4_mic_array
$ sudo python doa.py
Extract Voice
$ sudo apt-get install portaudio19-dev python-pyaudio
$ sudo pip install pyaudio
$ cd ~/usb_4_mic_array
$ python get_idx.py
ref : https://jstar0525.tistory.com/103
2. Install this package
$ mkdir -p ~/catkin_ws/src && cd ~/catkin_ws/src
$ git clone https://github.com/jstar0525/respeaker_ros.git
3. Install python requirements
$ cd ~/catkin_ws/src/respeaker_ros
$ sudo pip install -r requirements.txt
4. Build this package from source
$ cd ~/catkin_ws
$ source /opt/ros/melodic/setup.bash
$ rosdep install --from-paths src -i -r -n -y
$ sudo apt-get install ros-melodic-catkin-virtualenv
$ catkin_make
$ source ~/catkin_ws/devel/setup.bash
5. Register respeaker udev rules
Normally, we cannot access USB device without permission from user space. Using udev, we can give the right permission on only respeaker device automatically.
Please run the command as followings to install setting file:
$ roscd respeaker_ros
$ sudo cp -f $(rospack find respeaker_ros)/config/60-respeaker.rules /etc/udev/rules.d/60-respeaker.rules
$ sudo systemctl restart udev
And then re-connect the device.
6. Update firmware
$ git clone https://github.com/respeaker/usb_4_mic_array.git
$ cd ~/usb_4_mic_array
$ sudo python dfu.py --download 6_channels_firmware.bin # The 6 channels version
How to use
1. Run executable
$ source /opt/ros/melodic/setup.bash
$ source ~/catkin_ws/devel/setup.bash
$ roscore
$ source /opt/ros/melodic/setup.bash
$ source /home/user/catkin_ws/devel/setup.bash
$ rosrun respeaker_ros respeaker_node.py
# Check Ros topic
$ source /opt/ros/melodic/setup.bash
$ source ~/catkin_ws/devel/setup.bash
$ rostopic echo /sound_direction # Result of DoA
$ rostopic echo /sound_localization # Result of DoA as Pose
$ rostopic echo /is_speeching # Result of VAD
$ rostopic echo /audio # Raw audio
ref.
https://github.com/jstar0525/respeaker_ros/blob/master/README.md
반응형