Browse Source

Included further details in the comments.

main
Alan G. Sanchez 2 years ago
parent
commit
f290c6e1be
6 changed files with 22 additions and 18 deletions
  1. +1
    -1
      example_11.md
  2. +2
    -2
      example_12.md
  3. +8
    -6
      example_9.md
  4. +1
    -1
      src/aruco_tag_locator.py
  5. +1
    -1
      src/pointcloud_transformer.py
  6. +9
    -7
      src/voice_teleoperation_base.py

+ 1
- 1
example_11.md View File

@ -93,7 +93,7 @@ class PointCloudTransformer:
:param self: The self reference. :param self: The self reference.
:param msg: The PointCloud message. :param msg: The PointCloud message.
:returns new_cloud: PointCloud message.
:returns new_cloud: The transformed PointCloud message.
""" """
while not rospy.is_shutdown(): while not rospy.is_shutdown():
try: try:

+ 2
- 2
example_12.md View File

@ -144,7 +144,7 @@ class LocateArUcoTag(hm.HelloNode):
:param self: The self reference. :param self: The self reference.
:param tag_name: A string value of the ArUco marker name. :param tag_name: A string value of the ArUco marker name.
:returns transform: A TransformStamped message type.
:returns transform: The docking station's TransformStamped message.
""" """
pan_command = {'joint': 'joint_head_pan', 'position': self.min_pan_position} pan_command = {'joint': 'joint_head_pan', 'position': self.min_pan_position}
self.send_command(pan_command) self.send_command(pan_command)
@ -321,7 +321,7 @@ def find_tag(self, tag_name='docking_station'):
:param self: The self reference. :param self: The self reference.
:param tag_name: A string value of the ArUco marker name. :param tag_name: A string value of the ArUco marker name.
:returns transform: A TransformStamped message type.
:returns transform: The docking station's TransformStamped message.
""" """
pan_command = {'joint': 'joint_head_pan', 'position': self.min_pan_position} pan_command = {'joint': 'joint_head_pan', 'position': self.min_pan_position}
self.send_command(pan_command) self.send_command(pan_command)

+ 8
- 6
example_9.md View File

@ -98,16 +98,17 @@ class GetVoiceCommands:
def callback_direction(self, msg): def callback_direction(self, msg):
""" """
A callback function that converts the sound direction from degrees to radians.
A callback function that converts the incoming message, sound direction,
from degrees to radians.
:param self: The self reference. :param self: The self reference.
:param msg: The Int32 message type.
:param msg: The Int32 message type that represents the sound direction.
""" """
self.sound_direction = msg.data * -self.rad_per_deg self.sound_direction = msg.data * -self.rad_per_deg
def callback_speech(self,msg): def callback_speech(self,msg):
""" """
A callback function that takes all items in the iterable list and join
them into a single string.
A callback function takes the incoming message, a list of the speech to
text, and joins all items in that iterable list into a single string.
:param self: The self reference. :param self: The self reference.
:param msg: The SpeechRecognitionCandidates message type. :param msg: The SpeechRecognitionCandidates message type.
""" """
@ -119,7 +120,7 @@ class GetVoiceCommands:
base motion. base motion.
:param self:The self reference. :param self:The self reference.
:returns inc: A dictionary type.
:returns inc: A dictionary type the contains the increment size.
""" """
if self.step_size == 'small': if self.step_size == 'small':
inc = {'rad': self.small_rad, 'translate': self.small_translate} inc = {'rad': self.small_rad, 'translate': self.small_translate}
@ -159,7 +160,7 @@ class GetVoiceCommands:
A function that defines the teleoperation command based on the voice command. A function that defines the teleoperation command based on the voice command.
:param self: The self reference. :param self: The self reference.
:returns command: A dictionary type.
:returns command: A dictionary type that contains the type of base motion.
""" """
command = None command = None
if self.voice_command == 'forward': if self.voice_command == 'forward':
@ -192,6 +193,7 @@ class VoiceTeleopNode(hm.HelloNode):
""" """
A function that declares object from the GetVoiceCommands class, instantiates A function that declares object from the GetVoiceCommands class, instantiates
the HelloNode class, and set the publishing rate. the HelloNode class, and set the publishing rate.
:param self: The self reference.
""" """
hm.HelloNode.__init__(self) hm.HelloNode.__init__(self)
self.rate = 10.0 self.rate = 10.0

+ 1
- 1
src/aruco_tag_locator.py View File

@ -130,7 +130,7 @@ class LocateArUcoTag(hm.HelloNode):
:param self: The self reference. :param self: The self reference.
:param tag_name: A string value of the ArUco marker name. :param tag_name: A string value of the ArUco marker name.
:returns transform: A TransformStamped message type.
:returns transform: The docking station's TransformStamped message.
""" """
# Create dictionaries to get the head in its initial position # Create dictionaries to get the head in its initial position
pan_command = {'joint': 'joint_head_pan', 'position': self.min_pan_position} pan_command = {'joint': 'joint_head_pan', 'position': self.min_pan_position}

+ 1
- 1
src/pointcloud_transformer.py View File

@ -74,7 +74,7 @@ class PointCloudTransformer:
:param self: The self reference. :param self: The self reference.
:param msg: The PointCloud message. :param msg: The PointCloud message.
:returns new_cloud: PointCloud message.
:returns new_cloud: The transformed PointCloud message.
""" """
while not rospy.is_shutdown(): while not rospy.is_shutdown():
try: try:

+ 9
- 7
src/voice_teleoperation_base.py View File

@ -69,16 +69,17 @@ class GetVoiceCommands:
def callback_direction(self, msg): def callback_direction(self, msg):
""" """
A callback function that converts the sound direction from degrees to radians.
A callback function that converts the incoming message, sound direction,
from degrees to radians.
:param self: The self reference. :param self: The self reference.
:param msg: The Int32 message type.
:param msg: The Int32 message type that represents the sound direction.
""" """
self.sound_direction = msg.data * -self.rad_per_deg self.sound_direction = msg.data * -self.rad_per_deg
def callback_speech(self,msg): def callback_speech(self,msg):
""" """
A callback function that takes all items in the iterable list and join
them into a single string.
A callback function takes the incoming message, a list of the speech to
text, and joins all items in that iterable list into a single string.
:param self: The self reference. :param self: The self reference.
:param msg: The SpeechRecognitionCandidates message type. :param msg: The SpeechRecognitionCandidates message type.
""" """
@ -90,7 +91,7 @@ class GetVoiceCommands:
base motion. base motion.
:param self:The self reference. :param self:The self reference.
:returns inc: A dictionary type.
:returns inc: A dictionary type the contains the increment size.
""" """
if self.step_size == 'small': if self.step_size == 'small':
inc = {'rad': self.small_rad, 'translate': self.small_translate} inc = {'rad': self.small_rad, 'translate': self.small_translate}
@ -130,7 +131,7 @@ class GetVoiceCommands:
A function that defines the teleoperation command based on the voice command. A function that defines the teleoperation command based on the voice command.
:param self: The self reference. :param self: The self reference.
:returns command: A dictionary type.
:returns command: A dictionary type that contains the type of base motion.
""" """
command = None command = None
# Move base forward command # Move base forward command
@ -181,6 +182,7 @@ class VoiceTeleopNode(hm.HelloNode):
""" """
A function that declares object from the GetVoiceCommands class, instantiates A function that declares object from the GetVoiceCommands class, instantiates
the HelloNode class, and set the publishing rate. the HelloNode class, and set the publishing rate.
:param self: The self reference.
""" """
hm.HelloNode.__init__(self) hm.HelloNode.__init__(self)
self.rate = 10.0 self.rate = 10.0
@ -199,7 +201,7 @@ class VoiceTeleopNode(hm.HelloNode):
""" """
Function that makes an action call and sends base joint trajectory goals. Function that makes an action call and sends base joint trajectory goals.
:param self: The self reference. :param self: The self reference.
:param command: A dictionary type.
:param command: A dictionary that contains the base motion type and increment size.
""" """
joint_state = self.joint_state joint_state = self.joint_state
# Conditional statement to send joint trajectory goals # Conditional statement to send joint trajectory goals

Loading…
Cancel
Save