URDF not moving and not publishing tf on RViz using Robot_localization
Hello, I am using robot_localization
to visualize in RViz
my urdf
moving according to the rosbag
output files I prepared using robot_localization
. robot_localization
works, my rosbag
works well and all the messages are being published/subscribed properly. It seems that everything works but when it comes to visualize my urdf
moving on RViz
that is not happening.
I extensively studied robot_localization from the official website but I don't understand what the problem could be.
robot_localization
is basically not publishing the transform and I think that because of that, I am able to see the model and the two reference frames, but I am not able to see it moving. So the usbl
is the problem.
I spent some days now trying to figure out the possible problem but have arrived to a dead end. If anyone can shed some light on this matter it would be great.
See below a print screen of what is happening in RViz
before I apply the urdf
model:
And after I add the model:
Below I am showing my urdf
file:
<?xml version="1.0"?>
<robot name="floatModel">
<!-- Material & Color -->
<material name="blue">
<color rgba="0 0 0.8 1"/>
</material>
<material name="white">
<color rgba="1 1 1 1"/>
</material>
<material name="black">
<color rgba="0 0 0 1"/>
</material>
<!-- Base Link Declaration -->
<link name="base_link">
<visual>
<geometry>
<!-- This is the main body of the float -->
<cylinder length="0.865" radius="0.09"/>
</geometry>
<material name="blue"/>
</visual>
</link>
<!-- usbl -->
<link name="usbl">
<visual>
<origin rpy="0 0 0" xyz="0 0.127 0.0508"/>
</visual>
</link>
<joint name="base_to_usbl" type="fixed">
<parent link="base_link"/>
<child link="usbl"/>
<origin xyz="0 0.22 0.25"/>
</joint>
</robot>
float_localization.launch
<?xml version="1.0"?>
<launch>
<param name="use_sim_time" value="true" />
<node pkg="tf" type="static_transform_publisher" name="link1_broadcaster"
args="0 0 0 0 0 0 imu base_link 100" />
<node pkg="robot_localization" type="ekf_localization_node"
name="ekf_localization" clear_params="false">
<param name="use_sim_time" value="true" />
<param name="sensor_timeout" value="2.0"/>
<param name="two_d_mode" value="true"/>
<param name="map_frame" value="map"/>
<param name="odom_frame" value="odom"/>
<param name="base_link_frame" value="base_link"/>
<param name="world_frame" value="map"/>
<param name="publish_tf" value="true"/>
<param name="frequency" value="100"/>
<param name="odom0" value="/usbl/pose_projected"/>
<rosparam param="odom0_config">[true, true, false,
false, false, false,
false, false, false,
false, false, false,
false, false, false]</rosparam>
<param name="odom0_differential" value="false"/>
<param name="imu0" value="/imu/data_w_orientation"/>
<rosparam param="imu0_config">[false, false, false,
true, true, true,
false, false, false,
true, true, true,
true, true, true]</rosparam>
<param name="imu0_differential" value="false"/>
<param name="smooth_lagged_data" value="true"/>
</node>
</launch>
floatModel_urdf.launch
<launch>
<arg name="floatModel" default="$(find ros_float)/urdf/floatModel.urdf"/>
<arg name="gui" default="true" />
<arg name="rvizconfig" default="$(find ros_float)/rviz/urdf.rviz" />
<param name="robot_description" command="$(find xacro)/xacro.py $(arg floatModel)" />
<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="robot_state_publisher" />
<node name="rviz" pkg="rviz" type="rviz" args ...