Sensors & Effectors/Sensors

[ROS Melodic] Mic Array

jstar0525 2021. 8. 3. 20:02
반응형

Revise from

https://github.com/furushchev/respeaker_ros

 

GitHub - furushchev/respeaker_ros: A ROS Package for Respeaker Mic Array

A ROS Package for Respeaker Mic Array. Contribute to furushchev/respeaker_ros development by creating an account on GitHub.

github.com

 

 

 

respeaker_ros

A ROS Package for Respeaker Mic Array

 

 

Supported Devices

Respeaker Mic Array v2.0

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

 

[Mic Array] respeaker (6 or 1 channel mic and direction)

6채널 또는 1채널의 마이크 입력 소리가 발생하는 방향을 알 수 있음 (아래의 프로그램을 활용, resoultion : 1 degree) Update Firmware Firmware Channels Note 1_channel_firmware.bin 1 processed audio for..

jstar0525.tistory.com

 

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

 

respeaker /sound_direction

 

 

ref.

https://github.com/jstar0525/respeaker_ros/blob/master/README.md

 

GitHub - jstar0525/respeaker_ros: A ROS Package for Respeaker Mic Array

A ROS Package for Respeaker Mic Array. Contribute to jstar0525/respeaker_ros development by creating an account on GitHub.

github.com

 

반응형