Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty message_value dict when loading from YAML file. #57

Open
pgold opened this issue Oct 20, 2020 · 2 comments
Open

Empty message_value dict when loading from YAML file. #57

pgold opened this issue Oct 20, 2020 · 2 comments

Comments

@pgold
Copy link

pgold commented Oct 20, 2020

I'm trying to set-up a topic command that publishes a std_msgs/msg/Empty message. Here's the relevant snippet (under ros__parameters):

dock:
  type: topic
  interface_type: std_msgs/msg/Empty
  topic_name: dock 
  deadman_buttons: [3]  # X button
  message_value: {}

The issue I'm having is that the empty mapping under message_value gets transformed into None when ROS loads the values from the YAML configuration file. Would there be another way of letting joy_teleop know that no fields have to be set for the message it will publish?

For the time being, I've modified my local repository to ignore the message_value field if it is None. I could send that as a PR, but I also wonder is this isn't something that should be fixed "upstream" (rclpy?) so that users can, in general, use empty dictionaries.

@pgold
Copy link
Author

pgold commented Oct 27, 2020

Proposed teleop_tools only change (as opposed to an "upstream" fix): pgold@13488fc.

@selimxsuha
Copy link

selimxsuha commented Apr 6, 2023

Thanks for the opposed to an "upstream" fix. I was having the same issue and it fixed perfectly 👍

Edit: use square brackets otherwise it tries to parse rest of the lines coming after }

dock:
  type: topic
  interface_type: std_msgs/msg/Empty
  topic_name: dock 
  deadman_buttons: [3]  # X button
  message_value: []

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants