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

How to make the turtlebot move with path?(related to AMCL)

asked 2020-01-21 20:22:01 -0600

kane_choigo gravatar image

updated 2020-01-21 20:24:46 -0600

Hello, I'm using ROS kinect on Ubuntu 16.04.

I'm trying to get my turtlebot move in the navigation environment and made AML files for it like below:

<?xml version="1.0"?>

<launch>

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

<arg name="use_map_topic" default="true"/>
<arg name="scan_topic" default="scan" />

<node pkg="amcl" type="amcl" name="amcl">
    <param name="use_map_topic" value="$(arg use_map_topic)"/>
    <!-- Publish scans from best pose at a max of 10 Hz -->
    <param name="odom_model_type" value="diff"/>
    <param name="odom_alpha5" value="0.1"/>
    <param name="gui_publish_rate" value="10.0"/>
    <param name="laser_max_beams" value="60"/>
    <param name="laser_max_range" value="12.0"/>
    <param name="min_particles" value="500"/>
    <param name="max_particles" value="2000"/>
    <param name="kld_err" value="0.05"/>
    <param name="kld_z" value="0.99"/>
    <param name="odom_alpha1" value="0.2"/>
    <param name="odom_alpha2" value="0.2"/>
    <!-- translation std dev, m -->
    <param name="odom_alpha3" value="0.2"/>
    <param name="odom_alpha4" value="0.2"/>
    <param name="laser_z_hit" value="0.5"/>
    <param name="laser_z_short" value="0.05"/>
    <param name="laser_z_max" value="0.05"/>
    <param name="laser_z_rand" value="0.5"/>
    <param name="laser_sigma_hit" value="0.2"/>
    <param name="laser_lambda_short" value="0.1"/>
    <param name="laser_model_type" value="likelihood_field"/>
    <!-- <param name="laser_model_type" value="beam"/> -->
    <param name="laser_likelihood_max_dist" value="2.0"/>
    <param name="update_min_d" value="0.25"/>
    <param name="update_min_a" value="0.2"/>
    <param name="odom_frame_id" value="odom"/>
    <param name="resample_interval" value="1"/>
    <!-- Increase tolerance because the computer can get quite busy -->
    <param name="transform_tolerance" value="1.0"/>
    <param name="recovery_alpha_slow" value="0.0"/>
    <param name="recovery_alpha_fast" value="0.0"/>
    <remap from="scan" to="$(arg scan_topic)"/>    
</node>

</launch>

the above is the amcl file. Can I give tuertle bot movement with these below??

$ roslauch turtlebot_gazebo turtlebot tuetlebot_world.launch

$ roalcunch teb_navigation amcl1.launch

At least in my case, I failed; it can make path-plan but couldn't move at all. So I added move_base node additionally like below:

<launch>

<!--- Run AMCL -->
<include file="$(find teb_navigation)/launch/amcl.launch" />

<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">

    <param name="base_global_planner" value="navfn/NavfnROS"/>
    <param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS"/>
    <rosparam file="$(find teb_navigation)/config/base_global_planner.yaml" command="load"/>
    <rosparam file="$(find teb_navigation)/config/base_local_planner.yaml" command="load"/>

    <!-- observation sources located in costmap_common.yaml -->
    <rosparam file="$(find teb_navigation)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find teb_navigation)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />

    <!-- local costmap, needs size -->
    <rosparam file="$(find teb_navigation)/config/local_costmap_params.yaml" command="load" ns="local_costmap" />
    <param name="local_costmap/width" value="10.0"/>
    <param name="local_costmap/height" value="10.0"/>

    <!-- static global ...
(more)
edit retag flag offensive close merge delete

Comments

can you please leave links to the tutorials that you have read/used?

pavel92 gravatar image pavel92  ( 2020-01-22 03:09:54 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2020-01-22 03:20:09 -0600

pavel92 gravatar image

Even though amcl is a part of the navigation stack, it is a localization package and you cant navigate with it. For navigation you need move_base and that is why your second launch file works.

  roslaunch turtlebot_gazebo turtlebot_world.launch

will just launch the turtlebot gazebo simulation which will simulate your robot with all the required senors in an environment

roslaunch teb_navigation amcl1.launch

while the above will launch only the amcl localization and map server (as shown in your first launch file). You can launch move_base here or create a separate launch file for navigation.

edit flag offensive delete link more

Comments

Thanks for your quick reply. I think the tutorial I referred to is not accessible because it is not open source. However, I'm now sure that with only amcl it is not possible to make the robot move, thanks to you. Now I wonder the robot can move with just the code I made,move_base.launch (Just so you know, the first code is amcl1.lauch, and the other one is move_base.launch). In the case of turtlebot, the `amcl_demo.launch' includes the following:

  <include file="$(find turtlebot_navigation)/launch/includes/velocity_smoother.launch.xml"/>
  <include file="$(find turtlebot_navigation)/launch/includes/safety_controller.launch.xml"/>

And when I just added the above two lines and also the corresponded parameters setting,

     <remap from="cmd_vel" to="navigation_velocity_smoother/raw_cmd_vel"/>

Then it moved with path plans.

kane_choigo gravatar image kane_choigo  ( 2020-01-22 18:22:24 -0600 )edit

Is it imperative to set the node which has something to do with cmd_vel? (I didn't add any lines related to cmd_vel in move_base.launch indeed.)

kane_choigo gravatar image kane_choigo  ( 2020-01-22 18:29:02 -0600 )edit

You dont actually need velocity_smoother and safety_controller to navigate. The velocity_smoother is used for smoother cmd_vels while the safety_controller I guess is a wrapper around kobuki_safety_controller for bumper/cliff detection (I am not familiar with the turtlebot stack much) so in the end they are just used to improve the navigation run by move_base.

pavel92 gravatar image pavel92  ( 2020-01-23 05:39:22 -0600 )edit

Thanks for your re-relpy. However without velocity_smoother, it did not show any little movements at all. As far as I know, cmd_vel, whatever its name would be remapped, is the most essential to move a mobile robot. Actually, all that I did was launching amcl and move_base node without any kind mentions of cmd_vel, described above, move_base.launch. Does move_base node address cmd_vel inherently?

kane_choigo gravatar image kane_choigo  ( 2020-01-23 07:18:51 -0600 )edit

well move_base is the one that outputs a cmd_vel topic. The velocity_smoother just uses that topic to smooth the values I guess so probably you have some remapping mismatch somewhere in your launch files. You should check how many cmd_vel topics you have in the end and remap properly

pavel92 gravatar image pavel92  ( 2020-01-24 03:11:30 -0600 )edit

Thank you so much, I'll try it and notify you as soon as possible

kane_choigo gravatar image kane_choigo  ( 2020-01-26 23:54:51 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-01-21 20:22:01 -0600

Seen: 427 times

Last updated: Jan 22 '20