Robotics StackExchange | Archived questions

Trying to make amcl_demo.launch

Has anyone ever made a custom gmapping and amcl launch file? I'm tryng to figure out how to add my robot model and my laser scan to rviz, I'm using this packagehere. Or well, these sets of packages. I'm trying to change the amcl_demo.launch file so when rviz opens, it has the robot model and laserscan show up with no status errors. I've edited it like this:

<?xml version="1.0"?>
<launch>
  <master auto="start"/>

  <!-- Map server -->
  <arg name="map_file" default="/home/philip/LDW1.yaml"/>
  <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />

  <!-- Place map frame at odometry frame -->
  <node pkg="tf" type="static_transform_publisher" name="map_odom_broadcaster"
      args="0 0 0 0 0 0 map odom 100"/>

  <!-- Localization -->
  <node pkg="amcl" type="amcl" name="amcl" output="screen">
    <remap from="scan" to="mybot/laser/scan"/>
    <param name="odom_frame_id" value="odom"/>
    <param name="odom_model_type" value="diff-corrected"/>
    <param name="base_frame_id" value="chassis"/>
    <param name="update_min_d" value="0.5"/>
    <param name="update_min_a" value="1.0"/>
  </node>
  <!--include file="$(find amcl)/examples/amcl_omni.launch"/-->



  <!-- Move base -->
  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <rosparam file="$(find mybot_navigation)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find mybot_navigation)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find mybot_navigation)/config/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find mybot_navigation)/config/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find mybot_navigation)/config/base_local_planner_params.yaml" command="load" />

    <remap from="cmd_vel" to="cmd_vel"/>
    <remap from="odom" to="odom"/>
    <remap from="scan" to="mybot/laser/scan"/>
    <param name="move_base/DWAPlannerROS/yaw_goal_tolerance" value="1.0"/>
    <param name="move_base/DWAPlannerROS/xy_goal_tolerance" value="1.0"/>



  </node>
  <!-- rviz -->

  <node pkg="rviz" type="rviz" name="rviz" required="true"
          args="-d $(find mybot_description)/rviz/amcl.rviz"/>


</launch>

What does this file have missing that gives me status errors?

Asked by distro on 2022-08-16 15:36:26 UTC

Comments

What is the question here?

Asked by ravijoshi on 2022-08-17 05:54:42 UTC

@Ravi Joshi I updated the question

Asked by distro on 2022-08-17 14:49:42 UTC

As far as I understand, the default amcl_demo.launch file is running without problems, but you wish to set up Rviz so it recognizes the laser_scan and the robot model, without adding both manually every time. Is that correct?

Asked by Laschoking on 2022-08-18 03:20:52 UTC

@Laschoking Are you using the link I put in my my question? As in you built the packages and are able to use the original amcl file with no problem?

Asked by distro on 2022-08-18 03:34:30 UTC

Sorry, maybe I should have formulated my comment differently, I didn't understand what you wanted to archieve. You are trying to get the standard amcl_demo.launch file working, and take the robot_description & simulated laser_scan from https://github.com/PhilipAmadasun/mybot_ws is that correct?

Asked by Laschoking on 2022-08-18 07:35:19 UTC

@Laschoking I cloned all the files from that list, one of those files is an amcl_demo file. it doesn't work, so I tried to modify it but don't know how to do so correctly.

Asked by distro on 2022-08-18 11:57:28 UTC

Answers

For the robot-description you should maybe add the line

<param name="robot_description" command="$(find xacro)/xacro.py '$(find mybot_description)/urdf/mybot.xacro'"/>

which is included in mybot_ws/src/mybot_description/launch/mybot_rviz_amcl.launch. Also in order to receive laser data you need either a simulated map (using gazebo) or there has to be some recorded laser_data somewhere.

Since there is a directory called "mybot_gazebo" I suggest you include the launch file in your code and see what happens:

<include  file="$(find mybot_gazebo)/mybot_world.launch/>

If not everything works at once, maybe try to figure out which launch file work for you from the cold. Cheers, Lascho

Asked by Laschoking on 2022-08-18 14:28:56 UTC

Comments

@Laschoking Did you test this with the ackages. Did this work for you?

Asked by distro on 2022-08-19 13:51:54 UTC