Giter Club home page Giter Club logo

emcl2's Introduction

emcl2: mcl with expansion resetting (version 2)

test

ROS 2 version is available!!

emcl is an alternative Monte Carlo localization (MCL) package to amcl (http://wiki.ros.org/amcl). Differently from amcl, KLD-sampling and adaptive MCL are not implemented. Instead, the expansion resetting and other features are implemented12.

This package is an improved version of ryuichi/emcl. This version works well in crowded or outdoor environments.

demo movies

Nodes

emcl2_node

This node calculates the alpha value with a different algorithm than emcl_node in ryuichi/emcl. This node counts the particles that make lasers penetrate occupancy cells. Specifically, this node chooses some particles at a rate of ~extraction_rate and checks each of them with the following procedure:

  • maps a set of laser scan on the occupancy grid map based on the pose of the particle
  • judges the pose of the particle as wrong if all of lasers in a ~range_threshold[rad] range penatrate occupancy grids

If the rate of the wrong particles is greater than ~alpha_threshold, the node invokes a reset.

This node also has a sensor resetting algorithm. When ~sensor_reset is true, a particle with laser penetration is dragged back from occupied cells.

Subscribed Topics

Published Topics

Services

  • global_localization (std_srvs/Empty)
    • Initiate global localization, wherein all particles are dispersed randomly through the free space in the map.

Services Called

parameters

  • ~odom_freq (int, default: 20 [Hz])
    • frequency of odometry update
  • ~num_particles (int, default: 1000)
    • number of particles
  • ~odom_frame_id (string, default: "odom")
    • the frame for odometry
  • ~footprint_frame_id (string, default: "base_footprint")
    • the frame of the localized robot's base
  • ~base_frame_id (string, default: "base_link")
    • the frame of the robot's base. It is used for calculating the position and orientation of the LiDAR.
  • ~global_frame_id (string, default: "map")
    • the frame for localization
  • ~initial_pose_x (double, default: 0.0 [m])
    • initial x coordinate of particles
  • ~initial_pose_y (double, default: 0.0 [m])
    • initial y coordinate of particles
  • ~initial_pose_a (double, default: 0.0 [rad])
    • initial yaw coordinate of particles
  • ~odom_fw_dev_per_fw (double, default: 0.19 [m/m])
    • standard deviation of forward motion noise by forward motion
  • ~odom_fw_dev_per_rot (double, default: 0.0001 [m/rad])
    • standard deviation of forward motion noise by rotational motion
  • ~odom_rot_dev_per_fw (double, default: 0.13 [rad/m])
    • standard deviation of rotational motion noise by forward motion
  • ~odom_rot_dev_per_rot (double, default: 0.2 [rad/rad])
    • standard deviation of rotational motion noise by rotational motion
  • ~laser_likelihood_max_dist (double, default: 0.2 meters)
    • maximum distance to inflate occupied cells on the likelihood field map
  • ~scan_increment (int, default: 1)
    • increment number when beams are picked from their sequence; the larger this number is, the fewer number of beams are used for calculation of likelihood
  • ~alpha_threshold (double, default: 0.5)
    • threshold of the alpha value for expansion resetting
  • ~open_space_threshold (double, default: 0.05)
    • threshold of the valid beam rate for expansion resetting; the reset doesn't occur when the rate of beams in the valid range is smaller than this threshold
  • ~expansion_radius_position (double, default: 0.1[m])
    • maximum change of the position on the xy-plane when the reset replaces a particle
  • ~expansion_radius_orientation (double, default: 0.2[rad])
    • maximum change of the yaw angle when the reset replaces a particle
  • ~extraction_rate (double, default: 0.1)
    • rate of particles that are checked by the node
  • ~range_threshold (double, default: 0.1[rad])
    • threshold of the range of lasers; if all lasers on this range penetrate occupancy cells, the pose of the particle is judged as wrong
  • ~sensor_reset (bool, default: true)
    • flag for sensor resettings

The followings have never been implemented yet.

  • ~laser_min_range (double, default: 0.0[m])
    • threshold for discarding scans whose ranges are smaller than this value
  • ~laser_max_range (double, default: 100000000.0[m])
    • threshold for discarding scans whose ranges are larger than this value

usage examples

ROS version

  • ROS Noetic Ninjemys (on Ubuntu 20.04 LTS, test on my note PC)
  • ROS Melodic Morenia (on Ubuntu 18.04 LTS, test on GitHub Actions)

citation

Footnotes

  1. R. Ueda: "Syokai Kakuritsu Robotics (lecture note on probabilistic robotics)," Kodansya, 2019.

  2. R. Ueda, T. Arai, K. Sakamoto, T. Kikuchi, S. Kamiya: Expansion resetting for recovery from fatal error in Monte Carlo localization - comparison with sensor resetting methods, IEEE/RSJ IROS, pp.2481-2486, 2004.

emcl2's People

Contributors

ryuichiueda avatar atinfinity avatar uhobeike avatar

Stargazers

 avatar theme avatar Reo avatar Ginga Kennis avatar  avatar LotfiZZ avatar Kotakku avatar Gakuto Okamoto avatar h-wata avatar Juwon Kim avatar IkuoShige avatar  avatar  avatar Dmitry Klimenkov avatar KOMSEA avatar hario avatar  avatar  avatar  avatar Kim JeongHan avatar Daisuke Sato avatar haruyama kenta avatar Hideo avatar devemin avatar Tatsuya Matsushima avatar  avatar KosukeNakamura avatar liyunlong avatar injae hwang avatar  avatar zhanghairong avatar xtao avatar 然 avatar ChunChun avatar

Watchers

 avatar Tatsuya Matsushima avatar CS3-Zhang avatar

emcl2's Issues

how to receive map for localization

Hello sir

thank you so much to share your great work.

I have two questions.

I publish the map by map server for subscribing map

is it worked in your pkg?

    <node pkg="map_server" type="map_server" name="map_server_localization" args="$(arg map_config_loc)">
    <remap from="map" to="map_localization" />
    </node>

also

I think your emcl2.launch file has a mistyping

  <!-- EMCL -->
  <node pkg="emcl" type="emcl2_node" name="emcl2_node" output="screen">

    <param name="odom_freq"                 value="20"/>
    <param name="num_particles"             value="500"/>

    <param name="odom_frame_id"             value="seromo_1/odom"/>
    <param name="footprint_frame_id"        value="seromo_1/base_footprint"/>
    <param name="base_frame_id"    

this should be changed as...

  <!-- EMCL -->
  <node pkg="emcl2" type="emcl2_node" name="emcl2_node" output="screen">

    <param name="odom_freq"                 value="20"/>
    <param name="num_particles"             value="500"/>

    <param name="odom_frame_id"             value="seromo_1/odom"/>
    <param name="footprint_frame_id"        value="seromo_1/base_footprint"/>
    <param name="base_frame_id"             value="seromo_1/base_link"/>

can you help me a little bit?

I wanna experiment with your great work.

thank you so much

best regards

Local costmap does not overlap with global map

emcl2_221221_6


Dear Prof.,

It occurs sometime a trobule that a local costmap does not overlap with the global map in the navigation by move_base using emcl2.

Is this problem due to a non-convergence of emcl2 localization caluculation ? OR
Is its problem due to a set of parameters that are related with move_base/costmap/dwa ?

Could you like advise to solve this problem ?
I send a picture of simulation result.
Left side: gazebo
Right side: rviz

Best Regards

Can't get lidar pose

Dear Prof @ryuichiueda ,

I'm running your emcl2 to localize turtlebot3_burger on gazebo. But it get

can't get lidar pose info

Meanwhile, my .launch file here:

<?xml version="1.0"?>
<launch>
  <!-- Set tf -->
  <node pkg="tf" type="static_transform_publisher" name="world_to_map" args="0 0 0 0 0 0 world map 100" />

  <!-- Arguments -->
  <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
  <arg name="map_file" default="$(find turtlebot3_navigation)/maps/custom_world.yaml"/>
  <arg name="open_rviz" default="false"/>
  <arg name="move_forward_only" default="false"/>

  <!-- Turtlebot3 -->
  <include file="$(find turtlebot3_bringup)/launch/turtlebot3_remote.launch">
    <arg name="model" value="$(arg model)" />
  </include>

  <!-- Map server -->
  <node pkg="map_server" name="map_server" type="map_server" args="$(arg map_file)"/>

  <!-- AMCL -->
  <!-- <include file="$(find turtlebot3_navigation)/launch/amcl.launch"/> -->
  
  <!--EMCL-->
  <include file="$(find turtlebot3_navigation)/launch/emcl2.launch"/>
  
  <!-- move_base -->
  <include file="$(find turtlebot3_navigation)/launch/move_base.launch">
    <arg name="model" value="$(arg model)" />
    <arg name="move_forward_only" value="$(arg move_forward_only)"/>
  </include>

  <!-- rviz -->
  <node if="$(arg open_rviz)" name="rviz" pkg="rviz" type="rviz" args="-d $(find turtlebot3_navigation)/rviz/turtlebot3_navigation.rviz"/>
</launch>

And this is my emcl2.launch:

<?xml version="1.0"?>
<launch>
  <!-- Arguments -->
  <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"/>

  <!-- EMCL2 -->
  <node pkg="emcl2" type="emcl2_node" name="emcl2_node" output="screen">

    <param name="odom_freq"                 value="20"/>
    <param name="num_particles"             value="3000"/>

    <param name="odom_frame_id"             value="odom"/>
    <param name="footprint_frame_id"        value="base_footprint"/>
    <param name="base_frame_id"             value="base_link"/>

    <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_fw_dev_per_fw"       value="0.1"/>
    <param name="odom_fw_dev_per_rot"      value="0.1"/>
    <param name="odom_rot_dev_per_fw"      value="0.1"/>
    <param name="odom_rot_dev_per_rot"     value="0.1"/>

    <param name="laser_likelihood_max_dist" value="2.0"/>

    <param name="alpha_threshold" value="0.5"/>
    <param name="open_space_threshold" value="0.05"/>

    <param name="expansion_radius_position" value="0.1"/>
    <param name="expansion_radius_orientation" value="0.2"/>

    <param name="range_threshold" value="0.3"/>

    <remap from="scan"                      to="$(arg scan_topic)"/>
    <param name="laser_min_range"           value="0.02"/>
    <param name="laser_max_range"           value="8.0"/>

    <param name="scan_increment"           value="0.015"/>

  </node>
</launch>

My tf_tree has no map->odom. Please help me fix it. Thank you very much

change map

Hello, Sir
My robot have a signal lost_detected from sensor and I use emcl2 for re-localize robot when its lost.

But My robot can change its map while navigate with nav-stack(amcl) so when its lost in a new map.
How can I change map in emcl2

how to fix (or avoid) the situation where /map->/odom tf is not updated (/map->/odom tfが更新されない時の対処法)

When the /emcl2_node tries to publish /map->/odom tf, sometimes the error "Lookup would require extrapolation into the future." occurs.
This error can be found on rqt_console , "Failed to subtract base to odom transform".

if this error occurs, /map->/odom tf almost never updates.

In order to avoid this situation, you may need to rewrite this line as below

tf_->transform(tmp_tf_stamped, odom_to_map, odom_frame_id_);

tf_->transform(tmp_tf_stamped, odom_to_map, odom_frame_id_, ros::Duration(1.0);

以下日本語
/emcl2_nodeが/map->/odom tfを更新する際、稀に内部で"Lookup would require extrapolation into the future." エラーを起こす事があります。
このエラーはrqt_consoleで"Failed to subtract base to odom transform"と表示されます。
(デフォルトの設定だとターミナル上には表示されません。)

このエラーが起こると /map->/odom tfは殆ど更新されなくなります。(ごく稀に更新されます。)

このエラーを修正・回避したい場合、以下のコードを変更する必要があります。

tf_->transform(tmp_tf_stamped, odom_to_map, odom_frame_id_);

tf_->transform(tmp_tf_stamped, odom_to_map, odom_frame_id_, ros::Duration(1.0);

tfが更新されない理由には他にもlaunchファイルの設定ミスやtopic名の違いなどもあり得ますが、最近このエラーで躓いたので後進の者のためにここに書き記しました。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.