Skip to content

hello-binit/respeaker_ros2

Repository files navigation

respeaker_ros2

A ROS 2 Package for Respeaker Mic Array

Supported Devices

Preparation

  1. Install this package

    mkdir -p ~/ament_ws/src && ~/ament_ws/src
    git clone https://github.com/hello-chintan/respeaker_ros2.git
    git clone https://github.com/hello-chintan/audio_common.git
    cd ~/ament_ws
    source /opt/ros/iron/setup.bash
    rosdep install --from-paths src --ignore-src -i -r -n -y
    colcon build
    source install/setup.bash
  2. 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:

    cd ~/ament_ws/src/respeaker_ros2
    sudo cp -f ~/ament_ws/src/respeaker_ros2/config/60-respeaker.rules /etc/udev/rules.d/60-respeaker.rules
    sudo systemctl restart udev

    And then re-connect the device.

  3. Install python requirements

    cd ~/ament_ws/src/respeaker_ros2
    sudo pip install -r requirements.txt
  4. 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 executables

    ros2 launch respeaker_ros2 respeaker.launch
    ros2 topic echo /sound_direction     # Result of DoA
    ros2 topic echo /sound_localization  # Result of DoA as Pose
    ros2 topic echo /is_speeching        # Result of VAD
    ros2 topic echo /audio               # Raw audio
    ros2 topic echo /speech_audio        # Audio data while speeching

    To set LED color, publish desired color:

    ros2 topic pub /status_led std_msgs/msg/ColorRGBA "r: 0.0
    g: 0.0
    b: 1.0
    a: 0.3"

Use cases

Voice Recognition

Notes

The configuration file for dynamic_reconfigure in this package is created automatically by reading the parameters from devices. Though it will be rare case, the configuration file can be updated as followings:

  1. Connect the device to the computer.

  2. Run the generator script.

    rosrun  respeaker_ros respeaker_gencfg.py
  3. You will see the updated configuration file at $(rospack find respeaker_ros)/cfg/Respeaker.cfg.

Author

Yuki Furuta <[email protected]>

License

Apache License

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages