Publish tf map to fixed_frames for localization

asked 2021-06-02 10:44:31 -0500

lyh_lau gravatar image

I am trying to do localization with NeuronBot Omnirobot. I received the warning that there is no No transform from [map] to [base_laser] I think I just need to link both frames so the robot can locate itself by publishing the tf, but I dont know how should I write the code. Your help is much appreciated. :D

My Rviz and tf frames

Below is my localization.launch file <launch>

<!--======== map server ========-->
<node name="map_server" pkg="map_server" type="map_server" args="$(find omni_base_slam)/map/map.yaml">
    <!--<remap from="map" to="map_amcl"/>-->
<node name="map_server_div2" pkg="map_server" type="map_server" args="$(find omni_base_slam)/map/map.yaml">
    <remap from="map" to="/map/div2"/>-->
<!-- Map server (for nav)
<node name="map_server_nav" pkg="map_server" type="map_server" args="$(find hypharos_minibot)/map/map_nav.yaml"/>-->

<!--=========== amcl ===========-->
<!--<arg name="init_x" default="0" />
<arg name="init_y" default="0" />
<arg name="init_a" default="0" />-->
<!--<remap from="map" to="map_amcl"/>-->

<node pkg="amcl" type="amcl" name="amcl" output="screen">
    <!-- Publish scans from best pose at a max of 10 Hz -->
    <param name="odom_frame_id" value="/base_odom"/>
    <param name="global_frame_id" value="map"/>
    <param name="base_frame_id" value="/base_link"/>

    <param name="use_map_topic" value="true"/>
    <param name="first_map_only" value="true"/>
    <param name="tf_broadcast" value="true"/>

    <param name="initial_pose_x" value="0"/>
    <param name="initial_pose_y" value="0"/>
    <param name="initial_pose_a" value="0"/>
    <param name="initial_cov_xx" value="0.4" />
    <param name="initial_cov_yy" value="0.4" />
    <param name="initial_cov_aa" value="0.6" />

    <param name="transform_tolerance" value="0.05" />
    <param name="gui_publish_rate" value="5.0"/>
    <param name="min_particles" value="500"/>
    <param name="max_particles" value="4000"/>
    <param name="kld_err" value="0.02"/>
    <param name="kld_z" value="0.85"/>

    <!--    NOTE
    alpha: expected noise in odometry's [odom_m] estimate from [robot_m] component of the robot's motion. In meters
    alpha1:[odom_m]/rotation    [robot_m]/rotational
    alpha2:[odom_m]/rotation    [robot_m]/translational
    alpha3:[odom_m]/translation [robot_m]/translational
    alpha4:[odom_m]/translation [robot_m]/rotational
    alpha5:(omni only)tendency of the robot to translate (without rotating) perpendicular to the observed direction of travel
    <param name="odom_model_type" value="omni-corrected"/>
    <param name="odom_alpha1" value="0.9"/>
    <param name="odom_alpha2" value="0.1"/>
    <param name="odom_alpha3" value="0.05"/>
    <param name="odom_alpha4" value="0.01"/>
    <param name="odom_alpha5" value="0.04"/>

    <param name="laser_z_hit" value="0.7"/>
    <param name="laser_z_short" value="0.24"/>
    <param name="laser_z_max" value="0.001"/>
    <param name="laser_z_rand" value="0.059"/>
    <param name="laser_sigma_hit" value="0.02"/>
    <param name="laser_lambda_short" value="0.1"/>
    <param name="laser_min_range" value="0.25"/>
    <param name="laser_max_range" value="5.0"/>
    <param name="laser_model_type" value="likelihood_field"/>

    <param name="laser_likelihood_max_dist" value="16.0"/>
    <param name="laser_max_beams"  value="200"/>
    <param name="update_min_d" value="0.025"/>
    <param name="update_min_a" value="0.06"/>
    <param name="resample_interval" value="2 ...
edit retag flag offensive close merge delete


I manage to publish a static transform to it rosrun tf static_transform_publisher x x x x x x map odom 100 .I can then move on to navigation. But I found that the static map that I input manually will slowly move (due to the wheels slips I believe). So in conclusion, I still trying to find a way to do a proper localization

lyh_lau gravatar image lyh_lau  ( 2021-06-03 12:02:39 -0500 )edit