0
$\begingroup$

Does anyone know, if there are available comments in the yaml files containing parameters? I tried to comment some information to keep it for later, but then I got rcl parsing exception. But maybe I did something incorrectly (I used '#' characted at the beginning of the line). (I am using launch file if that changes anything)

[ERROR] [1709328529.037018382] [rcl]: Failed to parse global arguments                                                                                                                
[node-1] terminate called after throwing an instance of 'rclcpp::exceptions::RCLInvalidROSArgsError'                                                                                           
[node-1]   what():  failed to initialize rcl: Couldn't parse params file: '--params-file (PATH)/config/default_params.yam
l'. Error: Error parsing a event near line 3, at ./src/parse.c:769, at ./src/rcl/arguments.c:406
[ERROR] [node-1]: process has died [pid 1110086, exit code -6, cmd '/(PATH)/test_ws/install/package/lib/package/node --ros-args --params-file /home
/a_tirma/git_projects/test_ws/install/at_xb_dev_ros/share/at_xb_dev_ros/config/default_params.yaml --ros-args -r __node:=node -r __ns:=/a_tirma'].

EDIT (added yaml file, as @Wilhelm suggested):

VALID

/a_tirma/xbee_device_node:
  ros__parameters:
    baud_rate: 115200
    telemetry_period: 100
    xb_local_period: 10
    xb_device_path: /dev/ttyACM3
    due_address: '00 13 a2 00 41 5c 61 86 '
    wasp_address: '00 13 a2 00 40 79 58 98 '
    qos_overrides:
      /parameter_events:
        publisher:
          depth: 1000
          durability: volatile
          history: keep_last
          reliability: reliable
    use_sim_time: false

INVALID

/a_tirma/xbee_device_node:
  ros__parameters:
    baud_rate: 115200
    telemetry_period: 100
    xb_local_period: 10
    xb_device_path: /dev/ttyACM3
# comment
    due_address: '00 13 a2 00 41 5c 61 86 '
    wasp_address: '00 13 a2 00 40 79 58 98 '
    qos_overrides:
      /parameter_events:
        publisher:
          depth: 1000
          durability: volatile
          history: keep_last
          reliability: reliable
    use_sim_time: false

Note that the names are different from the error output, as I changed them to be more generic there.

$\endgroup$
1
  • $\begingroup$ Maybe should you post your yaml file? $\endgroup$
    – Wilhelm
    Mar 1 at 22:54

2 Answers 2

1
$\begingroup$

Ok, not sure what was the reason for the error, but after some other things on focus it all seems to work fine even with comments.

Thanks for the help anyways. And thanks @reason_rock for your comment.

$\endgroup$
0
$\begingroup$

The comment issue may not be directly related to the problem you're facing.
As you mentioned, the # symbol works as a comment indicator in YAML file format. From the information you provided, there doesn't seem to be any apparent error.

However, what you should note is that when adding comments in a YAML file, the comment character (#) generally positioned on a line that matches the indentation level.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.