Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Document Python code.

  • Loading branch information...
commit 5b04fab1cbdd68d74d9a8e90092ec1aaec06af7a 1 parent e303e2c
@thomas-moulard thomas-moulard authored
View
4 halfsteps_pattern_generator/src/halfsteps_pattern_generator/GetPathClient.py
@@ -8,6 +8,10 @@
import halfsteps_pattern_generator.srv
class HalfStepPatternGeneratorClient(Client):
+ """
+ GetPath client for the half-step pattern generator client.
+ """
+
def __init__(self):
Client.__init__(
self,
View
48 walk_msgs/src/walk_msgs/GetPathClient.py
@@ -7,23 +7,60 @@
import walk_msgs.srv
class Client(object):
+ """
+ Generic GetPath client.
+
+ We make here the assumption that all GetPath services are
+ compatible in the sense that they provide /at least/ the fields of
+ the walk_msgs.GetPath service message.
+
+ This class can then be inherited to add algorithm specific
+ behaviors.
+ """
+
client = None
+ """ROS GetPath service client."""
+
serviceType = None
+ """ROS service type."""
+
serviceName = None
+ """Service name."""
+
initial_left_foot_position = None
+ """Initial left foot position (Pose)."""
+
initial_right_foot_position = None
+ """Initial right foot position (Pose)."""
+
initial_center_of_mass_position = None
+ """Initial center of mass position (3d point)."""
+
final_left_foot_position = None
+ """Final left foot position (Pose)."""
final_right_foot_position = None
+ """Final right foot position (Pose)."""
final_center_of_mass_position = None
+ """Final center of mass position (3d point)."""
start_with_left_foot = None
+ """Which foot is the first flying foot?"""
footprints = None
+ """
+ List of footprints.
+
+ The footprint type can vary depending on the used pattern
+ generator. You have to make sure that the footprint type you use
+ is the one that the used GetPath service expects.
+ """
@staticmethod
def identityPose():
+ """
+ Generate an identity pose.
+ """
pose = Pose()
pose.position.x = 0.
pose.position.y = 0.
@@ -39,6 +76,11 @@ def identityPose():
def __init__(self,
serviceType = walk_msgs.srv.GetPath,
serviceName = 'getPath'):
+ """
+ Initialize the class and create the proxy to call the service.
+
+ This will hang as long as the service is not available.
+ """
self.serviceType = serviceType
self.serviceName = serviceName
rospy.wait_for_service(serviceName)
@@ -54,6 +96,12 @@ def __init__(self,
def __call__(self):
+ """
+ Call the service and return the computed paths.
+
+ This will trigger the trajectory generation in the generator
+ node.
+ """
response = self.client(
self.initial_left_foot_position,
self.initial_right_foot_position,
Please sign in to comment.
Something went wrong with that request. Please try again.