ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Trying to make amcl_demo.launch

asked 2022-08-16 15:36:26 -0500

distro gravatar image

updated 2022-08-17 14:49:22 -0500

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?

edit retag flag offensive close merge delete

Comments

What is the question here?

ravijoshi gravatar image ravijoshi  ( 2022-08-17 05:54:42 -0500 )edit

@Ravi Joshi I updated the question

distro gravatar image distro  ( 2022-08-17 14:49:42 -0500 )edit

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?

Laschoking gravatar image Laschoking  ( 2022-08-18 03:20:52 -0500 )edit

@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?

distro gravatar image distro  ( 2022-08-18 03:34:30 -0500 )edit

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/myb... is that correct?

Laschoking gravatar image Laschoking  ( 2022-08-18 07:35:19 -0500 )edit

@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.

distro gravatar image distro  ( 2022-08-18 11:57:28 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-08-18 14:28:56 -0500

Laschoking gravatar image

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

edit flag offensive delete link more

Comments

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

distro gravatar image distro  ( 2022-08-19 13:51:54 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-08-16 15:36:26 -0500

Seen: 355 times

Last updated: Aug 18 '22