Skip to content

Commit

Permalink
Allow parameter changes while keeping defaults (#146)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
amalnanavati authored Dec 23, 2023
1 parent 980c806 commit eb47c40
Show file tree
Hide file tree
Showing 7 changed files with 490 additions and 336 deletions.
1 change: 1 addition & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ good-names=a,
ax,
ex,
hz,
kw,
ns,
Run,
_
Expand Down
7 changes: 5 additions & 2 deletions ada_feeding/ada_feeding/trees/move_to_mouth_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
# that they have similar code.

# Standard imports
from collections.abc import Sequence
import os
from typing import Tuple
from typing import Annotated, Tuple

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

def __init__(
self,
Expand All @@ -90,7 +93,7 @@ def __init__(
allowed_face_distance: Tuple[float, float] = (0.4, 1.25),
face_detection_msg_timeout: float = 5.0,
face_detection_timeout: float = 2.5,
plan_distance_from_mouth: Tuple[float, float, float] = (0.025, 0.0, -0.01),
plan_distance_from_mouth: Annotated[Sequence[float], 3] = [0.025, 0.0, -0.01],
fork_target_orientation_from_mouth: Tuple[float, float, float, float] = (
0.5,
-0.5,
Expand Down
298 changes: 0 additions & 298 deletions ada_feeding/config/ada_feeding_action_servers.yaml

This file was deleted.

6 changes: 6 additions & 0 deletions ada_feeding/config/ada_feeding_action_servers_current.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This file is auto-generated by create_action_servers.py
ada_feeding_action_servers:
ros__parameters:
current:
overridden_parameters:
- ""
Loading

0 comments on commit eb47c40

Please sign in to comment.