micro-ROS / micro-ROS/system_modes

[FEA] Allow deactivating nodes when system is activated.

未关闭
#96 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
C++
星标
45
派生
13
PR 合并指标
30 天内没有已合并 PR

描述

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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 SHM YAML 配置开始,并使用列出的 Lifecycle 和 /actuation/change_mode 服务调用复现该问题。检查切换到 LEFT 时 mode_manager 的行为,尤其是节点停用条目;当模式切换在没有 segfault 的情况下完成,且所选节点按照配置处于非活动状态时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
cpp
领域
robotics
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。