Skip to content

Commit

Permalink
Merge pull request #162 from cdellin/master
Browse files Browse the repository at this point in the history
Add superclass call to planners, and ensure serialized transform is floats.
  • Loading branch information
mkoval committed Aug 10, 2015
2 parents 5e13227 + 02e38bd commit ab7e56c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/prpy/planning/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,14 @@ def get_planning_method_names(self):

class BasePlanner(Planner):
def __init__(self):
super(BasePlanner, self).__init__()
self.env = openravepy.Environment()

class MetaPlanner(Planner):
__metaclass__ = abc.ABCMeta

def __init__(self):
super(MetaPlanner, self).__init__()
self._planners = list()

def has_planning_method(self, method_name):
Expand Down Expand Up @@ -216,6 +218,7 @@ def meta_wrapper(*args, **kw_args):

class Sequence(MetaPlanner):
def __init__(self, *planners):
super(Sequence, self).__init__()
self._planners = planners

def __str__(self):
Expand Down Expand Up @@ -259,6 +262,7 @@ def plan(self, method, args, kw_args):

class Ranked(MetaPlanner):
def __init__(self, *planners):
super(Ranked, self).__init__()
self._planners = planners

def __str__(self):
Expand Down Expand Up @@ -328,6 +332,7 @@ def call_planner(index, planner):

class FirstSupported(MetaPlanner):
def __init__(self, *planners):
super(FirstSupported, self).__init__()
self._planners = planners

def __str__(self):
Expand All @@ -352,6 +357,7 @@ def plan(self, method, args, kw_args):

class MethodMask(MetaPlanner):
def __init__(self, planner, methods):
super(MethodMask, self).__init__()
self._methods = set(methods)
self._planner = planner
self._planners = [planner]
Expand Down
4 changes: 2 additions & 2 deletions src/prpy/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ def serialize_transform(t):
from openravepy import quatFromRotationMatrix

return {
'position': list(t[0:3, 3]),
'orientation': list(quatFromRotationMatrix(t[0:3, 0:3])),
'position': list(map(float,t[0:3, 3])),
'orientation': list(map(float,quatFromRotationMatrix(t[0:3, 0:3]))),
}

# Deserialization.
Expand Down

0 comments on commit ab7e56c

Please sign in to comment.