Skip to content

[FEA] Allow deactivating nodes when system is activated. #96

Open

Description

@ZhenshengLee

There is a need to selectively disable the function of a node, that's say deactivating a node in a certain system mode.

Should the following config work? Thanks!

SHM file

---
# system modes example
---

actuation:
  ros__parameters:
    type: system
    parts:
      drive_base
      left/manipulator
      right/manipulator
    modes:
      __DEFAULT__:
        drive_base: active.__DEFAULT__
        left/manipulator: inactive.__DEFAULT__
        right/manipulator: inactive.__DEFAULT__
      LEFT:
        # drive_base: active.__DEFAULT__
        left/manipulator: active.__DEFAULT__
        right/manipulsator: inactive.__DEFAULT__
      RIGHT:
        # drive_base: active.__DEFAULT__
        left/manipulator: inactive.__DEFAULT__
        right/manipulator: active.__DEFAULT__


left/manipulator:
  ros__parameters:
    type: node
    modes:
      __DEFAULT__:
        ros__parameters:
          max_torque: 0.1

drive_base:
  ros__parameters:
    type: node
    modes:
      __DEFAULT__:
        ros__parameters:
          max_speed: 0.1
          controller: PID

right/manipulator:
  ros__parameters:
    type: node
    modes:
      __DEFAULT__:
        ros__parameters:
          max_torque: 0.11

step to reproduce

zs@zs-vm-2204:~/zs_ws/ga_ros$ ros2 service call /actuation/change_state lifecycle_msgs/ChangeState "{transition: {id: 1, label: configure}}"
waiting for service to become available...
requester: making request: lifecycle_msgs.srv.ChangeState_Request(transition=lifecycle_msgs.msg.Transition(id=1, label='configure'))

response:
lifecycle_msgs.srv.ChangeState_Response(success=True)

after this ,all nodes become OK

zs@zs-vm-2204:~/zs_ws/ga_ros$ ros2 service call /actuation/change_state lifecycle_msgs/ChangeState "{transition: {id: 3, label: activate}}"
requester: making request: lifecycle_msgs.srv.ChangeState_Request(transition=lifecycle_msgs.msg.Transition(id=3, label='activate'))

response:
lifecycle_msgs.srv.ChangeState_Response(success=True)

after this , every thing OK

zs@zs-vm-2204:~/zs_ws/ga_ros$ time ros2 service call /actuation/change_mode system_modes_msgs/ChangeMode "{mode_name: 'LEFT'}"
waiting for service to become available...
requester: making request: system_modes_msgs.srv.ChangeMode_Request(mode_name='LEFT')

after this, the mode_manager died with a segfault.

image

EDIT: @ralph-lange

the step of reproduce is updated in 2022-11-12.

Activity

  1. ralph-lange commented on Nov 3, 2022

    @ralph-lange
    Contributor

    At first glance, this should work. You make even simply write drive_base: active instead of drive_base: active.__DEFAULT__ (as in right/manipulator: active). Did you experience any problems with this configuration?

  2. ZhenshengLee commented on Nov 4, 2022

    @ZhenshengLee
    Author

    @ralph-lange thank you for your fast reply!

    At first glance, this should work

    In currently design, In any specific MODE(MODERATE and PERFORMANCE), all node must be in ACTIVE state, if any of the nodes become INACTIVE, the mode_inference will think the MODE is in DEACTIVATING state

    Did you experience any problems with this configuration?

    • The segfault happens with mode_manager with this config-yaml

    I will repeat the test and give more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions