tu-darmstadt-ros-pkg / hector_slam

hector_slam contains ROS packages related to performing SLAM in unstructed environments like those encountered in the Urban Search and Rescue (USAR) scenarios of the RoboCup Rescue competition.
http://wiki.ros.org/hector_slam
653 stars 454 forks source link

frame namespace for base_link not working #104

Closed darshb34 closed 2 years ago

darshb34 commented 2 years ago

Instead of "base_link", my source_frame_name is "/rob/base_link"

I replaced

to

But in the tf tree, base_link comes up as new frame and the whole... world --> map --> base_link tree is disconnected.

Please help. Thank you

<?xml version="1.0"?>
<launch>

    <!-- <node pkg="rosbag" type="play" name="rosbag_play" args="clock /home/rob/Downloads/2011_09_30_0018.bag"/> -->
    <node pkg="rosbag" type="play" name="rosbag_play" args="--clock /home/rob/Downloads/2022-03-18-13-59-51.bag"/>

    <!-- For Velodyne VLP-16 --> 
    <param name="scan_line" value="16" />
    <arg name="tf_prefix" default="rob"/>
    <!-- Set up velodyne static transform -->                                        <!--x   y     z   xr  yr  zr-->
    <node pkg="tf" type="static_transform_publisher" name="velodyne_broadcaster" args="0.0 0.0 0.838 0.0 0.0 0.0 $(arg tf_prefix)/base_link /velodyne 100"/>
    <!-- For Velodyne HDL-32 
    <param name="scan_line" value="32" />
    -->

    <!-- For Velodyne HDL-64
    <param name="scan_line" value="64" /> -->

    <!--- Sim Time -->
    <param name="/use_sim_time" value="true" />
    <param name="scan_period" value="0.1" /> 
    <param name="vertical_angle" type="double" value="2.0" />
    <param name="max_dis" type="double" value="90.0" />
    <param name="min_dis" type="double" value="3.0" />

    <!--- -->
    <node pkg="floam" type="floam_odom_estimation_node" name="floam_odom_estimation_node" output="screen"/>
    <node pkg="floam" type="floam_laser_processing_node" name="floam_laser_processing_node" output="screen"/>

    <node pkg="tf" type="static_transform_publisher" name="word2map_tf"  args="0 0 0 0 0 0 /world /map 10" />
    <!-- <node pkg="tf" type="static_transform_publisher" name="rob_fake_tf"  args="0 0 0 0 0 0 /base_link /rob/base_link 10" /> -->
    <arg name="rviz" default="true" />
    <group if="$(arg rviz)">
        <node launch-prefix="nice" pkg="rviz" type="rviz" name="rviz" args="-d $(find floam)/rviz/floam.rviz" />
    </group>

    <!-- <node pkg="hector_trajectory_server" type="hector_trajectory_server" name="trajectory_server_loam" ns="gt" > 
        <param name="/target_frame_name" value="world" />
        <param name="/source_frame_name" value="velodyne" />
        <param name="/trajectory_update_rate" value="10.0" />
        <param name="/trajectory_publish_rate" value="10.0" />
    </node> -->
    <!-- <group ns="rob"> -->
    <node pkg="hector_trajectory_server" type="hector_trajectory_server" name="trajectory_server_loam" ns="base_link">
        <param name="/target_frame_name" value="world" />
        <param name="/source_frame_name" value="/rob/base_link" /> #MY base_link is /rob/base_link
        <param name="/trajectory_update_rate" value="10.0" />
        <param name="/trajectory_publish_rate" value="10.0" />
    </node>
    <!-- </group> -->
</launch>