Closed Jack17432 closed 1 year ago
Thanks for reporting, taking a look
What happens if you run from command line, for example:
ros2 run ros_gz_bridge parameter_bridge --ros-args -p config_file:=./src/ros_gz/ros_gz_bridge/test/config/full.yaml
Okay, this indicates that it can find this file when loaded from the command line. I believe the error you are seeing is because the configuration is pointing to a file that does not exist.
I'm going to open a PR to make the error condition more explicit when you are trying to open a non-existent file.
The failure to load with ignition.
prefixed messages is a second fix that I will need to add to maintain compatibility with the humble
branch.
@Jack17432 friendly ping, can you confirm that you were able to get this working with the improved error messages?
Hi @mjcarroll, I've encountered the same error trying to run a yaml file :
~$ ros2 run ros_gz_bridge parameter_bridge --ros-args -p config_file:=~/gazebo_ws/ros_bridge/config.yaml
[ERROR] [1687567401.137092983] [readFromYaml]: Could not parse config, top level must be a YAML sequence
[ERROR] [1687567402.136611339] [readFromYaml]: Could not parse config, top level must be a YAML sequence
I added the 'improved error messages" changes you made, to no effect.
the contents of config.yaml are just :
- topic_name: "/clock"
ros_type_name: "rosgraph_msgs/msg/Clock"
gz_type_name: "gz.msgs.Clock"
subscriber_queue: 10 # Default 10
publisher_queue: 10 # Default 10
lazy: false # Default "false"
direction: GZ_TO_ROS # Default "BIDIRECTIONAL" - Bridge both directions
# "GZ_TO_ROS" - Bridge GZ topic to ROS
# "ROS_TO_GZ" - Bridge ROS topic to GZ
Am I supposed to place that yaml file somewhere in particular?
Doesn't the GZ_TO_ROS
need to be in quotes?
Correct, "GZ_TO_ROS" should be in quotes.
@Jack17432 since you haven't replied in some time, I'm going to close this out. Feel free to re-open or open a new issue if you have more troubles.
If anyone happens to encounter the same error, make sure that you added the config folder that has the yaml file to CMakeLists install Directory.
Did someone solved this issue? I am having the same problem.
I was running parameter bridge node using a YAML config file through a python launch file, and encountered the same error. Make sure your config exists in install directory inside your workspace, and you define config file path correctly in your launch file (specify using get_package_share_directory or any other equivalents) .
Hi,
I'm also getting the same error: [readFromYaml]: Could not parse config, top level must be a YAML sequence
And when I run this:
ros2 run ros_gz_bridge parameter_bridge --ros-args -p config_file:=./src/ros_gz/ros_gz_bridge/test/config/full.yaml
[ERROR] [1727164413.215385465] [readFromYaml]: Could not parse config, top level must be a YAML sequence
I made sure to include the config folder containing the .yaml file in the CMakeLists.txt file:
install(DIRECTORY config/
DESTINATION share/${PROJECT_NAME}/config
)
I also made sure that the config file exists in the install directory inside my workspace.
Thank you in advance for any help you can give me ;)
Environment
Description
Steps to reproduce
Output