Skip to content

Commit

Permalink
[behaviours] eliminate more AUTO_GENERATED name defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
stonier committed Feb 9, 2023
1 parent e7644b3 commit db0248e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog

Forthcoming
-----------
* [behaviours] eliminate more arg name defaults, `#201 <https://github.com/splintered-reality/py_trees_ros/pull/201>`_
* ...

2.2.0 (2023-02-08)
Expand Down
8 changes: 4 additions & 4 deletions py_trees_ros/action_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ class FromBlackboard(py_trees.behaviour.Behaviour):
)
Args:
name: name of the behaviour
action_type: spec type for the action (e.g. move_base_msgs.action.MoveBase)
action_name: where you can find the action topics & services (e.g. "bob/move_base")
key: name of the key on the blackboard
name: name of the behaviour (default: lowercase class name)
generate_feedback_message: formatter for feedback messages, takes action_type.Feedback
messages and returns strings (default: None)
wait_for_server_timeout_sec: use negative values for a blocking but periodic check (default: -3.0)
Expand All @@ -93,10 +93,10 @@ class FromBlackboard(py_trees.behaviour.Behaviour):
usually be left up to the behaviour tree manager.
"""
def __init__(self,
name: str,
action_type: typing.Any,
action_name: str,
key: str,
name: str=py_trees.common.Name.AUTO_GENERATED,
generate_feedback_message: typing.Callable[[typing.Any], str]=None,
wait_for_server_timeout_sec: float=-3.0
):
Expand Down Expand Up @@ -370,10 +370,10 @@ class FromConstant(FromBlackboard):
.. see-also: :class:`py_trees_ros.action_clients.FromBlackboard`
Args:
name: name of the behaviour
action_type: spec type for the action (e.g. move_base_msgs.action.MoveBase)
action_name: where you can find the action topics & services (e.g. "bob/move_base")
action_goal: the goal to send
name: name of the behaviour (default: lowercase class name)
generate_feedback_message: formatter for feedback messages, takes action_type.Feedback
messages and returns strings (default: None)
wait_for_server_timeout_sec: use negative values for a blocking but periodic check (default: -3.0)
Expand All @@ -385,10 +385,10 @@ class FromConstant(FromBlackboard):
usually be left up to the behaviour tree manager.
"""
def __init__(self,
name: str,
action_type: typing.Any,
action_name: str,
action_goal: typing.Any,
name: str=py_trees.common.Name.AUTO_GENERATED,
generate_feedback_message: typing.Callable[[typing.Any], str]=None,
wait_for_server_timeout_sec: float=-3.0
):
Expand Down
4 changes: 2 additions & 2 deletions py_trees_ros/battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ class ToBlackboard(subscribers.ToBlackboard):
* battery_low_warning (:obj:`bool`)[w]: False if battery is ok, True if critically low
Args:
name: name of the behaviour
topic_name: name of the battery state topic
qos_profile: qos profile for the subscriber
name: name of the behaviour
threshold: percentage level threshold for flagging as low (0-100)
"""
def __init__(self,
name: str,
topic_name: str,
qos_profile: rclpy.qos.QoSProfile,
name: str=py_trees.common.Name.AUTO_GENERATED,
threshold: float=30.0):
super().__init__(name=name,
topic_name=topic_name,
Expand Down
4 changes: 2 additions & 2 deletions py_trees_ros/subscribers.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ class CheckData(Handler):
- fail_if_bad_comparison=True
Args:
name: name of the behaviour
topic_name: name of the topic to connect to
topic_type: class of the message type (e.g. :obj:`std_msgs.msg.String`)
qos_profile: qos profile for the subscriber
Expand All @@ -168,7 +169,6 @@ class CheckData(Handler):
comparison_operator: one from the python `operator module`_
fail_if_no_data: :attr:`~py_trees.common.Status.FAILURE` instead of :attr:`~py_trees.common.Status.RUNNING` if there is no data yet
fail_if_bad_comparison: :attr:`~py_trees.common.Status.FAILURE` instead of :attr:`~py_trees.common.Status.RUNNING` if comparison failed
name: name of the behaviour
clearing_policy: when to clear the data
.. tip::
Expand All @@ -180,6 +180,7 @@ class CheckData(Handler):
"""
def __init__(self,
name: str,
topic_name: str,
topic_type: typing.Any,
qos_profile: rclpy.qos.QoSProfile,
Expand All @@ -188,7 +189,6 @@ def __init__(self,
comparison_operator=operator.eq,
fail_if_no_data=False,
fail_if_bad_comparison=False,
name=py_trees.common.Name.AUTO_GENERATED,
clearing_policy=py_trees.common.ClearingPolicy.ON_INITIALISE
):
super(CheckData, self).__init__(
Expand Down
4 changes: 2 additions & 2 deletions py_trees_ros/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ class FromBlackboard(py_trees.behaviour.Behaviour):
"""
def __init__(
self,
name: str,
variable_name: str,
target_frame: str,
source_frame: str,
static: bool,
qos_profile: rclpy.qos.QoSProfile,
static_qos_profile: rclpy.qos.QoSProfile=None,
name: str=py_trees.common.Name.AUTO_GENERATED,
):
super().__init__(name=name)
self.blackboard = self.attach_blackboard_client(name)
Expand Down Expand Up @@ -170,13 +170,13 @@ class ToBlackboard(py_trees.behaviour.Behaviour):
"""
def __init__(
self,
name: str,
variable_name,
target_frame: str,
source_frame: str,
qos_profile: rclpy.qos.QoSProfile,
static_qos_profile: rclpy.qos.QoSProfile=None,
clearing_policy: py_trees.common.ClearingPolicy=py_trees.common.ClearingPolicy.ON_INITIALISE,
name: str=py_trees.common.Name.AUTO_GENERATED,
):
super().__init__(name=name)
self.variable_name = variable_name
Expand Down

0 comments on commit db0248e

Please sign in to comment.