Skip to content

Commit

Permalink
Add TODO, broken attempt at optional parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
ggoretkin-bdai committed Dec 4, 2023
1 parent 4823531 commit 2c275c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions spot_driver/launch/spot_driver.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ def launch_setup(context: LaunchContext, ld: LaunchDescription) -> None:

if not mock_enable:
# Get parameters from Spot.

# TODO this deviates from the `get_from_env_and_fall_back_to_param` logic in `spot_ros2.py`,
# which would pull in values in `config_file`
username = os.getenv("BOSDYN_CLIENT_USERNAME", "username")
password = os.getenv("BOSDYN_CLIENT_PASSWORD", "password")
hostname = os.getenv("SPOT_IP", "hostname")
Expand Down Expand Up @@ -160,7 +161,8 @@ def launch_setup(context: LaunchContext, ld: LaunchDescription) -> None:
spot_driver_params = {
"spot_name": spot_name,
"mock_enable": mock_enable,
"mock_has_arm": mock_has_arm,
# Use a list to express optional boolean. Valid values are `[]`, `[True]` and `[False]`
"mock_has_arm": [mock_has_arm] if mock_enable else [],
"publish_depth_registered": False,
"publish_depth": False,
"publish_rgb": False,
Expand Down
3 changes: 2 additions & 1 deletion spot_driver/spot_driver/spot_ros2.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ def __init__(self, parameter_list: Optional[typing.List[Parameter]] = None, **kw

self.declare_parameter("spot_name", "")
self.declare_parameter("mock_enable", False)
self.declare_parameter("mock_has_arm", True)
# Use a list to express optional boolean. Valid values are `[]`, `[True]` and `[False]`
self.declare_parameter("mock_has_arm", [])

# used for setting when not using launch file
if parameter_list is not None:
Expand Down

0 comments on commit 2c275c2

Please sign in to comment.