You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.3 KiB

  1. # ReSpeaker Microphone Array
  2. For this tutorial, we will get a high-level view of how to use Stretch's [ReSpeaker Mic Array v2.0](https://wiki.seeedstudio.com/ReSpeaker_Mic_Array_v2.0/).
  3. <p align="center">
  4. <img src="https://raw.githubusercontent.com/hello-robot/stretch_tutorials/noetic/images/respeaker.jpg"/>
  5. </p>
  6. ## Stretch Body Package
  7. In this section we will use command line tools in the [Stretch_Body](https://github.com/hello-robot/stretch_body) package, a low-level Python API for Stretch's hardware, to directly interact with the ReSpeaker.
  8. Begin by typing the following command in a new terminal.
  9. ```{.bash .shell-prompt}
  10. stretch_respeaker_test.py
  11. ```
  12. The following will be displayed in your terminal:
  13. ```{.bash .no-copy}
  14. For use with S T R E T C H (TM) RESEARCH EDITION from Hello Robot Inc.
  15. * waiting for audio...
  16. * recording 3 seconds
  17. * done
  18. * playing audio
  19. * done
  20. ```
  21. The ReSpeaker Mico Array will wait until it hears audio loud enough to trigger its recording feature. Stretch will record audio for 3 seconds and then replay it through its speakers. This command line is a good method to see if the hardware is working correctly.
  22. To stop the python script, type `Ctrl` + `c` in the terminal.
  23. ## ReSpeaker_ROS Package
  24. A [ROS package for the ReSpeaker](https://index.ros.org/p/respeaker_ros/#melodic) is utilized for this section.
  25. Begin by running the `sample_respeaker.launch.py` file in a terminal.
  26. ```{.bash .shell-prompt}
  27. ros2 launch respeaker_ros2 respeaker.launch.py
  28. ```
  29. This will bring up the necessary nodes that will allow the ReSpeaker to implement a voice and sound interface with the robot.
  30. ## ReSpeaker Topics
  31. Below are executables you can run to see the ReSpeaker results.
  32. ```{.bash .shell-prompt}
  33. ros2 topic echo /sound_direction
  34. ros2 topic echo /sound_localization
  35. ros2 topic echo /is_speeching
  36. ros2 topic echo /audio
  37. ros2 topic echo /speech_audio
  38. ros2 topic echo /speech_to_text
  39. ```
  40. There's also another topic called `/status_led`, with this topic you can change the color of the LEDs in the ReSpeaker, you need to publish the desired color in the terminal using `ros2 topic pub`. We will explore this topics in the next tutorial.
  41. You can also set various parameters via `dynamic_reconfigure` by running the following command in a new terminal.
  42. ```{.bash .shell-prompt}
  43. ros2 run rqt_reconfigure rqt_reconfigure
  44. ```