Messages graphs:
Show the messages graph:
rosrun rqt_graph rqt_graph
TF graphs:
Install:
sudo apt install ros-noetic-tf2-tools
Run the view tf2:
rosrun tf2_tools view_frames.py
Run in tf:
In case of error “cannot use a string pattern on a bytes-like object”:
sudo vim /opt/ros/noetic/lib/tf/view_frames
Then modify the code in the VIM edit that opens
m = r.search(vstr.decode('utf-8'))
To view the dpf:
evince frames.pdf
Check is a Tf is being published:
rosrun tf tf_echo /odom /base_link
TFs for a SLAM two wheel robot:
SLAM configuration file:
<?xml version="1.0"?>
<launch>
<arg name="tf_map_scanmatch_transform_frame_name" default="scanmatcher_frame"/>
<arg name="base_frame" default="base_footprint"/>
<arg name="odom_frame" default="odom"/>
<arg name="pub_map_odom_transform" default="true"/>
<arg name="scan_subscriber_queue_size" default="5"/>
<arg name="scan_topic" default="scan"/>
<arg name="map_size" default="2048"/>
<node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">
<!-- Frame names -->
<param name="map_frame" value="map" />
<param name="base_frame" value="$(arg base_frame)" />
<param name="odom_frame" value="$(arg odom_frame)" />
<!-- Tf use -->
<param name="use_tf_scan_transformation" value="true"/>
<param name="use_tf_pose_start_estimate" value="false"/>
<param name="pub_map_scanmatch_transform" value="false" />
<param name="pub_map_odom_transform" value="$(arg pub_map_odom_transform)"/>
<param name="tf_map_scanmatch_transform_frame_name" value="$(arg tf_map_scanmatch_transform_frame_name)" />
<!-- Map size / start point -->
<param name="map_resolution" value="0.050"/>
<param name="map_size" value="$(arg map_size)"/>
<param name="map_start_x" value="0.5"/>
<param name="map_start_y" value="0.5" />
<param name="map_multi_res_levels" value="2" />
<!-- Map update parameters -->
<param name="update_factor_free" value="0.4"/>
<param name="update_factor_occupied" value="0.9" />
<param name="map_update_distance_thresh" value="0.4"/>
<param name="map_update_angle_thresh" value="0.06" />
<param name="laser_z_min_value" value = "-1.0" />
<param name="laser_z_max_value" value = "1.0" />
<!-- Advertising config -->
<param name="advertise_map_service" value="true"/>
<param name="scan_subscriber_queue_size" value="$(arg scan_subscriber_queue_size)"/>
<param name="scan_topic" value="$(arg scan_topic)"/>
<!-- Debug parameters -->
<!--
<param name="output_timing" value="false"/>
<param name="pub_drawings" value="true"/>
<param name="pub_debug_output" value="true"/>
-->
<param name="tf_map_scanmatch_transform_frame_name" value="$(arg tf_map_scanmatch_transform_frame_name)" />
</node>
<!--
<node pkg="tf" type="static_transform_publisher" name="map_nav_broadcaster" args="0 0 0 0 0 0 map nav 20"/>
<node pkg="tf" type="static_transform_publisher" name="map_scanmatcher_broadcaster" args="0 0 0 0 0 0 map scanmatcher_frame 25"/>
<node pkg="tf" type="static_transform_publisher" name="nav_baselink_broadcaster" args="0 0 0 0 0 0 nav base_link 13"/>
<node pkg="tf" type="static_transform_publisher" name="nav_baseframe_broadcaster" args="0 0 0 0 0 0 nav base_link 13"/>
<node pkg="tf" type="static_transform_publisher" name="nav_basefootprint_broadcaster" args="0 0 0 0 0 0 nav base_link 13"/>
<node pkg="tf" type="static_transform_publisher" name="base_to_laser_broadcaster" args="0 0 0 0 0 0 base_link scan_link 100" />
-->
<node pkg="tf" type="static_transform_publisher" name="map_to_odom" args="0 0 0 0 0 0 map odom 30" />
<node pkg="tf" type="static_transform_publisher" name="base_to_laser_broadcaster" args="0 0 0 0 0 0 base_footprint scan_link 100" />
</launch>