AMCL node fails to create transform between map and odom frames
Hello, So the issue is as stated above. I am trying to run autonomous navigation on a simulated environment in gazebo using ROS Noetic, I've created the map using Gmapping node and when I try to localize the robot using AMCL it doesn't work.
Here's the launch file
<launch> <arg name="scan_topic" default="/diff_robot/laser/scan"/> <arg name="base_frame" default="link_chassis"/> <arg name="odom_frame" default="odom"/>
<arg name="map_file" default="$(find diff_navigation)/maps/new_map.yaml" />
<arg name="initial_pose_x" default="0.0"/>
<arg name="initial_pose_y" default="0.0"/>
<arg name="initial_pose_a" default="0.0"/>
<!-- Map -->
<node name="maps" pkg="map_server" type="map_server" args="$(arg map_file)"/>
<!-- AMCL -->
<node pkg="amcl" type="amcl" name="amcl" output="screen">
<param name="min_particles" value="500"/>
<param name="max_particles" value="3000"/>
<param name="kld_err" value="0.02"/>
<param name="initial_pose_x" value="$(arg initial_pose_x)"/>
<param name="initial_pose_y" value="$(arg initial_pose_y)"/>
<param name="initial_pose_a" value="$(arg initial_pose_a)"/>
<param name="gui_publish_rate" value="50.0"/>
<remap from="scan" to="$(arg scan_topic)"/>
<param name="tf_broadcast" value="true"/>
<param name="odom_model_type" value="diff"/>
<param name="odom_frame_id" value="$(arg odom_frame"/>
<param name="base_frame_id" value="$(arg base_frame)"/>
<rosparam command='load' file="$(find diff_navigation)/params/amcl_params.yaml" />
</node>
</launch>
Attached below are the outputs of usual debugging procedures :
rostopic list
amcl/parameter_descriptions /amcl/parameter_updates /amcl_pose /clicked_point /clock /cmd_vel diagnostics /diff_robot/laser/scan
/display_robot_state /gazebo/link_states /gazebo/model_states /gazebo/parameter_descriptions /gazebo/parameter_updates /gazebo/performance_metrics /gazebo/set_link_state /gazebo/set_model_state /initialpose /joint_states /map /map_metadata /map_updates /move_base_simple/goal /odom /particlecloud /rosout /rosout_agg /tf /tf_static
rosnode info /amcl
Node [/amcl]
Publications:
* /amcl/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
* /amcl/parameter_updates [dynamic_reconfigure/Config]
* /amcl_pose [geometry_msgs/PoseWithCovarianceStamped]
* /diagnostics [diagnostic_msgs/DiagnosticArray]
* /particlecloud [geometry_msgs/PoseArray]
* /rosout [rosgraph_msgs/Log]
* /tf [tf2_msgs/TFMessage]
Subscriptions:
* /clock [rosgraph_msgs/Clock]
* /diff_robot/laser/scan [sensor_msgs/LaserScan]
* /initialpose [geometry_msgs/PoseWithCovarianceStamped]
* /map [nav_msgs/OccupancyGrid]
* /tf [tf2_msgs/TFMessage]
* /tf_static [tf2_msgs/TFMessage]
Services:
* /amcl/get_loggers
* /amcl/set_logger_level
* /amcl/set_parameters
* /global_localization
* /request_nomotion_update
* /set_map
contacting node http://abdul-Nitro-5:45419/ ...
Pid: 64109
Connections:
* topic: /rosout
* to: /rosout
* direction: outbound (42243 - 127.0.0.1:39362) [20]
* transport: TCPROS
* topic: /tf
* to: /amcl
* direction: outbound
* transport: INTRAPROCESS
* topic: /tf
* to: /rviz_visualize
* direction: outbound (42243 - 127.0.0.1:39364) [13]
* transport: TCPROS
* topic: /clock
* to: /gazebo (http://abdul-Nitro-5:42765/)
* direction: inbound (60380 - abdul-Nitro-5:56989) [15]
* transport: TCPROS
* topic: /tf
* to: /amcl (http://abdul-Nitro-5:45419/)
* direction: inbound
* transport: INTRAPROCESS
* topic: /tf
* to: /robot_state_publisher (http://abdul-Nitro-5:37439/)
* direction: inbound (48362 - abdul-Nitro-5:59369) [18]
* transport: TCPROS
* topic: /tf
* to: /gazebo (http://abdul-Nitro-5:42765/)
* direction: inbound (60402 - abdul-Nitro-5:56989) [21]
* transport: TCPROS
* topic: /tf_static
* to: /robot_state_publisher (http://abdul-Nitro-5:37439/)
* direction: inbound (48364 - abdul-Nitro-5:59369) [19]
* transport: TCPROS
* topic: /diff_robot/laser/scan
* to: /gazebo (http://abdul-Nitro-5:42765/)
* direction: inbound (60396 - abdul-Nitro-5:56989) [23]
* transport: TCPROS
* topic: /initialpose
* to: /rviz_visualize (http://abdul-Nitro-5:39879/)
* direction: inbound (46142 - abdul-Nitro-5:36229) [14]
* transport: TCPROS
* topic: /map
* to: /map_server (http://abdul-Nitro-5:42407/)
* direction: inbound (43698 - abdul-Nitro-5:45827) [16]
* transport: TCPROS
* topic ...