xqms / rosmon

ROS node launcher & monitoring daemon
Other
181 stars 47 forks source link

YAML merge key parsing not correct under lists/array environment #150

Closed qiayuanl closed 3 years ago

qiayuanl commented 3 years ago

Hello, I found that the YAML merge key is working well under the struct environment but not correct under the lists/array environment.

YAML code:

  defaults: &defaults
    A: 1
    B: 2
  struct:
    <<: *defaults
    A: 23
    C: 99
  array:
    - <<: *defaults
      A: 23
      C: 99

roslaunch outupt:

array:
- A: 23
  B: 2
  C: 99
defaults:
  A: 1
  B: 2
struct:
  A: 23
  B: 2
  C: 99

mon launch output:

array:
- '<<':
    A: 1
    B: 2
  A: 23
  C: 99
defaults:
  A: 1
  B: 2
struct:
  A: 23
  B: 2
  C: 99

Difference:

Note the causing by the lists/array environment

- '<<':
    A: 1
    B: 2
xqms commented 3 years ago

Hi @QiayuanLiao, thanks for the report! Any deviation from roslaunch is definitely a bug.

Merge keys are not official YAML syntax and are not supported by the YAML parser we are using (yaml-cpp). So @Cartoonman implemented merge key handling inside rosmon... See #117 for details.

I guess a small fix is needed, but I don't have time to look at it at the moment. If you can come up with a PR I'd be happy to look at it, though.

xqms commented 3 years ago

PR #153 should fix your issue. Could you please test it?