ROS1:AMCL不从初始位置移动

发布于 2025-02-08 20:00:00 字数 2042 浏览 1 评论 0原文

我正在尝试为预先创建的地图进行AMCL本地化。 AMCL应从.bag文件(包含2个组合到 /scan_multi中的激光器)中播放的Laserscan。问题是AMCL似乎没有做任何事情,即使有效作用和TF树应正确链接。

还针对启动文件指定的不同初始位置也尝试过,所有这些位置均在RVIZ中的地图上正确表示。

我的启动文件的一部分可能相关:

<arg name="map_file" default="$(find project2)/map/map.yaml"/>
<node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />

<node pkg="tf" type="static_transform_publisher" name="map_to_odom" args="0.0 0.0 0.0 0.0 0.0 0.0 /map /odom 40" />

<node pkg="tf" type="static_transform_publisher" name="odom_to_base_footprint" args="0.0 0.0 0.0 0.0 0.0 0.0 /odom /base_footprint 40" />

<node pkg="tf" type="static_transform_publisher" name="base_footprint_base_link" args="0.0 0.0 0.0 0.0 0.0 0.0 /base_footprint /base_link 40" />

<arg name="scan_topic"     default="scan"/>
<arg name="initial_pose_x" default="0.0"/>
<arg name="initial_pose_y" default="0.0"/>
<arg name="initial_pose_a" default="0.0"/>


<node pkg="amcl" type="amcl" name="amcl">
<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="odom_frame_id"             value="odom"/>
<param name="base_frame_id"             value="base_footprint"/>
<param name="frame_id"                  value="base_link"/>
<param name="map_frame_id"              value="map"/>
<param name="use_map_topic"             value="true"/>
<remap from="map"                       to="/map"/>
<remap from="scan"                      to="scan_multi"/> 

</node>

tf tree的结构: /map-&gt; /odom-&gt; /base_footprint-&gt; /base_link-&gt; /激光前

我尝试使用ROSWTF,只有1个警告: 以下节点订阅没有连接: */rviz: */map_updates

在此处进行整个项目: https://drive.google.com/file/d/1aqz4 ..

感谢您的帮助!

I'm trying to do an AMCL localization for a pre-created map. AMCL should take laserScan played back from .bag file (containing 2 lasers that are combined into /scan_multi). Issue is that AMCL doesn't seem to do anything, even though odometry works and TF tree should be linked correctly.

Tried also for different initial positions specified from launch file, all of which are correctly represented on map in rviz.

Parts of my launch file that might be relevant:

<arg name="map_file" default="$(find project2)/map/map.yaml"/>
<node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />

<node pkg="tf" type="static_transform_publisher" name="map_to_odom" args="0.0 0.0 0.0 0.0 0.0 0.0 /map /odom 40" />

<node pkg="tf" type="static_transform_publisher" name="odom_to_base_footprint" args="0.0 0.0 0.0 0.0 0.0 0.0 /odom /base_footprint 40" />

<node pkg="tf" type="static_transform_publisher" name="base_footprint_base_link" args="0.0 0.0 0.0 0.0 0.0 0.0 /base_footprint /base_link 40" />

<arg name="scan_topic"     default="scan"/>
<arg name="initial_pose_x" default="0.0"/>
<arg name="initial_pose_y" default="0.0"/>
<arg name="initial_pose_a" default="0.0"/>


<node pkg="amcl" type="amcl" name="amcl">
<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="odom_frame_id"             value="odom"/>
<param name="base_frame_id"             value="base_footprint"/>
<param name="frame_id"                  value="base_link"/>
<param name="map_frame_id"              value="map"/>
<param name="use_map_topic"             value="true"/>
<remap from="map"                       to="/map"/>
<remap from="scan"                      to="scan_multi"/> 

</node>

Structure of TF tree: /map -> /odom -> /base_footprint -> /base_link -> /laser front

I tried using roswtf, got only 1 warning:
The following node subscriptions are unconnected: * /rviz: * /map_updates

Follow here for the whole project: https://drive.google.com/file/d/1AQz4...

Thanks for any help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

耀眼的星火 2025-02-15 20:00:00

.launch文件中删除所有静态变换,并在/odom/base_footprint之间替换它们。您可以直接从src文件夹中使用节点:

<node pkg="project2" name="odom_tf" respawn="false" type="odom_tf" output="screen"/>

Deleting all static transforms from the .launch file and replacing them with a dynamic one between /odom and /base_footprint solved the issue. You can directly use the node from the src folder:

<node pkg="project2" name="odom_tf" respawn="false" type="odom_tf" output="screen"/>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文