Code Monkey home page Code Monkey logo

mcl_3dl's Introduction

mcl_3dl

Build Status Codecov License

Package summary

mcl_3dl is a ROS node to perform a probabilistic 3-D/6-DOF localization system for mobile robots with 3-D LIDAR(s). It implements pointcloud based Monte Carlo localization that uses a reference pointcloud as a map.

The node receives the reference pointcloud as an environment map and localizes 6-DOF (x, y, z, yaw, pitch, roll) pose of measured pointclouds assisted by a motion prediction using odometry.

Currently, the supported motion model is differential-wheeled-robot. The node provides classic MCL; currently, it doesn't implement adaptive feature like KDL-sampling and etc.

Algorithms

A fundamental algorithm of mcl_3dl node is Monte Carlo localization (MCL), aka particle filter localization. MCL represents a probabilistic distribution of estimated pose as density and weight of particles and estimates the pose from the distribution.

Node I/O

mcl_3dl I/O diagram

Install

from source

Note: mcl_3dl_msgs package is required to build mcl_3dl package.

# clone
cd /path/to/your/catkin_ws/src
git clone https://github.com/at-wat/mcl_3dl.git
git clone https://github.com/at-wat/mcl_3dl_msgs.git

# build
cd /path/to/your/catkin_ws
rosdep install --from-paths src --ignore-src -y  # Install dependencies
catkin_make -DCMAKE_BUILD_TYPE=Release  # Release build is recommended

from apt repository (for ROS Indigo/Kinetic/Lunar on Ubuntu)

sudo apt-get install ros-${ROS_DISTRO}-mcl-3dl

Running the demo

The example bag file of 2+4-DOF tracked vehicle with two Hokuyo YVT-X002 3-D LIDAR is available online. Pre-processed (filtered) 3-D pointcloud, IMU pose, odometry, and map data are packed in the bag.

# Download the example bag (230M)
wget -P ~/Downloads https://openspur.org/~atsushi.w/dataset/mcl_3dl/short_test3.bag

# Running the demo
roslaunch mcl_3dl test.launch use_pointcloud_map:=false use_cad_map:=false \
  use_bag_file:=true bag_file:=${HOME}/Downloads/short_test3.bag

The map data in the bag was generated by using the cartographer_ros and filtered by using pcl_outlier_removal and pcl_voxel_grid utilities.

Rviz image of the demo

MarkerArray shows several mcl_3dl internal information.

  • Purple spheres: sampled points used in the likelihood-model calculation
  • Red lines: casted rays in the beam-model calculation
  • Red boxes: detected collisions in raycasting

To try global localization, call /global_localization by the following command.

rosservice call /global_localization

Demos without odometry and without IMU are also available.

Contributing

mcl_3dl package is developed under GitHub flow. Feel free to open new Issue and/or Pull Request.

The code in this repository is following ROS C++ Style Guide. A configuration file for clang-format is available at https://github.com/seqsense/ros_style/.

License

mcl_3dl's People

Contributors

at-wat avatar daikimaekawa avatar f-fl0 avatar github-actions[bot] avatar jojo43 avatar nhatao avatar remco-r avatar ykoga-kyutech avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mcl_3dl's Issues

The demo crashes on startup of launch file

I was trying to run the 2 commands mentioned in the demo part, and the mcl node crashes on startup. When I tried to run the node standalone using rosrun, it seg faults and doesnt start.

Error occurred when I do: rosrun mcl_3dl mcl_3dl

After I "rosrun mcl_3dl mcl_3dl", there was occurred segment fault.
And I set breakpoint to find the position where cause this error. But I found that the error occurred before it going into main().
I don't know why it happened and hope you can help me.
Thanks for all.
my system is: Ubuntu 14.04, ROS indigo

Segmentation fault on ROS Melodic

In melodic-bionic docker container:

Thread 1 "mcl_3dl" received signal SIGSEGV, Segmentation fault.
0x00007ffff4b8a398 in ros::TimeBase<ros::Time, ros::Duration>::operator+(ros::Duration const&) const ()
   from /opt/ros/melodic/lib/librostime.so
(gdb) i s
#0  0x00007ffff4b8a398 in ros::TimeBase<ros::Time, ros::Duration>::operator+(ros::Duration const&) const
    () from /opt/ros/melodic/lib/librostime.so
#1  0x00007fffebec68cb in tf2_ros::Buffer::canTransform(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ros::Time const&, ros::Duration, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) const () from /opt/ros/melodic/lib/libtf2_ros.so
#2  0x00007ffff557f1bb in tf::Transformer::waitForTransform(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ros::Time const&, ros::Duration const&, ros::Duration const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) const ()
   from /opt/ros/melodic/lib/libtf.so
#3  0x00005555556ce95f in MCL3dlNode::cbPosition(boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const> const&) ()
#4  0x000055555573940d in boost::_mfi::mf1<void, MCL3dlNode, boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const> const&>::operator()(MCL3dlNode*, boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const> const&) const ()
#5  0x0000555555732ffc in void boost::_bi::list2<boost::_bi::value<MCL3dlNode*>, boost::arg<1> >::operator()<boost::_mfi::mf1<void, MCL3dlNode, boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const> const&>, boost::_bi::rrlist1<boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const> const&> >(boost::_bi::type<void>, boost::_mfi::mf1<void, MCL3dlNode, boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const> const&>&, boost::_bi::rrlist1<boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const> const&>&, int) ()
#6  0x000055555572bd5b in void boost::_bi::bind_t<void, boost::_mfi::mf1<void, MCL3dlNode, boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const> const&>, boost::_bi::list2<boost::_bi::value<MCL3dlNode*>, boost::arg<1> > >::operator()<boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const> const&>(boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const> const&) ()
#7  0x0000555555723cf4 in boost::detail::function::void_function_obj_invoker1<boost::_bi::bind_t<void, boost::_mfi::mf1<void, MCL3dlNode, boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const> const&>, boost::_bi::list2<boost::_bi::value<MCL3dlNode*>, boost::arg<1> > >, void, boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const> const&>::invoke(boost::detail::function::function_buffer&, boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const> const&) ()
#8  0x0000555555739768 in boost::function1<void, boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const> const&>::operator()(boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const> const&) const ()
#9  0x00005555557332f3 in boost::detail::function::void_function_obj_invoker1<boost::function<void (boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const> const&)>, void, boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const> >::invoke(boost::detail::function::function_buffer&, boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const>) ()
#10 0x000055555576567b in boost::function1<void, boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const> >::operator()(boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const>) const ()
#11 0x0000555555762c97 in ros::SubscriptionCallbackHelperT<boost::shared_ptr<geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const> const&, void>::call(ros::SubscriptionCallbackHelperCallParams&) ()
#12 0x00007ffff5313592 in ros::SubscriptionQueue::call() () from /opt/ros/melodic/lib/libroscpp.so
#13 0x00007ffff52be1ac in ros::CallbackQueue::callOneCB(ros::CallbackQueue::TLS*) ()
   from /opt/ros/melodic/lib/libroscpp.so
#14 0x00007ffff52bf59b in ros::CallbackQueue::callAvailable(ros::WallDuration) ()
   from /opt/ros/melodic/lib/libroscpp.so
#15 0x00007ffff53170d9 in ros::SingleThreadedSpinner::spin(ros::CallbackQueue*) ()
   from /opt/ros/melodic/lib/libroscpp.so
#16 0x00007ffff52ff7cb in ros::spin() () from /opt/ros/melodic/lib/libroscpp.so
#17 0x00005555556c4cba in main ()

Exeption handling is missing around transformPointCloud

[ INFO] [1531904197.312850706]: map received
Failed to find match for field 'intensity'.
[ INFO] [1531904197.333354421]: map original: 207430 points
[ INFO] [1531904197.333384265]: map reduced: 19706 points
[ WARN] [1531904205.030996286]: Detected time jump in imu. Resetting.
terminate called after throwing an instance of 'tf2::ConnectivityException'
  what():  Could not find a connection between 'odom' and 'laser1_link' because they are not part of the same tree.Tf has two or more unconnected trees.
[mcl_3dl-1] process has died [pid 43, exit code -6, cmd /opt/ros/kinetic/lib/mcl_3dl/mcl_3dl cloud:=/cloud_localization __name:=mcl_3dl __log:=/root/.ros/log/77a5e28c-8a68-11e8-addf-0242ac130005/mcl_3dl-1.log].

if (!pcl_ros::transformPointCloud(frame_ids_["odom"], *msg, pc_bl, tfl_))

accuracy issue

Thank you for the excellent work! Really impressive!!

I have successfully used the mcl_3dl to get localization in my own bag, including imu, odom, velodyne hdl-64 cloud data and pcd map(194M). The accuracy of my map is 20cm, however, the average position error is nearly 30m, could u pls give some advices to promote it?thanks u.

attached file is the loaded png map which generated by cartographer using velodyne hdl-64.
map_for_localization_xray_xy

with regards.

No test.launch in the packages

We cannot launch the demo because the released packages don't contain test.launch. Please add setting to CMakeLists.txt . Thanks.

no-odom no-imu version

By any chance, could you provide an example without the usage of odometry and imu? That is only use the 3D Lidar scans for localization.

Thanks!

Error arise when catkin_make (undefined reference to `boost::chrono::steady_clock::now())

Hi, @at-wat

Thanks for your work on this package, I encountered an issue bellow when I catkin_make this package. do you have any idea about this question?

Thanks a lot.

CMakeFiles/mcl_3dl.dir/src/mcl_3dl.cpp.o: In function MCL3dlNode::cbCloud(boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&)': mcl_3dl.cpp:(.text._ZN10MCL3dlNode7cbCloudERKN5boost10shared_ptrIKN11sensor_msgs12PointCloud2_ISaIvEEEEE[_ZN10MCL3dlNode7cbCloudERKN5boost10shared_ptrIKN11sensor_msgs12PointCloud2_ISaIvEEEEE]+0xd17): undefined reference to boost::chrono::steady_clock::now()'
mcl_3dl.cpp:(.text._ZN10MCL3dlNode7cbCloudERKN5boost10shared_ptrIKN11sensor_msgs12PointCloud2_ISaIvEEEEE[_ZN10MCL3dlNode7cbCloudERKN5boost10shared_ptrIKN11sensor_msgs12PointCloud2_ISaIvEEEEE]+0x3eeb): undefined reference to `boost::chrono::steady_clock::now()'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/wenws/19_mcl3d/devel/lib/mcl_3dl/mcl_3dl] Error 1
make[1]: *** [mcl_3dl/CMakeFiles/mcl_3dl.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j8 -l8" failed

segmentation fault (core dumped) when run mcl_3dl mcl_3dl

First, Thanks for your excellent work!

I catkin_make your package in my workplace successful, but when I run mcl_3dl mcl_3dl, it terminal indicates that "segmentation fault (core dumped)". my configuration is Ubuntu14.04+ROS indigo.

Also I checked the issue and do as the way in [http://stackoverflow.com/questions/26346690/debug-seg-fault-in-boostmathlanczos-with-libpcl-surface] but it do not work.

when I run roslaunch mcl_3dl test.launch use_pointcloud_map:=false use_cad_map:=false use_bag_file:=true bag_file:=${HOME}/Downloads/short_test.bag, the terminal indicates that [mcl_3dl-4] process has died [pid 8762, exit code -11, cmd /home/wws/5_navigation/devel/lib/mcl_3dl/mcl_3dl ~/cloud:=/cloud ~/mapcloud:=/mapcloud ~/odom:=/odom ~/imu:=/imu/data ~/initialpose:=/initialpose __name:=mcl_3dl __log:=/home/wws/.ros/log/3a977640-2bbd-11e7-9d57-58fb8450c62f/mcl_3dl-4.log].
log file: /home/wws/.ros/log/3a977640-2bbd-11e7-9d57-58fb8450c62f/mcl_3dl-4
.log
*

I have Google constantly but I still did not handle it.

initialization of the first epoch

Hi @at-wat ,
Thanks for your great work on this package. Currently, the first position of this package is given manually. but if the initial position is not given accurately, it may fail to initialize. how big the error of the initialization is acceptable in this package?

best,
welson

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.