I found there are STDR and Stage simulators on ROS for SLAM and mobile robot simulation. But I’m trying to run simulations on my laptop that has really limited space, when I tried to install Stage, it requires Gazebo which is 30GBs. Are there standalone simulators? I do have Matlab if that matters.
3 Answers
I doubt if you need simulators that very specific to SLAM applications for mobile robot simulation as most of them generally tend to extend over all possible robot applications.
- V-REP is good open-source simulator with support for umpteen number of robots including mobile robots. It can be directly used via its API available in several languages and it has plugins for ROS that could be handy.
- The Webots simulator is another similar platform for robot simulation and supports several features including ROS plugins.
- Finally, there is CARLA, a car simulation platform for autonomous driving research and you could use it for SLAM applications as well.
The Robotics Toolbox for MATLAB has a simple EKF SLAM class, and the source code is open. A video animation is here:
Demonstration of EKF SLAM using Robotics Toolbox for MATLAB.
The whole example is fairly concise:
% Creating the vehicle. First we define the covariance of the vehicles's odometry
% which reports distance travelled and change in heading angle
V = diag([0.005, 0.5*pi/180].^2);
% then use this to create an instance of a Bicycle class
veh = Bicycle('covar', V);
% and then add a "driver" to move it between random waypoints in a square
% region with dimensions from -10 to +10
veh.add_driver( RandomPath(10) );
% Creating the map. The map covers a square region with dimensions from
% -10 to +10 and contains 20 randomly placed landmarks
map = LandmarkMap(20, 10);
% Creating the sensor. We firstly define the covariance of the sensor measurements
% which report distance and bearing angle
W = diag([0.1, 1*pi/180].^2);
% and then use this to create an instance of the Sensor class.
sensor = RangeBearingSensor(veh, map, 'covar', W, 'animate', 'angle', [-pi/2 pi/2], 'range', 5);
% Note that the sensor is mounted on the moving robot and observes the features
% in the world so it is connected to the already created Vehicle and Map objects.
% Create the filter. First we need to determine the initial covariance of the
% vehicle, this is our uncertainty about its pose (x, y, theta)
P0 = diag([0.005, 0.005, 0.001].^2)*1000;
% Now we create an instance of the EKF filter class
ekf = EKF(veh, V, P0, sensor, W, []);
% and connect it to the vehicle and the sensor and give estimates of the vehicle
% and sensor covariance (we never know this is practice).
% Now we will run the filter for 1000 time steps. At each step the vehicle
% moves, reports its odometry and the sensor measurements and the filter updates
% its estimate of the vehicle's pose
ekf.run(500, 'plot', 'movie', 'ekfslam.mp4');
% all the results of the simulation are stored within the EKF object
%% First let's plot the map
map.plot()
% and then overlay the path actually taken by the vehicle
veh.plot_xy('b');
% and then overlay the path estimated by the filter
ekf.plot_xy('r');
% which we see are pretty close
% Now let's plot the error in estimating the pose
figure
ekf.plot_error()
% and this is overlaid with the estimated covariance of the error.
% Remember that the SLAM filter has not only estimated the robot's pose, it has
% simultaneously estimated the positions of the landmarks as well. How well did it
% do at that task? We will show the landmarks in the map again
figure
map.plot();
% and this time overlay the estimated landmark (with a +) and the 95% confidence
% bounds as green ellipses
ekf.plot_map('g');
-
$\begingroup$ Thank your Dr. Corke! That was a great! I've been using your book as a reference , which page talks about this demo? $\endgroup$– drerDApr 3, 2019 at 22:49
-
$\begingroup$ You can find this in chapter 6 of both editions $\endgroup$ Apr 4, 2019 at 5:55
If you have MATLAB you can try out this SLAM Toolbox. There is also a more modern one that also might help.