-
Notifications
You must be signed in to change notification settings - Fork 2
ROS packages for versatile RBPF-based SLAM (By: Vladislav Tananaev) #3
Comments
Student: @Logrus |
Hi @jlblancoc and @buzzer, thank you again for the opportunity to take part in this project! I was also wondering if this issue MRPT/mrpt#193 is related to the project. I could try to provide the descriptions while also learning the code structure. If there are some links or materials that you think may assist understanding of the relevant parts of the library, I would appreciate having them. :) |
Welcome on board! Actually, yes, I intended to solve that issue by the time GSoC started but... I'm swamped with other projects and just couldn't found spare time for it. As an Master student in Robotics, I'm sure that you could indeed help with the documentation, it would be great for the rest of users and also a perfect initial task to get into the nuts of MRPT RBPF code. Any doubt you find in the way, just come back here and we'll discuss it, ok? As you'll see, there is a complex network of C++ classes involved. As someone having to face it for the first time, if you need to draw a graph with the relationship between the different classes, it will be also interesting to show it in the docs ;-) Some hints to start (I recommend you going thru the sources of all these guys):
I think that all these comments above may not even described like that in the Dox docs, so feel free of fork+PR with any annotations you see useful to improve their docs. Cheers! |
Thank you for the pointers! |
Hi Vladislav, Congratulations for getting accepted! Best, |
@buzzer, Thanks! @buzzer, @jlblancoc I have a question about fakeActs in CMetricMapBuilderRBPF. Additionally, while examining code, I think I have found where to add a missing interface for pfAuxiliaryPFStandard. I am not sure that this is the correct way of doing it though, but it seems to be working. Here the small commit in my fork: Logrus/mrpt@2ab542a Regarding documentation, I see that classes are well described already, so at the moment I don't see anything that I can add. The CRTP idiom is new for me, so I haven't fully understood this part yet. |
Hi!
Mainly for efficiency (typically, one may have odometry at >10Hz) but it also has an important implication: every time the RBPF is updated, the weights of particles got updated via the sensor likelihood function (or more complex formulas depending on
Good! That's probably because we never used that combination in any paper, but it's a new legal and valid RBPF algorithm 👍
Think of it as an efficient (and flexible) way of doing virtual classes. Alexandrescu, Andrei (2001). Modern C++ Design: Generic Programming and Design Patterns Applied. Addison-Wesley. ISBN 0-201-70431-5. |
Thanks for clarification! I thought that this can result in better stability of the filter.
Sure, I will report back whether I have problems or it is working fine with different datasets.
It looks like I can access it at the university library. I will read it, thanks! |
Hi,
I made several tests with my simulated datasets and with default configs. No exceptions were raised.
I didn't test I created a PR MRPT/mrpt#252. |
Hi @Logrus ! I think that one of the first things to think about, is deciding how many different ROS packages to build (or maybe just one?), and its interface in terms of input ROS msgs and such... After all the experience you have gained these weeks, what are your thoughts about this? It's strictly necessary to think and discuss a bit about this before getting hands on coding, as you can imagine :-) |
Hi @jlblancoc, Currently I am exploring how ROS pf_localization is made by replicating parts of the code myself. I want to make my own wrapper for mrpt pf_localization by the end of the week, in order to get hands on experience on how to wrap mrpt for the ROS packages. I will probably be ready to discuss in details next steps after that. But from what I have learned so far, I think to start from building around CMetricMapBuilderRBPF class like rbpf-slam.cpp app does. |
Great! Let us know when you want to discuss some point or if you have
several alternatives and want to learn our opinion.
|
@jlblancoc Thanks for support! I am looking into mrpt_ro_slam package made by Raffi and compare it to mrpt_localization that I've been exploring so far. There are a lot in common including stubs for handling laser data. So it seems logical to extend it to full functionality. Besides, it is already called RBPFSlamNode in code. Also, I have noticed that in MRPT after running rbpf-slam configs for the first time, in all consecutive runs the interactive window doesn't show up unless I remove LOG_* folder. Is it the desired behavior? |
I think it'll be perfect to start your own version from scratch, which is always easier than getting into someone's else code ;-) Eventually, when the functionality of mrpt_ro_slam is superseded by yours, we might probably just delete it and update the docs. On the To rule out this possibility, watch for this error message in |
Hi @jlblancoc! Last week I went through the code in mrpt_localization package and mrpt_ro_slam. I started to code the package mrpt_rbpf_slam. So far I've done the visualization of the grid map slam from rawlog file in rviz.
This week I am also going to do visualization for ro slam in order to understand how to visualize the ro map in rviz. When it comes to the structure of the package, currently I am thinking about the next one: There will be just two files:
mrpt_slam_wrapper.h (and mrpt_slam_wrapper.cpp) with functions:
My plan for this week: Complete the visualization for ro slam for rawlog replay. I also have some questions:
So that's it so far. |
Good @Logrus ! In principle, go ahead with that structure and we'll see if it has to be changed later. On your doubts:
Neither it is to me! If it's simpler, just go on with a single SLAM package which, itself, is in charge of publishing the map to a topic and/or offering it via a service. Simpler = better.
Easy solution: keep the latest odometry pose ("global pose in the odometry TF", in ROS parlance) in a variable and, whenever a new observation arrives (and the mapper is idle so it can accept it), build the pair observation + odometry increment, using a copy of the latest "global odometry pose", then update that copy with the new odometry pose. If the timestamp interval is small enough, the correction will be within the uncertainty model of the odometry, so everything should be OK. Also: Take a look at this class. Just as a cool idea to be added after the basics work: that class takes localization/SLAM pose estimations and odometry, each at its own rate (odometry is typically much faster) and "compose them" and even, if needed, extrapolate the odometry, so one can ask the class "what is the robot pose now?" and you'll have a good estimation, not the one from the last time localization/SLAM did run. It will work great if odometry provides velocity, otherwise, it will default to the last odometry position but anyway will be more accurate than the last SLAM output, specially when SLAM is slow to run...
It's fine! |
Hi @Logrus, Just wanted to hear about your progress with the new package. I didn't found it online on your GitHub fork, are you routinely committing and pushing?? Let us know if you need further advice on something from my last message. Cheers, |
Hi Jose, Sorry for the late reply. The problem is that this execution of one slam update takes some time (approx 0.5 sec), and during this time the callback function doesn't receive any messages. To run the online grid map slam (played from rawlog file by using mrpt_rawlog node):
To run the online beacon slam:
To run replay slam from rawlog files:
In the last two launch files there is a parameter "rawlog_play_delay" which affects the speed of visualization of the slam. I also tried online slam by using turtlebot simulator and compared it with gmapping:
The instruction for launching gmapping: For convenience, I will write all commands here: Running robot key controls: Running SLAM: That's it so far. I've updated my repo on github. My plans right now are: The goal is to prepare package for the pull request and the first submission to the end of the next week. I also have a couple of questions: That's it so far! Thanks! Best regards, |
Hi! I'm on a trip on the smartphone so I'll answer all later but just a Escrito desde Zapatófono, disculpe la brevedad. |
But I don't understand why it always takes so long: there are some
Mmm... that's really serious! I think that then we should add a second If we have to choose between getting a delayed solution to SLAM or an Let me know if you need help or assistance with anything of this new thread.
I think that is a useful idea! Don't waste time trying to run "online"
Great! I'll have to test them later since I don't have access right
Good!
What's your starting point for this? Do you already know to access to
In localization it makes sense, but in SLAM (in a first version, where Best, |
Hi, Jose! Thank you very much for so many good hints!
I will check my code maybe I am doing something inefficient (for example using variables isntead of pointers) in order to improve the speed of SLAM and I will also figure out how to add the second processing tread for SLAM (I think it is necessary anyway because it will increase the speed).
Right now it is necessary to write the name of the rawlog file in the launch file:
Then the slam node checks: if this file exists it will read from rawlog, otherwise it will run online slam. 3). Regarding the map_metadata topic: Thank you for the hint I will go through gridmap c++ class and I will retrieve metadata after topic/map will receive the first map. Best regards, |
On your point no. 2: it is perfect like that! Just dont forget documenting I think you have permissions to edit the ros wiki, let us know if you need El 13/06/2016 15:51, "Vladislav Tananaev" [email protected]
|
Hi Jose, This week I cleaned the code, added map metadata and doxygen comments. I also mostly tried to increase the speed of the SLAM. I found out that the first three SLAM algorithms (0 - pfStandardProposal, 1 - pfAuxiliaryPFStandard, 2 - pfOptimalProposal) works online without any delay. So, you were right, when you said that the SLAM should output results almost immediately. So I made some videos in order to show you how everything works so far. Here the example of online gridmap slam from rawlog: Here the example of ro online slam: Could you also try to run the SLAM on your computer in order to check how fast it works? For convenience, here the commands: To run online gridmap slam :
(You can change the type of the SLAM algorithm in From rawlog:
For ro slam:
from rawlog:
And I didn't delete the turtlebot simulator launch file, because it is nice to try the slam on gazebo simulator with turtlebot: So that is it so far. I am looking forward for your feedback regarding the speed of the slam (or anything else). If everything is fine I will make a pull request and also update ros wiki about using SLAM with rawlog files. I have a question concerning the rawlog file: Thanks! |
Great @Logrus ! Thanks for all the videos. I've been on an unexpected trip during the last week so I couldn't take an in-depth look at your code yet, but will do it ASAP and let you know about any pending issues to be solved before the midterm evaluation... Cheers |
Hi @jlblancoc , I have completed the midterm evaluation form. Regards |
I just filled in your evaluation... so far, very good work! 👍 The rules said that you should create the PR but I tested everything in my computer and it builds ad runs cleanly, so we can work on the PR now after the midterm evaluation is done. In general, all your code and example files are simply perfect as far as I saw. Just some small comments on the next steps:
Keep up the hard work! |
Hi Jose! Thank you very much for the kind feedback and good evaluation of my work.
Of course I will.
I will figure out the way how to make it this week.
The last supported version of the turtlebot simulator is Indigo (I am using ROS Indigo because this is so far one of the most stable version ). I will try to find alternative simulator for kinetic but I am not sure that something like that exists because I wasn't able to find turtlebot simulator even for Jade version.
I will prepare everything to the end of this week and report to you here. Thank you! Best wishes, |
Take a look at mvsim package as an alternative simulator. Any feedback(or
pull-request!) for it will be also welcome :-)
|
Sure, I will do this. Thank you very much for the hint! |
Hi Jose, I checked out the mvsim. And add the launch files into mvsim tutorial folder for slam. Here the video how it works: https://www.youtube.com/watch?v=vEjsDGCdkjw Concerning visualization for ro slam I haven't done it yet, because it is a bit harder than I thought. I also checked folders of the mrpt_slam. I deleted ro_slam but I am not sure about mrpt_icp_slam_2d package. Concerning the ekf_slam_2d and ekf_slam_3d I think it would be nice from my side to make wrappers also for this two packages. During my work with mrpt library I saw so many stuff implemented inside. It is years of work. That is amazing! So if it will be ok, I can spend the rest of the GSOC on this tasks. Of course I will do everything that you ask me for rbpf slam. |
Please, see also:
/mrpt_ekf_slam_2d_wrapper.h:24:44: fatal error:
visualization_msgs/MarkerArray.h: No such file or directory
compilation terminated.
From http://build.ros.org/job/Kdev__mrpt_slam__ubuntu_xenial_amd64/1/
Maintaining open source is this complicated!! ;-)
|
Hi Jose! I added ifdefs to check the version of MRPT and also visualization_msgs dependency and created a pull request. I still get an error with CActionRobotMovement3D though, since it is different in previous MRPT version and therefore mrpt_ekf_slam_3d doesn't compile. Best wishes, |
Hi! I investigated the error regarding CActionRobotMovement3D and the only way out I see is... to just ignore odometry in 3D EKF-SLAM if built against older versions of MRPT! I also fixed other minor things, take a look at the latest commits in: https://github.com/mrpt-ros-pkg/mrpt_slam/commits/master Cheers! |
I fixed many errors, but there is still one more: https://travis-ci.org/mrpt-ros-pkg/mrpt_slam/builds/153132252 Enough for today, let's continue tomorrow! Let me know if you make any progress fixing the build in that old |
Hi Jose, Thank you very much for you help! I made an if statement in CMake that prevents mrpt_ekf_slam_3d from building (Logrus/mrpt_slam@8edbb21) if the user has MRPT version lower than 1.5.0. I think it is generally better to exclude the node that will not work correctly from built. What do you think? Apparently, after fixing this error there's another in I also built ROS nodes against the version from ppa. At the current state, it still complains on the 3D motion model and Thanks! Best, |
In general, it's a better idea, ok! But when all nodes build cleanly in the matrix of Ubuntu versions / ROS versions, I'll try to do the first binary release (i.e. what allows people to do
Right! I'm right now sending the latest master version to the PPA, let's see if all go ok and packages become available within hours...
That would be wonderful... but there is a huge queue of PPAs waiting to be accepted in travis (they don't allow PPAs by default), and PCL and MRPT are in one of their tickets... waiting till ~0.5-1 year ago, so I guess they don't want to allow more PPAs into their systems :-( |
Great! I will update and check if everything builds, then I'll create a pull request.
That is unfortunate... Otherwise we can of course download and build MRPT master branch, but this will add additional 30 min build time. But as far as I can see Travis limits jobs to 50 minutes, so this still could work. |
I have just found this in travis docs: It seems that it should be possible to install from ppa, we can try. :) |
Hi Jose! I added installation from ppa and it seems to be working (https://travis-ci.org/Logrus/mrpt_slam/builds/153572469), but the ppa isn't updated yet. I also updated ROS wiki (example):
I didn't understand how this part is working. Is it generated only from time to time? Thanks! |
Great! I don't know why then I discarded this choice months ago, but if it works, let's go that way!
Yes, I know... it seems there is some problem installing the .so files for the new library (it was previously a header-only lib)
I'll try to figure out a solution ASAP...
Fantastic! I think it's perfect, as you know, much better than many other ROS packages out there ;-)
I can see text by you, perhaps you had a problem with the cache?? http://wiki.ros.org/mrpt_icp_slam_2d |
Hi Jose! I created a pull request with the latest changes. As soon as ppa is updated we hopefully have a green build. Anyways, I will keep an eye on it and correct if errors appear.
Sorry! I think I figured out what was wrong and everything works fine now. So no worries. ;) Is there anything else I should do before filling the final GSoC evaluation? Thanks! Best wishes, |
For some reason, only part of the distro list were updated yesterday,
but the good news is that I fixed the problem and now they build
Debian packages cleanly again.
I've just re-uploaded the missing distros (xenial, vivid, trusty), so
expect them to be available in the PPA within hours.
Cheers
|
It builds now! But in mrpt_bridge one test is failing for some reason; https://travis-ci.org/Logrus/mrpt_slam/builds/153580500 Best, |
Yes! I just fixed the unit test in mrpt_bridge. You can proceed with ending GSoC, for me all you did is more than perfect! Congrats! 👍 But before releasing binary ROS packages with bloom-release, I would like to do one more final change to @bergercookie 's |
It was quick. Please, take a look at this commit, hopefully it's selfexplanatory ;-) I would love to see every call from {icp,ekf,rbpf}-slam nodes, redirected to ROS logging system (keeping the same "severity"/verbosity level, etc.), which will make the nodes easier to debug with standard ROS tools, don't you agree?? No rush at all, though... |
Totally agree, although I am not sure what would be the best way of doing it. I made some commits, this Logrus/mrpt_navigation@3c4a247 and this Logrus/mrpt_slam@1d63d81. It works, but MRPT messages are shown along with ROS logger. If I set Additionally, I have finished with ROS wiki. I added description of topics, parameters and tf transforms to all packages. And finally, I finished GSoC evaluation. If you think that logging is fine I'll make a pull request. Thanks! Best wishes, |
Brilliant, you are fast!!
I have fixed it: MRPT/mrpt@512833e So, yes, do the PR, your code shouldn't change. Just, make sure of protecting the code involving COutputLogger so it doesn't get built against mrpt < 1.5.0 (rosLoggerLvlToMRPTLoggerLvl() seems to be visible...). All in all... excellent! 👍 |
Hi Jose! I created pull requests, now only ROS logs are displayed. So it seems to be working fine. I also noticed that some of the outputs have additional newline symbol, so that after them an empty line is printed, but this is coming from Best wishes, |
Oh! Could you please add a few code lines to strip such final chars,
please?
Also, please take a look at
https://travis-ci.org/mrpt-ros-pkg/mrpt_slam/builds/154228887
|
I created a PR for this. It's a bit ugly, I am not sure if it is possible to make it nicer :)
My guess is that the version in PPA doesn't have Is the current version in PPA is the latest? If so, I am not sure why this error happens... |
Sure, that is the problem :-) I mistook that Travis error with another one which was complaining because of Eigen being missing, but can't locate it now. |
Officially, this GSoC project can be considered as closed. |
Hi Jose! Thanks for the really superb mentoring and opportunity to participate in GSoC with MRPT! Working with you and your library was a constant joy and really an outstanding experience! I learned a lot. I will of course keep maintaining the ROS packages, fix errors and keep them up-to-date with MRPT updates. I am also looking forward for possible collaborations in the future! Thank you! Best wishes, |
Initial description
Mobile Robot Programming Toolkit (MRPT) implements a versatile Rao-Blackwellized Particle Filter (RBPF) for practical robotics applications. At present, there are no Rao-Blackwellized Particle Filter ROS packages with such broad range of features. The existing slam_gmapping ROS package, which is based on gmapping from OpenSLAM, uses only grid-based maps from laser data. The implementation from the MRPT library can work simultaneously with multiple instances of grid-based maps, point maps, beacon maps and combinations of them. Moreover, MRPT provides several types of Particle Filters such as PF with Standard and Optimal [Grisetti et al., 2007] Proposals, as well as an Approximate Optimal Sampling [Blanco et al., 2008a]. Thus, existing slam_gmapping package features only a subset of this functionality and robotics community will benefit greatly from being able to use implementation offered by MRPT library. Therefore, the goal of this project is to provide MRPT-powered ROS packages for Rao-Blackwellized Particle Filter.
Progress: All comments below reflect the interactions between the GSoC student and the mentor(s).
Final results:
The text was updated successfully, but these errors were encountered: