As stated, I am encountering this error when launching a ROS 2 simulation. I am currently using ROS 2 Iron and Gazebo Classic.
I am spawning the robot system from a pythonlaunch file as it follows:
spawn_robot = Node( package='gazebo_ros', executable='spawn_entity.py', arguments=['-topic', 'robot_description', '-entity', 'arm', '-x' , '0', '-y', '0', '-z', '0.1'], remappings=[ ('/camera_R/image_raw', 'image_R'), ('/camera_L/image_raw', 'image_L'), ('/laser_controller/out', 'laser_scan')], output='screen') The robot description is parsed as it follows:
xacro_file = os.path.join(get_package_share_directory(pkg_name), 'models', 'arm', 'model.xacro') robot_description_raw = xacro.process_file(xacro_file).toxml() params = {'robot_description': robot_description_raw, 'verbose': True, 'use_sim_time': True} rsp = Node(package='robot_state_publisher', executable='robot_state_publisher', output='screen', parameters=[params]) When I try to visualize it in Rviz I encounter the error No transform from [shoulder] to [base_link] and the following picture:
The xacro file that contains the model has the following definition:
<?xml version="1.0" ?> <!-- =================================================================================== --> <!-- | This document was autogenerated by xacro from robot_models/models/simple_DDR/model.xacro | --> <!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED | --> <!-- =================================================================================== --> <robot xmlns:xacro="http://www.ros.org/wiki/xacro"> <xacro:include filename="$(find robot_models)/models/arm/variables.xacro"/> <link name="base_link"></link> <link name="base"> <inertial> <origin xyz="${xmass_base} ${ymass_base} ${zmass_base}" rpy="0.0 0.0 0.0"/> <mass value="${mass_base}"/> <inertia ixx="${ixx_base}" ixy="0.0" ixz="0.0" iyy="${iyy_base}" iyz="0.0" izz="${izz_base}"/> </inertial> <collision> <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/> <geometry> <mesh filename="file://$(find robot_models)/models/arm/meshes/collision/base.stl" scale="1 1 1"/> </geometry> </collision> <virtual> <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/> <geometry> <mesh filename="file://$(find robot_models)/models/arm/meshes/visual/base.dae" scale="1 1 1"/> </geometry> </virtual> </link> <joint name="joint_base" type="fixed"> <parent link="base_link"/> <child link="base"/> <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/> </joint> <link name="shoulder"> <inertial> <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/> <mass value="${mass_shoulder}"/> <inertia ixx="${ixx_shoulder}" ixy="0.0" ixz="0.0" iyy="${iyy_shoulder}" iyz="0.0" izz="${izz_shoulder}"/> </inertial> <collision> <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/> <geometry> <mesh filename="file://$(find robot_models)/models/arm/meshes/collision/shoulder.stl" scale="1 1 1"/> </geometry> </collision> </link> <joint name="joint_shoulder" type="revolute"> <parent link="base"/> <child link="shoulder"/> <origin rpy="0.0 0.0 0.0" xyz="0.0 0.0 0.163"/> <axis xyz="0 0 1"/> <limit effort="150.0" lower="-6.28318530718" upper="6.28318530718" velocity="3.14"/> <dynamics damping="0.0" friction="0.0"/> </joint> </robot> 