Skip to content

Commit

Permalink
[CLI] Fix wrong output of controller states for load_controller com…
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich authored Feb 21, 2023
1 parent 3a09fb3 commit a676d3c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ros2controlcli/doc/userdoc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ load_controller
-h, --help show this help message and exit
--spin-time SPIN_TIME
Spin time in seconds to wait for discovery (only applies when not using an already running daemon)
--set_state {configured,active}
--set_state {inactive,active}
Set the state of the loaded controller
-c CONTROLLER_MANAGER, --controller-manager CONTROLLER_MANAGER
Name of the controller manager ROS node
Expand Down
4 changes: 2 additions & 2 deletions ros2controlcli/ros2controlcli/verb/load_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def add_arguments(self, parser, cli_name):
arg.completer = ControllerNameCompleter()
arg = parser.add_argument(
"--set-state",
choices=["configured", "active"],
choices=["inactive", "active"],
help="Set the state of the loaded controller",
)
add_controller_mgr_parsers(parser)
Expand Down Expand Up @@ -64,6 +64,6 @@ def main(self, *, args):

print(
f"Successfully loaded controller {args.controller_name} into "
f'state { "inactive" if args.set_state == "configure" else "active" }'
f'state { "inactive" if args.set_state == "inactive" else "active" }'
)
return 0
6 changes: 3 additions & 3 deletions ros2controlcli/ros2controlcli/verb/set_controller_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def main(self, *, args):
if not response.ok:
return "Error configuring controller, check controller_manager logs"

print(f"successfully configured {args.controller_name}")
print(f"Successfully configured {args.controller_name}")
return 0

elif matched_controller.state == "active":
Expand All @@ -84,7 +84,7 @@ def main(self, *, args):
if not response.ok:
return "Error stopping controller, check controller_manager logs"

print(f"successfully deactivated {args.controller_name}")
print(f"Successfully deactivated {args.controller_name}")
return 0

else:
Expand All @@ -109,5 +109,5 @@ def main(self, *, args):
if not response.ok:
return "Error activating controller, check controller_manager logs"

print(f"successfully activated {args.controller_name}")
print(f"Successfully activated {args.controller_name}")
return 0

0 comments on commit a676d3c

Please sign in to comment.