Rviz reporting no fixed frame
I'm trying to complete the robot state publisher tutorial, but when I run:
roslaunch myrobot_description myrobot_rviz.launch
Rviz shows no model and in the left-hand panel reports the error "Fixed Frame [map] does not exist".
myrobot.urdf.xarco:
<?xml version="1.0"?>
<robot name="myrobot"
xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:macro name="default_inertial" params="mass">
<inertial>
<mass value="${mass}" />
<inertia
ixx="1.0" ixy="0.0" ixz="0.0"
iyy="1.0" iyz="0.0" izz="1.0" />
</inertial>
</xacro:macro>
<xacro:include filename="$(find myrobot_description)/urdf/materials.urdf.xacro" />
<!-- width in meters -->
<property name="torso_x_size" value="0.1" />
<!-- length in meters -->
<property name="torso_y_size" value="0.205" />
<!-- height in meters -->
<property name="torso_z_size" value="0.03" />
<!-- torso mass (not including legs) in kg -->
<property name="torso_mass" value="0.920" />
<!-- mass of a single upper leg piece in kg -->
<property name="upper_leg_mass" value="0.010" />
<link name="base_link">
<visual>
<geometry>
<box size="${torso_x_size} ${torso_y_size} ${torso_z_size}" />
</geometry>
<material name="red"/>
</visual>
<collision>
<geometry>
<box size="${torso_x_size} ${torso_y_size} ${torso_z_size}" />
</geometry>
</collision>
<xacro:default_inertial mass="${torso_mass}"/>
</link>
<xacro:macro name="leg" params="name reflect_x reflect_y">
<link name="${name}">
<visual>
<geometry>
<box size="0.003 0.04 0.005" />
</geometry>
<origin xyz="0 0.04 0" rpy="0 0 0"/>
<material name="blue" />
</visual>
<collision>
<geometry>
<box size="0.003 0.04 0.005" />
</geometry>
<origin xyz="0 0.04 0" rpy="0 0 0"/>
</collision>
<xacro:default_inertial mass="${upper_leg_mass}"/>
</link>
<joint name="torso_to_${name}" type="fixed">
<parent link="base_link"/>
<child link="${name}"/>
<origin xyz="${torso_x_size/2*reflect_x} ${torso_y_size/2*reflect_y} 0" />
<axis xyz="0 1 0" rpy="0 0 0" />
</joint>
</xacro:macro>
<xacro:leg name="front_right_leg" reflect_x="1" reflect_y="1" />
</robot>
myrobot_rviz.launch:
<launch>
<param name="robot_description" command="$(find xacro)/xacro.py '$(find myrobot_description)/urdf/myrobot.urdf.xacro'" />
<!-- source that publishes the joint positions as a sensor_msgs/JointState -->
<param name="use_gui" value="true"/>
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
<!-- robot visualization -->
<node name="rviz" pkg="rviz" type="rviz" required="true" />
<!-- publish all the frames to TF -->
<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher">
<param name="publish_frequency" value="50"/> <!-- Hz -->
</node>
</launch>
I googled that error, and other pages claim the it means there's no base_link defined in my model, but there clearly is. What am I doing wrong?
Edit: I changed my launch file to:
<launch>
<arg name="model" />
<arg name="gui" default="True" />
<param name="robot_description" command="$(find xacro)/xacro.py $(arg model)" />
<param name="use_gui" value="$(arg gui)"/>
<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">
<param name="publish_frequency" value="50"/> <!-- Hz -->
</node>
<node name="rviz" pkg="rviz" type="rviz" args="-d $(find myrobot_description)/urdf.rviz" required="true" />
</launch>
and now call it like:
roslaunch myrobot_description myrobot_rviz.launch model:='$(find myrobot_description)/urdf/myrobot.urdf.xacro'
and that makes the model show in Rviz, but it doesn't look any different from a the other xacrodisplay launches the tutorial goes over. Is the tutorial incomplete, or am I ...
Would you please open a new question for the issue you added in your last edit? The title of the question is "RViz reporting no fixed frame", your last edit is about something different. That makes it hard to keep answers on-topic and findable.