Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rqt_joint_trajectory_controller crashes if former selected controller_manager is not available #1136

Open
christophfroehlich opened this issue May 18, 2024 · 0 comments
Labels

Comments

@christophfroehlich
Copy link
Contributor

Describe the bug
rqt_joint_trajectory_controller crashes if former selected controller_manager is not available

To Reproduce
Steps to reproduce the behavior:

  1. Launch a robot, e.g., ros2 launch ros2_control_demo_example_1 rrbot.launch.py and activate JTC
  2. ros2 run rqt_joint_trajectory_controller rqt_joint_trajectory_controller, select the JTC.
  3. Close all.
  4. Run ros2 run rqt_joint_trajectory_controller rqt_joint_trajectory_controller, it crashes:
IndexError: list index out of range

Traceback (most recent call last):
  File "/workspaces/ros2_rolling_ws/build/rqt_joint_trajectory_controller/rqt_joint_trajectory_controller/joint_trajectory_controller.py", line 229, in _update_cm_list
    update_combo(self._widget.cm_combo, self._list_cm())
                                        ^^^^^^^^^^^^^^^
  File "/workspaces/ros2_rolling_ws/build/rqt_joint_trajectory_controller/rqt_joint_trajectory_controller/utils.py", line 185, in __call__
    self._cm_list = get_controller_managers(self._ns, self._cm_list)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/ros2_rolling_ws/build/rqt_joint_trajectory_controller/rqt_joint_trajectory_controller/utils.py", line 80, in get_controller_managers
    ns_list += [ns for ns in ns_list_curr if ns not in ns_list and is_controller_manager(node, ns)]
                                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/ros2_rolling_ws/build/rqt_joint_trajectory_controller/rqt_joint_trajectory_controller/utils.py", line 101, in is_controller_manager
    if not _srv_exists(node, cm_ns + srv_name, cm_services[srv_name]):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/ros2_rolling_ws/build/rqt_joint_trajectory_controller/rqt_joint_trajectory_controller/utils.py", line 155, in _srv_exists
    srv_obtained_type = srv_info[0][1][0]
                        ~~~~~~~~^^^
IndexError: list index out of range

Expected behavior
no crash

Environment:

  • OS: noble
  • Version: Rolling from source
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant