ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

I have this error when I create a simple urdf:ERROR: cannot launch node of type [robot_state_publisher/state_publisher]:

asked 2022-02-07 13:01:36 -0500

Gorri gravatar image

updated 2022-02-07 14:15:46 -0500

osilva gravatar image

I have this error when creating a simple urdf:

 * /robot_description: <?xml version="1....
 * /rosdistro: noetic
 * /rosversion: 1.15.14
 * /use_gui: False

    joint_state_publisher (joint_state_publisher/joint_state_publisher)
    robot_state_publisher (robot_state_publisher/state_publisher)
    rviz (rviz/rviz)

auto-starting new master
process[master]: started with pid [6627]

setting /run_id to a8a04748-8847-11ec-9fed-1d9a4648abfe
process[rosout-1]: started with pid [6639]
started core service [/rosout]
process[joint_state_publisher-2]: started with pid [6642]
ERROR: cannot launch node of type [robot_state_publisher/state_publisher]: Cannot locate node of type [state_publisher] in package [robot_state_publisher]. Make sure file exists in package path and permission is set to executable (chmod +x)
process[rviz-4]: started with pid [6644]

My file urdf is the following:

<?xml version="1.0"?>
<robot name="dd_robot">
    <!-- Base Link -->
    <link name="base_link">
            <origin xyz="0 0 0" rpy="0 0 0"/>
                <box size="0.5 0.5 0.25"/>

    <!-- Right Wheel -->
    <link name="right_wheel">
            <origin xyz="0 0 0" rpy="1.570795 0 0"/>
            <cylinder length="0.1" radius="0.2"/>
    <joint name="joint_right_wheel" type="continuous">
            <parent link="base_link"/>
            <child link="right_wheel"/>
            <origin xyz="0 -0.90 0" rpy="0 0 0"/>
            <axis xyz="0 1 0"/>

    <!-- Left Wheel -->
    <link name="left_wheel">
            <origin xyz="0 0 0" rpy="1.570795 0 0"/>
            <cylinder length="0.1" radius="0.2"/>
    <joint name="joint_left_wheel" type="continuous">
            <parent link="base_link"/>
            <child link="left_wheel"/>
            <origin xyz="0 0.90 0" rpy="0 0 0"/>
            <axis xyz="0 1 0"/>


My launch file:

   <!-- values passed by command line input -->     
   <arg name="model" />
   <arg name="gui" default="False" />

   <!-- set these parameters on Parameter Server -->
   <param name="robot_description" textfile="$(find ros_robotics)/urdf/$(arg model)" />
   <param name="use_gui" value="$(arg gui)"/>

   <!-- Start 3 nodes: joint_state_publisher, robot_state_publisher and rviz -->
   <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />

   <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />

   <node name="rviz" pkg="rviz" type="rviz" args="-d $(find ros_robotics)/urdf.rviz" required="True" />
   <!-- (required = "true") if rviz dies, entire roslaunch will be killed -->
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-02-07 14:20:05 -0500

osilva gravatar image

Hi @Gorri, please take a look at prior answer: #q357672

state_publisher was a deprecated alias for the node named robot_state_publisher. It was removed in which is included in the ROS Noetic release of that package. Change type="state_publisher" to type="robot_state_publisher"

edit flag offensive delete link more


Thank you, this is the fault that I had it

Gorri gravatar image Gorri  ( 2022-02-08 03:05:08 -0500 )edit

Question Tools

1 follower


Asked: 2022-02-07 13:01:36 -0500

Seen: 436 times

Last updated: Feb 07 '22