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
<!-- Arguments -->
<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>
Attached below are the outputs of usual debugging procedures :
rostopic list
amcl/parameterdescriptions /amcl/parameterupdates /amclpose /clickedpoint /clock /cmdvel diagnostics /diffrobot/laser/scan
/displayrobotstate /gazebo/linkstates /gazebo/modelstates /gazebo/parameterdescriptions /gazebo/parameterupdates /gazebo/performancemetrics /gazebo/setlinkstate /gazebo/setmodelstate /initialpose /jointstates /map /mapmetadata /mapupdates /movebasesimple/goal /odom /particlecloud /rosout /rosoutagg /tf /tfstatic
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: /map
* to: /maps (http://abdul-Nitro-5:34731/)
* direction: inbound (57116 - abdul-Nitro-5:45413) [17]
* transport: TCPROS
Link to tf tree As you can see map is not being published !
Also I checked the frame id's of /map , /odom, /diff_robot/laser/scan to verify that the frame id's match the ones used by amcl. I will be at your disposal for any further details. thanks and regards.
Asked by abdul_ahad_01 on 2022-07-31 12:46:37 UTC
Comments