-
Notifications
You must be signed in to change notification settings - Fork 125
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
Parser Error Couldn't parse parameter override rule - loading tricycle_controller from ros2_control #295
Comments
|
Hi, problem resolved. The conflict aws located in the previous part of urdf with robot calibration. The controller and demo are working fine. |
Can you elaborate more on your solution? In our project, it started to appear recently (like 2-3 days ago), and I thought it might be connected with the latest update and that issue (#277). Below is my error. YAML configuration of TricycleController is very similar and was working fine till this week: [gzserver-1] [ERROR 1711549496.914657547] [gazebo_ros2_control]: parser error Couldn't parse parameter override rule: '--param robot_description:=<?xml version="1.0" ?>
[gzserver-1] <!-- =================================================================================== -->
[gzserver-1] <!-- | This document was autogenerated by xacro from /ros2_ws/install/jablka_description/share/jablka_description/urdf/robot.urdf.xacro | -->
[gzserver-1] <!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED | -->
[gzserver-1] <!-- =================================================================================== -->
[gzserver-1] <robot name="robot">
[gzserver-1] <!-- ### ROBOT BASE ### -->
[gzserver-1] <!-- Assume the base_link is right in the center of the rear axle. Mesh will be positioned as is in the STL file. -->
[gzserver-1] <link name="base_link">
[gzserver-1] <visual>
[gzserver-1] <origin rpy="0 0 0" xyz="0 0 0"/>
[gzserver-1] , at ./src/rcl/arguments.c:343
[gzserver-1] (Load() at ./src/gazebo_ros2_control_plugin.cpp:260) |
As of about 36 minutes ago, we are experiencing the same issue with I can confirm our simulation and control infrastructure will launch with Similar to @mbed92, the source of our issue comes from: <gazebo>
<plugin name="gazebo_ros2_control" filename="libgazebo_ros2_control.so">
<parameters>$(find at_gazebo)/config/bh3.yaml</parameters>
</plugin>
</gazebo> If this is removed, there is no |
@christophfroehlich I can also confirm that the same URDF works fine using <gazebo>
<plugin filename="libgazebo_ros2_control.so" name="gazebo_ros2_control">
<robot_param>robot_description</robot_param>
<robot_param_node>robot_state_publisher</robot_param_node>
<parameters>$(arg ros2_controllers_config)</parameters> <!-- I guess the error occurs here --->
<ros>
<remapping>/tricycle_controller/cmd_vel:=/cmd_vel</remapping>
<remapping>/tricycle_controller/odom:=${common_params['wheel_odom_topic']}</remapping>
</ros>
</plugin>
</gazebo> |
It seems that this came with #277, but I'm using gazebo_ros2_control 0.4.7 built from source and it works for my robot.
If this is all fine I guess that some special character from your URDF can't be processed here gazebo_ros2_control/gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp Lines 255 to 257 in 6621895
@ahcorde If we can't fix this maybe we should think of reverting #277, because the robot_description parameter is deprecated anyways back to humble since ros-controls/ros2_control#940. |
My problem was that the parser could not process several lines of xacro-urdf code, which were even commented out after the auto generation. After removing these lines by deleting them, the parser was able to process the rest. Problem could be somewhere in the parser...try to modify your urdf and use it instead of xacro file |
@christophfroehlich Thanks for reopening the issue.
I can confirm that the tricycle demo works fine on [spawn_entity.py-5] [ERROR 1711610650.110016674] [spawn_entity]: Service %s/spawn_entity unavailable. Was Gazebo started with GazeboRosFactory? (_spawn_entity() at /opt/ros/humble/lib/gazebo_ros/spawn_entity.py:291)
[spawn_entity.py-5] [ERROR 1711610650.110274197] [spawn_entity]: Spawn service failed. Exiting. (run() at /opt/ros/humble/lib/gazebo_ros/spawn_entity.py:230)
I can confirm that @ipa-ych can you point out what lines were causing troubles? The issue seems to be some parser error, but I'm running out of ideas which characters/phrases might be wrong. |
I figured out what comments were the problem in my setup. Let's start from the beginning for all the people who spend two days on that 🥲 I was loading the robot_description_content = Command(
[
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
urdf_path,
...
]
)
robot_description = ParameterValue(robot_description_content, value_type=str)
return LaunchDescription([
Node(
package='robot_state_publisher',
executable='robot_state_publisher',
name='robot_state_publisher',
output='screen',
parameters=[{
'use_sim_time': use_sim_time,
'robot_description': robot_description
}]
),
...
]) As you can see, robot_description = ParameterValue(robot_description_content, value_type=str) to robot_description = ParameterValue(robot_description_content, value_type=None) # which parses the param as YAML instead of string That change caused a list of parsing errors. In my case it were comments like:
<!-- TODO(mbed): if needed we can put the STL mesh here --> or <!-- More reading: https://github.com/ethz-asl/kalibr/wiki/IMU-Noise-Model -->
<!-- ### ROBOT BASE ### --> Generally, I think this kind of error is super difficult to find because all signs show that URDF is OK, so you look everywhere but not there (at least initially). The decision is up to @christophfroehlich and contributors on handling that, but I think it should be pointed out somewhere in docs not to use specific characters due to parsing errors. |
@mbed92 yes, this is an issue from the |
Thanks for the analysis. We'll discuss how we can fix this, but we have limited possibilities without breaking API for humble and iron. |
I have run similar tests to @mbed92. In summary:
|
have you run xacro and passed the resulting urdf to |
Meant xacro, not XML, my mistake. Complete output for xacro file that results in a parsing error: # .xacro
auto@simulation-XPS-8960:~/auto_simulation/at_gazebo/urdf$ check_urdf < bh3.xacro
Expect URDF xml file to parse
# .urdf
auto@simulation-XPS-8960:~/auto_simulation/at_gazebo/urdf$ check_urdf < bh3.urdf
Expect URDF xml file to parse When I remove all comments with special characters, i.e., #, !, :, etc., |
As commented above: use xacro to generate a valid URDF and then pass it to check_urdf. If this is already the step from bh3.xacro to bh3.urdf, then is there already some other issue. |
Yes, this is with newly generated urdf using xacro. |
I was getting the same error for the past 2-3 days. Removing the comments as suggested by @mbed92 worked for me. |
Thanks, removing comments worked for me as well. This simple function can be used in MOST cases:
|
Thanks. I confirm that the temp solution is to generate the urdf file with xacro and remove by hand the comments before using it in the launch file. |
Had the same issue and can confirm, removing comments from my xacro files worked to solve the error |
it was necessary to erase all semicolons in comments because of a [weird bug in gazebo_ros2_control 0.4.7](ros-controls/gazebo_ros2_control#295), I hope it will get fixed soon because I like my "TODO:"s using folke/todo-comments.nvim
…cro cause parsing issues
Hi,
I have been trying to apply ros2_control tricycle_controller to cutomized robot model with three-wheel-layout. I am using gazebo 11 classic and ROS2 humble (with all required packages installed)
I was following the tricycle_controller_tutorial (https://github.com/ros-controls/gazebo_ros2_control/blob/master/gazebo_ros2_control_demos/config/tricycle_drive_controller.yaml) to create tricycle_drive_controller.yaml and adding ros2_control & gazebo plugins to robot urdf file. In tricycle_drive_controller.yaml file, the traction_joint_name and steering_joint_name have been changed to match joints in the urdf model. The urdf can be correctly launched in rviz and geometry relationships are also correct.
However, when trying to run the launch file, the process always get stucked with parsing .yaml file and tricycle_controller cannot be launched. The Errorlog is as follow:
and my .yaml file is
The plgins in urdf model (before ):
The problem seems to be pasring .yaml file and parameter overriding with the urdf, but no collisions are found in the urdf.
Section of urdf:
The text was updated successfully, but these errors were encountered: