micro-ROS / micro-ROS/system_modes

[FEA] Allow deactivating nodes when system is activated.

Aperta
#96 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
C++
Stelle
45
Fork
13
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

```yaml
---
# 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

```sh
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

```sh
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

```sh
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](https://user-images.githubusercontent.com/17764118/201473545-926fc2f8-9bd4-419a-bfe0-d4db80168fb7.png)

EDIT: @ralph-lange

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con la configurazione YAML di SHM e riproduci il problema utilizzando le chiamate al servizio Lifecycle e /actuation/change_mode elencate. Esamina il comportamento di mode_manager quando passi a LEFT, in particolare le voci di disattivazione dei nodi; il lavoro è completato quando il cambio di modalità termina senza un segfault e i nodi selezionati sono inattivi come configurato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp
Ambito
robotics
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.