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

ros navigation stack - tf problems.

asked 2023-05-18 11:51:32 -0500

Amarsahar gravatar image

Hi all, im trying to implement ros navigation stack on 4 wheel robot

my system built from arduino to control the motors with cmd_vel topic and im running ros noetic on raspberry pi 4(ubiquity version)

the sensor I'm using is rplidar a1 and I'm doing the mapping with hector-slam

when I'm trying to auto-navigate the robot with the served map, I get tf errors that I can't manage to solve,

I'd appreciate some guidance on how to approach the problems

including my tf tree and the navigation launch file

thank's in advance.

tf tree: link text

launch file:

<launch>

<!-- Run teleop -->
<include file="$(find electrobot)/launch/electrobot_teleop.launch"/>

<!-- Run lidar. -->
<arg name="node_start_delay" default="5.0" />  

<!-- Run the map server --> 
<node name="map_server" pkg="map_server" type="map_server" args="$(find electrobot)/maps/blackroom2.pgm 0.05"/>

<!-- Add transformations. -->

<node pkg="tf" type="static_transform_publisher" name="base_to_laser_broadcaster" args="0 0 0 0 0 0 base_link laser 100"/>

<!-- 
    HECTOR STUFF. 
-->

<arg name="tf_map_scanmatch_transform_frame_name" default="scanmatcher_frame"/> <arg name="base_frame" default="base_link"/> <arg name="odom_frame" default="base_link"/> <arg name="pub_map_odom_transform" default="true"/> <arg name="scan_subscriber_queue_size" default="10"/> <arg name="scan_topic" default="scan"/> <arg name="map_size" default="2048"/> <arg name="pub_odometry" default="true"/>

<node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">
<param name="pub_odometry" value="$(arg pub_odometry)"/>

<!-- Frame names -->
<remap from="map" to="mapcurrent" />
<param name="map_frame" value="mapcurrent_frame" />
<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_odom_transform" value="$(arg pub_map_odom_transform)"/>

<!-- 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.2"/>
<param name="update_factor_occupied" value="0.9" />    
<param name="map_update_distance_thresh" value="0.2"/>
<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>

<!-- 
    AMCL stuff.
 -->
<node pkg="amcl" type="amcl" name="amcl">
    <param name="tf_broadcast" value="true" />
    <param name="base_frame_id" value="base_link" />
    <param name="global_frame_id" value="map" />
    <param name="odom_frame_id" value="scanmatch_odom" />
    <param name="use_map_topic" value="false" />

    <remap from="scan" to="scan" />
    <param name="odom_model_type" value="diff" />
    <param name="transform_tolerance" value="0.5" /> ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-06-08 02:38:12 -0500

satvikgupta gravatar image

Your TF tree seems to be broken/not connected properly; try following this thread https://answers.ros.org/question/1009...

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-05-18 11:51:32 -0500

Seen: 64 times

Last updated: May 18 '23