Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applied pycodestyle (pep8) using autopep with "--aggresive" #1

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion skiros2_std_reasoners/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
# ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD

from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion skiros2_std_reasoners/test/test
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ if __name__ == '__main__':
print("========= TEST WITH DOCTEST ===========")
if True:
print("========= Testing Aau spatial reasoner =========")
doctest.testmod(aau_spatial_reasoner, verbose=False)
doctest.testmod(aau_spatial_reasoner, verbose=False)
2 changes: 1 addition & 1 deletion skiros2_std_skills/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
# ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD

from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import rospy
import Queue


class PrimitiveActionClient(PrimitiveBase):
"""
@brief Base class for skills based on a action server.
Expand All @@ -29,18 +30,18 @@ def onStart(self):
if not self.client.wait_for_server(rospy.Duration(0.5)):
log.error("[{}]".format(self._label), "Action server {} is not available.".format(self.client.action_client.ns))
return False
self.client.send_goal(self.buildGoal(), done_cb= self._doneCb, feedback_cb = self._feedbackCb)
self.client.send_goal(self.buildGoal(), done_cb=self._doneCb, feedback_cb=self._feedbackCb)
return True

def restart(self, goal, text="Restarting action."):
self._done = None
self.client.send_goal(goal, done_cb= self._doneCb, feedback_cb = self._feedbackCb)
self.client.send_goal(goal, done_cb=self._doneCb, feedback_cb=self._feedbackCb)
return self.step(text)

def execute(self):
if not self.q.empty():
msg = self.q.get(False)
if self._done != None:
if self._done is not None:
return self.onDone(self._done, msg)
else:
return self.onFeedback(msg)
Expand Down Expand Up @@ -94,13 +95,13 @@ def onFeedback(self, msg):
@brief To override. Called every time a new feedback msg is received.
@return Can return self.success, self.fail or self.step
"""
#Do something with feedback msg
# Do something with feedback msg
return self.step("")

def onDone(self, status, msg):
"""
@brief To override. Called when goal is achieved.
@return self.success or self.fail
"""
#Do something with result msg
# Do something with result msg
return self.success("Finished. State: {} Result: {}".format(status, msg))
12 changes: 9 additions & 3 deletions skiros2_std_skills/src/skiros2_std_skills/task_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
from skiros2_skill.ros.utils import deserialize_skill
import skiros2_common.tools.logger as log


class TaskPlan(SkillDescription):
"""
"""

def createDescription(self):
#=======Params=========
self.addParam("Goal", str, ParamTypes.Required)
#self.addParam("TaskPlan", "", ParamTypes.Required)


class task_plan(SkillBase):
def createDescription(self):
self.setDescription(TaskPlan(), self.__class__.__name__)
Expand Down Expand Up @@ -49,9 +52,9 @@ def _add_children(self, skill, children):
def execute(self):
if self._action_status is None:
return self.step("Planning...")
elif self._action_status==1:
elif self._action_status == 1:
return self.fail(self._action_msg, -self._action_status)
elif self._action_status==2:
elif self._action_status == 2:
return self.success(self._action_msg)
elif self._skill_to_expand:
task = deserialize_skill(self._action_msg)
Expand All @@ -62,13 +65,16 @@ def execute(self):
else:
super(SkillBase, self).execute()


class DynamicTree(SkillDescription):
"""
"""

def createDescription(self):
#=======Params=========
self.addParam("TaskPlan", str, ParamTypes.Required)


class dynamic_tree(SkillBase):
def createDescription(self):
self.setDescription(DynamicTree(), self.__class__.__name__)
Expand All @@ -90,4 +96,4 @@ def execute(self):
if not self.children:
return self.success("No skills to execute.")
else:
super(SkillBase, self).execute()
super(SkillBase, self).execute()