All pages
Powered by GitBook
1 of 2

Loading...

Loading...

talker-node.md

Overview

This week, we built a ROS node that subscribes to a new topic, /things_to_say, and uses a text-to-speech service to make the computer speak the messages of type std_msgs/String.

Prerequisite

If you receive an error when you try to run this node, the computer likely does not have pyttsx installed. To install it, simply run pip install pyttsx --user.

If that command fails, the computer likely does not have pip installed. To install it, run sudo apt-get install python-pip and then attempt the pyttsx install again.

Running the node

To run the node, run rosrun cr_ros talk.py

Making it talk

Once the node is launched, publish a String to the /things_to_say topic from any device connected to the same ROS core as the node.

Sample standalone command: rostopic pub /things_to_say std_msgs/String 'Kill all humans'

Sample Python script:

Ari Carr and Ben Albert 10/31/2018

import rospy
from std_msgs import String

pub = rospy.Publisher('/things_to_say', String, queue_size=1)
rospy.init_node('say_something')
pub.publish('Kill all humans')

package-delivery

Related Nodes

  • package_handler.py

  • package_sender.py

  • recording_sender.py

Overview

The package delivery stack is comprised of one main node, package_handler.py, and two secondary nodes package_sender.py and recording_sender.py. Each secondary node corresponds to a type of package that can be handled by the handler (the current implementation supports physical packages on top of the robot, and voice recordings recorded on the on-board laptop. Each secondary node (when pinged on its respective topic) generates a file with a specific suffix (.package and .wav respectively) that will be processed accordingly by the package handler. Each file type has an associated package release protocol, which removes the package filename from the packages queue (maintained by the handler node).

Demo

  • Run recording_sender.py on-board (so computer microphone is accessed)

  • Run package_handler.py and package_sender.py

  • After navigating to the package sender (wait for WAITING state) place package on the robot

Ben Albert 12/16/18

After being prompted, hold down B0, B1, or B2 on the robot's base to record a message

  • Send the robot a delivery navigation goal

  • Once the robot has reached the goal (wait for WAITING state) pick up the package. The robot will also play back the audio recording

  • After the