Skip to content

Commit eb47c40

Browse files
authored
Allow parameter changes while keeping defaults (#146)
* Made tree_kwargs changeable while keeping defaults * Don't restrict parameter updates to tree_kwargs * Change action_server_params to dict * Remove WatchdogLsitener params from default * Make sequences stored as lists by convention * Addressed PR comment * Addressed PR comments
1 parent 980c806 commit eb47c40

7 files changed

+490
-336
lines changed

.pylintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ good-names=a,
212212
ax,
213213
ex,
214214
hz,
215+
kw,
215216
ns,
216217
Run,
217218
_

ada_feeding/ada_feeding/trees/move_to_mouth_tree.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
# that they have similar code.
1010

1111
# Standard imports
12+
from collections.abc import Sequence
1213
import os
13-
from typing import Tuple
14+
from typing import Annotated, Tuple
1415

1516
# Third-party imports
1617
from ament_index_python.packages import get_package_share_directory
@@ -76,6 +77,8 @@ class MoveToMouthTree(MoveToTree):
7677
# pylint: disable=too-many-instance-attributes, too-many-arguments
7778
# Bite transfer is a big part of the robot's behavior, so it makes
7879
# sense that it has lots of attributes/arguments.
80+
# pylint: disable=dangerous-default-value
81+
# plan_distance_from_mouth must be a list because ROS params only supports lists.
7982

8083
def __init__(
8184
self,
@@ -90,7 +93,7 @@ def __init__(
9093
allowed_face_distance: Tuple[float, float] = (0.4, 1.25),
9194
face_detection_msg_timeout: float = 5.0,
9295
face_detection_timeout: float = 2.5,
93-
plan_distance_from_mouth: Tuple[float, float, float] = (0.025, 0.0, -0.01),
96+
plan_distance_from_mouth: Annotated[Sequence[float], 3] = [0.025, 0.0, -0.01],
9497
fork_target_orientation_from_mouth: Tuple[float, float, float, float] = (
9598
0.5,
9699
-0.5,

ada_feeding/config/ada_feeding_action_servers.yaml

Lines changed: 0 additions & 298 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# This file is auto-generated by create_action_servers.py
2+
ada_feeding_action_servers:
3+
ros__parameters:
4+
current:
5+
overridden_parameters:
6+
- ""

0 commit comments

Comments
 (0)