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

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 -0600

Gorri gravatar image

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

osilva gravatar image

I have this error when creating a simple urdf:

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

NODES
  /
    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]
ROS_MASTER_URI=http://localhost:11311

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">
        <visual>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <box size="0.5 0.5 0.25"/>
            </geometry>
        </visual>
    </link>

    <!-- Right Wheel -->
    <link name="right_wheel">
        <visual>
            <origin xyz="0 0 0" rpy="1.570795 0 0"/>
            <geometry>
            <cylinder length="0.1" radius="0.2"/>
            </geometry>
        </visual>
    </link>
    <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"/>
    </joint>

    <!-- Left Wheel -->
    <link name="left_wheel">
        <visual>
            <origin xyz="0 0 0" rpy="1.570795 0 0"/>
            <geometry>
            <cylinder length="0.1" radius="0.2"/>
            </geometry>
        </visual>
    </link>
    <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"/>
    </joint>

</robot>

My launch file:

<launch>
   <!-- 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 -->
</launch>
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

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

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 https://github.com/ros/robot_state_pu... 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

Comments

Thank you, this is the fault that I had it

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

Question Tools

1 follower

Stats

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

Seen: 563 times

Last updated: Feb 07 '22