Browse Source

Added comments about functions and fixed typos.

pull/14/head
Alan G. Sanchez 2 years ago
parent
commit
2b6af80347
7 changed files with 17 additions and 17 deletions
  1. +2
    -2
      src/avoider.py
  2. +2
    -2
      src/joint_state_printer.py
  3. +4
    -4
      src/marker.py
  4. +1
    -1
      src/move.py
  5. +3
    -3
      src/multipoint_command.py
  6. +2
    -2
      src/scan_filter.py
  7. +3
    -3
      src/stow_command.py

+ 2
- 2
src/avoider.py View File

@ -18,8 +18,8 @@ class Avoider:
"""
def __init__(self):
"""
Function that initializes the subsriber, publisher, and marker features.
:param self: The self reference
Function that initializes the subscriber, publisher, and marker features.
:param self: The self reference.
"""
# Set up a publisher and a subscriber. We're going to call the subscriber
# "scan", and filter the ranges similar to what we did in example 2.

+ 2
- 2
src/joint_state_printer.py View File

@ -24,7 +24,7 @@ class JointStatePublisher():
def callback(self, msg):
"""
Callback function to deal with the incoming JointState messages.
:param self: The self reference
:param self: The self reference.
:param msg: The JointState message.
"""
# Store th joint messages for later use
@ -35,7 +35,7 @@ class JointStatePublisher():
"""
print_states function to deal with the incoming JointState messages.
:param self: The self reference.
:param joints: A list of joint names
:param joints: A list of joint names.
"""
# Create an empty list that will store the positions of the requested joints
joint_positions = []

+ 4
- 4
src/marker.py View File

@ -12,8 +12,8 @@ class Balloon():
"""
def __init__(self):
"""
Function that initializes the markers features.
:param self: The self reference
Function that initializes the marker's features.
:param self: The self reference.
"""
# Set up a publisher. We're going to publish on a topic called balloon.
self.pub = rospy.Publisher('balloon', Marker, queue_size=10)
@ -61,9 +61,9 @@ class Balloon():
def publish_marker(self):
"""
Function that publishes the sphere marker
:param self: The self reference
:param self: The self reference.
:publishes self.marker: Marker message
:publishes self.marker: Marker message.
"""
# publisher the marker
self.pub.publish(self.marker)

+ 1
- 1
src/move.py View File

@ -12,7 +12,7 @@ class Move:
"""
def __init__(self):
"""
Function that initializes the subsriber.
Function that initializes the publisher.
:param self: The self reference
"""
# Setup a publisher that will send the velocity commands for the Stretch

+ 3
- 3
src/multipoint_command.py View File

@ -27,7 +27,7 @@ class MultiPointCommand(hm.HelloNode):
def issue_multipoint_command(self):
"""
Function that makes an action call and sends multiple joint trajectory goals.
:param self: The self reference
:param self: The self reference.
"""
# Set point0 as a JointTrajectoryPoint().
point0 = JointTrajectoryPoint()
@ -88,8 +88,8 @@ class MultiPointCommand(hm.HelloNode):
# and issue the stow command.
def main(self):
"""
Function that initiates the multipoint_command function
:param self: The self reference
Function that initiates the multipoint_command function.
:param self: The self reference.
"""
# The arguments of the main function of the hm.HelloNode class are the
# node_name, node topic namespace, and boolean (default value is true).

+ 2
- 2
src/scan_filter.py View File

@ -9,8 +9,8 @@ from sensor_msgs.msg import LaserScan
class Scanfilter:
"""
A class that implements a LaserScan filter that removes all of the points
that are not infront of the robot
A class that implements a LaserScan filter that removes all of the points.
that are not infront of the robot.
"""
def __init__(self):
# We're going to assume that the robot is pointing up the x-axis, so that

+ 3
- 3
src/stow_command.py View File

@ -27,7 +27,7 @@ class StowCommand(hm.HelloNode):
def issue_stow_command(self):
'''
Function that makes an action call and sends stow postion goal.
:param self: The self reference
:param self: The self reference.
'''
# Set stow_point as a JointTrajectoryPoint().
stow_point = JointTrajectoryPoint()
@ -60,8 +60,8 @@ class StowCommand(hm.HelloNode):
# and issue the stow command.
def main(self):
'''
Function that initiates stow_command function
:param self: The self reference
Function that initiates stow_command function.
:param self: The self reference.
'''
# The arguments of the main function of the hm.HelloNode class are the
# node_name, node topic namespace, and boolean (default value is true).

Loading…
Cancel
Save