Robotics StackExchange | Archived questions

ros2_control: No parameter file provided. Configuration might be wrong. failed to parse input yaml file(s)

Hello. I am trying to build a 4 wheel differential drive robot. But i am getting error when using ros2_control.

Version: Ros2 Foxy

Terminal Output

[INFO] [launch]: Default logging verbosity is set to INFO

[INFO] [robotstatepublisher-1]: process started with pid [15600]

[INFO] [gzserver-2]: process started with pid [15602]

[INFO] [gzclient -3]: process started with pid [15604]

[INFO] [spawn_entity.py-4]: process started with pid [15608]

[robotstatepublisher-1] Parsing robot urdf xml string.

[robotstatepublisher-1] Link chassis had 0 children

[robotstatepublisher-1] Link leftbackwheel had 0 children

[robotstatepublisher-1] Link leftfrontwheel had 0 children

[robotstatepublisher-1] Link rightbackwheel had 0 children

[robotstatepublisher-1] Link rightfrontwheel had 0 children

[robotstatepublisher-1] [INFO] [1690098191.859057276] [robotstatepublisher]: got segment base_link

[robotstatepublisher-1] [INFO] [1690098191.859245420] [robotstatepublisher]: got segment chassis

[robotstatepublisher-1] [INFO] [1690098191.859271642] [robotstatepublisher]: got segment leftbackwheel

[robotstatepublisher-1] [INFO] [1690098191.859445507] [robotstatepublisher]: got segment leftfrontwheel

[robotstatepublisher-1] [INFO] [1690098191.859470599] [robotstatepublisher]: got segment rightbackwheel

[robotstatepublisher-1] [INFO] [1690098191.859487475] [robotstatepublisher]: got segment rightfrontwheel

[spawnentity.py-4] [INFO] [1690098192.655593127] [spawnentity]: Spawn Entity started

[spawnentity.py-4] [INFO] [1690098192.656298347] [spawnentity]: Loading entity published on topic robot_description

[spawnentity.py-4] [INFO] [1690098192.660608641] [spawnentity]: Waiting for entity xml on robot_description

[spawnentity.py-4] [INFO] [1690098192.674574790] [spawnentity]: Waiting for service /spawn_entity, timeout = 30

[spawnentity.py-4] [INFO] [1690098192.676116471] [spawnentity]: Waiting for service /spawn_entity

[spawnentity.py-4] [INFO] [1690098193.935984000] [spawnentity]: Calling service /spawn_entity

[spawnentity.py-4] [INFO] [1690098194.215878880] [spawnentity]: Spawn status: SpawnEntity: Successfully spawned entity [my_bot]

[gzserver-2] [INFO] [1690098194.282512027] [gazeboros2control]: Loading gazeboros2control plugin

[gzserver-2] [INFO] [1690098194.289442063] [gazeboros2control]: Starting gazeboros2control plugin in namespace: /

[gzserver-2] [INFO] [1690098194.290072867] [gazeboros2control]: Starting gazeboros2control plugin in ros 2 node: gazeboros2control

[gzserver-2] [ERROR] [1690098194.290204113] [gazeboros2control]: No parameter file provided. Configuration might be wrong

[gzserver-2] [ERROR] [1690098194.290376838] [gazeboros2control]: failed to parse input yaml file(s)

[INFO] [spawn_entity.py-4]: process has finished cleanly [pid 15608]

".yaml" Config File for Ros2 Control

controllermanager: rosparameters: updaterate: 30 usesimtime: true

diff_cont:
  type: diff_drive_controller/DiffDriveController

joint_broad:
  type: joint_state_broadcaster/JointStateBroadcaster

diffcont: ros_parameters:

publish_rate: 50.0

base_frame_id: base_link

left_wheel_names: ['left_front_wheel_joint', 'left_back_wheel_joint']
right_wheel_names: ['right_front_wheel_joint', 'right_back_wheel_joint']
wheel_separation: 0.36
wheel_radius: 0.1

use_stamped_vel: false

Main URDF File --> robot_core.xacro

<?xml version="1.0"?>

<xacro:include filename="inertial_macros.xacro"/>

<material name="white">
    <color rgba="1 1 1 1" />
</material>

<material name="orange">
    <color rgba="1 0.3 0.1 1" />
</material>

<material name="blue">
    <color rgba="0.2 0.2 1 1" />
</material>

<material name="black">
    <color rgba="0 0 0 1" />
</material>


<!-- BASE LINK -->
<link name="base_link">

</link>


<!-- CHASSI LINK -->
<joint name="chassis_joint" type="fixed">
    <parent link="base_link"/>
    <child link="chassis"/>
    <origin xyz="-0.1 0 0"/>
</joint>

<link name="chassis">
    <visual>
        <!-- <origin xyz="0.15 0 0.075"/>   # This line is used to move the chasis relative to its link -->
        <geometry>
            <box size="0.5 0.3 0.05"/>
        </geometry>
        <material name="white"/>
    </visual>

    <collision>
        <!-- <origin xyz="0.3 0 0.075"/>   0.15 0 0.075 -->
        <geometry>
            <box size="0.5 0.3 0.3"/>
        </geometry>
    </collision>

    <xacro:inertial_box mass="0.5" x="0.5" y="0.3" z="0.05">
        <origin xyz="0 0 0" rpy="0 0 0"/>
    </xacro:inertial_box>
</link>

<gazebo reference="chassis">
    <material>Gazebo/Orange</material>
</gazebo>

<!-- LEFT FRONT WHEEL LINK -->
<joint name="left_front_wheel_joint" type="continuous">
    <parent link="base_link"/>
    <child link="left_front_wheel"/>        
    <origin xyz="0.15 0.18 0" rpy="-${pi/2} 0 0"/>
    <axis xyz="0 0 1"/>
</joint>

<link name="left_front_wheel">
    <visual>
        <geometry>
            <cylinder radius="0.1" length="0.04"/>
        </geometry>
        <material name="blue"/>
    </visual>
    <collision>
        <geometry>
            <cylinder radius="0.1" length="0.04"/>
        </geometry>
    </collision>

    <xacro:inertial_cylinder mass="0.1" length="0.04" radius="0.1">
        <origin xyz="0 0 0" rpy="0 0 0"/>
    </xacro:inertial_cylinder>
</link>

<gazebo reference="left_front_wheel">
    <material>Gazebo/Blue</material>
</gazebo>

<!-- RIGHT FRONT WHEEL LINK -->
<joint name="right_front_wheel_joint" type="continuous">
    <parent link="base_link"/>
    <child link="right_front_wheel"/>        
    <origin xyz="0.15 -0.18 0" rpy="${pi/2} 0 0"/>
    <axis xyz="0 0 -1"/>
</joint>

<link name="right_front_wheel">
    <visual>
        <geometry>
            <cylinder radius="0.1" length="0.04"/>
        </geometry>
        <material name="blue"/>
    </visual>
    <collision>
        <geometry>
            <cylinder radius="0.1" length="0.04"/>
        </geometry>
    </collision>    

    <xacro:inertial_cylinder mass="0.1" length="0.04" radius="0.1">
        <origin xyz="0 0 0" rpy="0 0 0"/>
    </xacro:inertial_cylinder>
</link>

<gazebo reference="right_front_wheel">
    <material>Gazebo/Blue</material>
</gazebo>





<!-- LEFT BACK WHEEL LINK -->
<joint name="left_back_wheel_joint" type="continuous">
    <parent link="base_link"/>
    <child link="left_back_wheel"/>        
    <origin xyz="-0.35 0.18 0" rpy="-${pi/2} 0 0"/>
    <axis xyz="0 0 1"/>
</joint>

<link name="left_back_wheel">
    <visual>
        <geometry>
            <cylinder radius="0.1" length="0.04"/>
        </geometry>
        <material name="blue"/>
    </visual>
    <collision>
        <geometry>
            <cylinder radius="0.1" length="0.04"/>
        </geometry>
    </collision>

    <xacro:inertial_cylinder mass="0.1" length="0.04" radius="0.1">
        <origin xyz="0 0 0" rpy="0 0 0"/>
    </xacro:inertial_cylinder>
</link>

<gazebo reference="left_back_wheel">
    <material>Gazebo/Blue</material>
    <!-- To remove Friction
    <mu1 value="0.001"/>
    <mu2 value="0.001"/>
    -->
</gazebo>

<!-- RIGHT BACK WHEEL LINK -->
<joint name="right_back_wheel_joint" type="continuous">
    <parent link="base_link"/>
    <child link="right_back_wheel"/>        
    <origin xyz="-0.35 -0.18 0" rpy="${pi/2} 0 0"/>
    <axis xyz="0 0 -1"/>
</joint>

<link name="right_back_wheel">
    <visual>
        <geometry>
            <cylinder radius="0.1" length="0.04"/>
        </geometry>
        <material name="blue"/>
    </visual>
    <collision>
        <geometry>
            <cylinder radius="0.1" length="0.04"/>
        </geometry>
    </collision>

    <xacro:inertial_cylinder mass="0.1" length="0.04" radius="0.1">
        <origin xyz="0 0 0" rpy="0 0 0"/>
    </xacro:inertial_cylinder>
</link>

<gazebo reference="right_back_wheel">
    <material>Gazebo/Blue</material>
    <!-- To remove Friction
    <mu1 value="0.001"/>
    <mu2 value="0.001"/>
    -->
</gazebo>

Ros2 Control URDF File --> ros2_control.xacro

<?xml version="1.0"?>

<ros2_control name="GazeboSystem" type="system">
    <hardware>
        <plugin>gazebo_ros2_control/GazeboSystem</plugin>
    </hardware>

    <joint name="left_front_wheel_joint">
        <command_interface name="velocity">
            <param name="min">-10</param>
            <param name="max">10</param>
        </command_interface>
        <state_interface name="velocity"/>
        <state_interface name="position"/>
    </joint>

    <joint name="right_front_wheel_joint">
        <command_interface name="velocity">
            <param name="min">-10</param>
            <param name="max">10</param>
        </command_interface>
        <state_interface name="velocity"/>
        <state_interface name="position"/>
    </joint>


    <!-- Adding Other wheels -->
    <joint name="left_back_wheel_joint">
        <command_interface name="velocity">
            <param name="min">-10</param>
            <param name="max">10</param>
        </command_interface>
        <state_interface name="velocity"/>
        <state_interface name="position"/>
    </joint>

    <joint name="right_back_wheel_joint">
        <command_interface name="velocity">
            <param name="min">-10</param>
            <param name="max">10</param>
        </command_interface>
        <state_interface name="velocity"/>
        <state_interface name="position"/>
    </joint>

</ros2_control>

<gazebo>
    <plugin name="gazebo_ros2_control" filename="libgazebo_ros2_control.so">
        <paramters>$(find my_bot)/config/my_controllers.yaml</paramters> 
    </plugin>
</gazebo>

Launch File --> launch_sim.launch.py

import os

from amentindexpython.packages import getpackageshare_directory

from launch import LaunchDescription from launch.actions import IncludeLaunchDescription from launch.launchdescriptionsources import PythonLaunchDescriptionSource

from launch_ros.actions import Node

def generatelaunchdescription():

# Include the robot_state_publisher launch file, provided by our own package. Force sim time to be enabled
# !!! MAKE SURE YOU SET THE PACKAGE NAME CORRECTLY !!!

package_name='my_bot' #<--- CHANGE ME

rsp = IncludeLaunchDescription(
            PythonLaunchDescriptionSource([os.path.join(
                get_package_share_directory(package_name),'launch','rsp.launch.py'
            )]), launch_arguments={'use_sim_time': 'true'}.items()
)

# Include the Gazebo launch file, provided by the gazebo_ros package
gazebo = IncludeLaunchDescription(
            PythonLaunchDescriptionSource([os.path.join(
                get_package_share_directory('gazebo_ros'), 'launch', 'gazebo.launch.py')]),
         )


# Run the spawner node from the gazebo_ros package. The entity name doesn't really matter if you only have a single robot.
spawn_entity = Node(package='gazebo_ros', executable='spawn_entity.py',
                    arguments=['-topic', 'robot_description',
                               '-entity', 'my_bot'],
                    output='screen')



# Launch them all!
return LaunchDescription([
    rsp,
    gazebo,
    spawn_entity,
])

Thanks

Asked by KalaDaku on 2023-07-23 03:21:31 UTC

Comments

Can you include the full terminal output which shows the command you ran and the error?

Asked by jdlangs on 2023-07-24 11:56:04 UTC

i added full terminal output. Seems like it got truncated due to excess content. But The issue is resolved not. It was just a typo in parameters tag. But now the robot is not moving left or right in gazebo, although it is moving forward and backward. The robot is moving completely fine in rviz2(forward, backward, left, right).

Thanks

Asked by KalaDaku on 2023-07-27 11:09:57 UTC

Answers