• Stars
    star
    236
  • Rank 170,480 (Top 4 %)
  • Language
    C++
  • License
    GNU Lesser Genera...
  • Created over 4 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ORB-SLAM2 map saving and loading for closed circuit localization

This project provides a ROS package for localization of an autonomous vehicle. The localization is based on a map consisting of ORB features. The mapping and localization module is taken from the ORB-SLAM2 implementation. Our project builds on top of the ROS-enabled version. In this extensions the map of ORB-features be saved to the disk as a reference for future runs along the same track. At high speeds, a map-based localization, may be prefered over a full SLAM due to better localization accuracy and global positioning reference. The use-case for the presented system is a closed circuit racing scenario. In a first step, we create a map at low speeds with a full SLAM. In further runs at higher speeds, we localize on the previously saved map to increase the localization accuracy. The usage is demonstrated with an example from the KITTI dataset. The flow chart of the extended functionality is shown in Figure 1.

Installation of Dependencies

The system is tested on Ubuntu 16.04. The system is depended on the following libraries as used by the original ORB-SLAM2 implementation:

OpenCV

We use OpenCV to manipulate images and features. Dowload and install instructions can be found at: http://opencv.org. Required at leat 2.4.3. Tested with OpenCV 2.4.11 and OpenCV 3.2.

Eigen3

Required by g2o. Download and install instructions can be found at: http://eigen.tuxfamily.org. Required at least 3.1.0.

ROS

ROS is required with this extended version since it offers the ORB-SLAM2 functionality in form of a ROS package and uses topic broadcasts to publish information for the camera position as a TransformationFrame, map points as PointCloud and the tracking state as String. Tested with ROS Kinetic Kame

Boost

The Map save/load extension uses the boost serialization library libboost_serialization. Install via:

sudo apt install libboost-serialization-dev

Octomap - ROS

Install the octomap ROS package via:

sudo apt-get install ros-kinetic-octomap ros-kinetic-octomap-mapping ros-kinetic-octomap-msgs  ros-kinetic-octomap-ros ros-kinetic-octomap-rviz-plugins ros-kinetic-octomap-server

Installation

  • Clone this repository in the src folder of a catkin workspace. For example:
cd catkin_ws/src
git clone https://gitlab.lrz.de/perception/orbslam-map-saving-extension
  • Build the package
cd ..
catkin_make
  • Source the workspace
source devel/setup.bash
  • Extract the ORBVoc.txt file in orb_slam2_lib/Vocabulary
cd src/orbslam-map-saving-extension/orb_slam2_lib/Vocabulary
tar -xf ORBvoc.txt.tar.gz
  • Transform the vocabulary file ORBvoc from .txt to .bin for faster loading
./bin_vocabulary

Usage Example

We demonstrate the usage of the package with example data from the KITTI dataset. This example consists of four steps. 1 - Download and convert Kitti data to compatible format 2 - Save an ORB feature map of the Kitti data 3 - Load the ORB map and perform localization at higher speeds. 4 - Visualize the mapping and localization trajectories:

1 - Prepare Kitti example data

  • Install kitti2bag for transforming RAW Kitti data to ROS bags.
pip install kitti2bag
  • Download the synced+rectified and calibration data of a KITTI RAW sequence. We choose the data 2011_09_30_drive_0027 of the Residential category:
$ wget https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_30_drive_0027/2011_09_30_drive_0027_sync.zip
$ wget https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_30_calib.zip
$ unzip 2011_09_30_drive_0027_sync.zip
$ unzip 2011_09_30_calib.zip
  • Transform the RAW data to a ROS bag
kitti2bag -t 2011_09_30 -r 0027 raw_synced

The rosbag should be located at $(env HOME)/datasets/KITTI/kitti_2011_09_30_drive_0027_synced.bagto smoothly follow the example.

2 - Creation and saving of ORB feature map

Befor you launch the SLAM system, make sure the corresponding ROS workspace is sourced:

source devel/setup.bash

The SLAM is then started via:

roslaunch orb_slam2_ros orb_slam_kitti_from_bag.launch

After starting the launch file, the ORB vocabulary is loaded. Press the SPACE key to start the replay of the bag file and the mapping process.

When the bag data replay is finished, press Ctrl-C to shutdown the system and the map saving process is executed. The resulting ORB map file map.bin is saved in the current ros workspace at: catkin_ws/devel/lib/orb_slam2_ros/. The SLAM trajectory frame data FrameTrajectory_TUM_Format.txt is saved in the same folder.

Rename the trajectory frame data file to slam_FrameTrajectory_TUM_Format.txt, so it is not overwritten in the consecutive localization run.

Optional: Change the data path in the launch file to match the bagfile location on your system. The default data path in the launch file is: $(env HOME)/datasets/KITTI/kitti_2011_09_30_drive_0027_synced.bag The default ORB-SLAM settings file is configured to work with the KITTI example bag file. The mapping from the setting file numbers to futher KITTI sequences can be found in the Readme.

3 - Localization on the ORB feature map

The map loading and saving settings are found at the bottom of the ORB settings file. Edit the ORB settings file at orbslam-map-saving-extension/orb_slam2_ros/settings/KITTI04-12.yaml by setting Map.load_map: 1 to load the previously created map when the system is initialized. Additionally deactivate the map saving: Map.save_map: 0.

In the ROS launch file, we set the replay speed of the rosbag to 2x by changing -r 1 to -r 2 to simulate a faster run for the localization on the example data.

Now, re-run the launch file to start the localiation run:

roslaunch orb_slam2_ros orb_slam_kitti_from_bag.launch

The command line output confirms the successful loading of the map file map.bin. Press the SPACE key to start the replay of the bag file and the localization process.

When the bag data replay is finished, press Ctrl-C to shutdown the system. Now only the trajectory files are saved.

Rename the trajectory frame data to localization_FrameTrajectory_TUM_Format.txt, so it is not overwritten in consecutive localization runs.

4 - Visualization

For the visualization additional packages are needed:

pip install matplotlib
pip install evo 

Trajectory visualization

To visualize the trajectories of the SLAM and localization runs, a basic plotting script is provided in the main folder. For the example, simply run

python example_trajectory_plots.py

The ouput should be as follows:

SLAM and Localization Trajectories

We see that the localization visually matches with the mapping trajectory even at higher speeds. Note: If you run the example bag with 2x speed in SLAM mode, the mapping process will eventually fail due to failed feature matching.

Feature Visualization

During the SLAM or localization process you can visualize the matching of the ORB features. Therefore start rqt_image_view and listen to the /orb_slam2/frame topic. An example frame output for the localization mode is shown here:

ORB matching visualization

Additional information

KITTI Odometry Sequence Mapping for Settings File

The following table maps the setting file number to the name, start frame and end frame of each sequence that has been used to extract the visual odometry / SLAM training set:

Nr.     Sequence name     Start   End
---------------------------------------
00: 2011_10_03_drive_0027 000000 004540
01: 2011_10_03_drive_0042 000000 001100
02: 2011_10_03_drive_0034 000000 004660
03: 2011_09_26_drive_0067 000000 000800
04: 2011_09_30_drive_0016 000000 000270
05: 2011_09_30_drive_0018 000000 002760
06: 2011_09_30_drive_0020 000000 001100
07: 2011_09_30_drive_0027 000000 001100
08: 2011_09_30_drive_0028 001100 005170
09: 2011_09_30_drive_0033 000000 001590
10: 2011_09_30_drive_0034 000000 001200

Based on this table, for the example sequence 2011_09_30_drive_0027, the settings file KITTI04-12.yaml is the correct one.

Contributions

This implementation is created during the Interdisciplinary Project (IDP) of Odysseas Papanikolaou at the Institute of Automotive Technology of the Technical University of Munich. Contact: [email protected]

If you find our work useful in your research, please consider citing:

@INPROCEEDINGS{nobis20loc,
    author={Felix Nobis, Odysseas Papanikolaou, Johannes Betz and Markus Lienkamp},
    title={Persistent Map Saving for Visual Localization for Autonomous Vehicles: An ORB-SLAM\,2 Extension},
    booktitle={2020 Fifteenth International Conference on Ecological Vehicles and Renewable Energies (EVER)},
    year={2020}
}

More Repositories

1

global_racetrajectory_optimization

This repository contains multiple approaches for generating global racetrajectories.
Python
457
star
2

CameraRadarFusionNet

Python
393
star
3

ORB_SLAM3_RGBL

RGB-L: An Extension to Integrate LiDAR Data into ORB-SLAM3
C++
245
star
4

GraphBasedLocalTrajectoryPlanner

Local trajectory planner based on a multilayer graph framework for autonomous race vehicles.
Python
228
star
5

mod_vehicle_dynamics_control

TUM Roborace Team Software Stack - Path tracking control, velocity control, curvature control and state estimation.
MATLAB
215
star
6

racetrack-database

This repository contains center lines (x- and y-coordinates), track widths and race lines for over 20 race tracks (F1 and DTM) all over the world
171
star
7

EthicalTrajectoryPlanning

An Ethical Trajectory Planning Algorithm for Autonomous Vehicles
Python
143
star
8

trajectory_planning_helpers

Useful functions used for path and trajectory planning at TUM/FTM
Python
136
star
9

laptime-simulation

This repository contains a quasi-steady-state lap time simulation implemented in Python. It can be used to evaluate the effect of various vehicle parameters on lap time and energy consumption.
Python
99
star
10

NeuralNetwork_for_VehicleDynamicsModeling

Python
95
star
11

sim_vehicle_dynamics

TUM Roborace Team Software Stack - Vehicle Simulation
MATLAB
91
star
12

Lecture_AI_in_Automotive_Technology

This is the github Repository that belongs to the lecture "Artificial Intelligence in Automotive Technology" from the Institute of Automotive Technology of the Technical University of Munich
Jupyter Notebook
84
star
13

race-simulation

This repository contains a race simulation to determine a race strategy for motorsport circuit races. Race strategy in this context means the determination of pit stops.
Python
81
star
14

Lecture_ADSE

Jupyter Notebook
68
star
15

FusionTracking

Multi-Modal Sensor Fusion and Object Tracking for Autonomous Racing
Python
62
star
16

veh_passenger

TUM Roborace Team Software Stack - Example Vehicle
MATLAB
61
star
17

FlexMap_Fusion

ROS 2 Autoware Tool for Map Georeferencing and OSM Fusion
C++
60
star
18

RadarVoxelFusionNet

Python
55
star
19

RadarGNN

A graph neural network for the segmentation and object detection in radar point clouds.
Python
51
star
20

Carla-Autoware-Bridge

Carla 0.9.15 and Autoware Universe Humble
Python
50
star
21

velocity_optimization

Optimizes (Maximizes) the velocity profile for a vehicle with respect to physical constraints (e.g., power, force, combined acceleration, ...). Takes into account a variable friction potential between road and tires. Max. power input can be variable (for e.g., energy strategy purpose).
Python
47
star
22

f1-timing-database

SQLite database containing Formula 1 lap and race timing information for the seasons 2014 - 2019
41
star
23

Multi_LiCa

Multi - LiDAR-to-LiDAR calibration framework for ROS2 and non-ROS applications
31
star
24

teleoperated_driving

Dockerfile
30
star
25

YawMomentDiagrams

Tool to generate yaw moment diagrams for vehicle handling analysis.
Python
29
star
26

ScenarioArchitect

The Scenario Architect provides a lightweight graphical user interface that allows a straightforward realization and manipulation of concrete driving testing scenarios. Exemplary usecases are the validation of an online verification framework or training of an prediction algorithm.
Python
29
star
27

CamRaDepth

Semantic Guided Depth Estimation with Transformers Using Monocular Camera and Sparse Radar
Python
27
star
28

EA_Battery_SPMparameterization

Electrochemical lithium-ion battery model of reduced-order to predict unmeasurable cell states for fast charging control in real time. Methods for parameterization of the model based on half and full cell measurements are provided.
MATLAB
26
star
29

TrajectorySupervisor

Python
21
star
30

LOTUS

MATLAB
20
star
31

sim_battery_system

MATLAB
19
star
32

Wale-Net

Neuronales Netz zur Trajektorienprädiktion von Fahrzeugen mit OnlineLearning
Python
19
star
33

RadarSeg

Python
19
star
34

TechnoEconomicCellSelection

Helps you select the optimal cell to electrify a long-haul truck from a database containing 160 cells.
Python
18
star
35

RID

Roof Information Dataset for CV-Based Photovoltaic Potential Assessment
Python
17
star
36

Eco-Driving

MATLAB
13
star
37

uds-decoder

UDS Decoder zur vereinfachten Umrechnung von Diagnoseabfragen
C#
13
star
38

Component_Library_for_Full_Vehicle_Simulations

MATLAB
13
star
39

sim_BTMS

MATLAB
13
star
40

embes

The repository embes (embedded energy strategy) contains an algorithm to calculate an energy strategy for an all-electric race car in real time.
Python
13
star
41

Electric_Machine_Design

MATLAB
12
star
42

MixNet

Structured Deep Neural Motion Prediction of Opposing Vehicles for an Autonomous Racecar
Python
12
star
43

edgar_digital_twin

Python
12
star
44

Eco_Driving_Toolbox_for_BEVs

Eco-driving toolbox for battery electric vehicles using detailed loss models
MATLAB
11
star
45

Damper-Defect-Detection-using-Machine-Learning

MATLAB
11
star
46

UrbanEV

Java
11
star
47

tpa_map_functions

This repository provides several functions to generate and process race track maps containing specific local information, which is further used for trajectory planning or vehicle dynamics simulation.
Python
11
star
48

AVSensorCoverage

Coverage, redundancy and blind spots of autonomous vehicles
Python
10
star
49

2RC_ECM

Python
10
star
50

Modular-Quasi-Static-Longitudinal-Simulation-for-BEV

MATLAB
9
star
51

Reliability_Models_of_Inverters

MATLAB
9
star
52

MATLAB2CAD

A series of examples to directly connect MATLAB with CATIA V5
MATLAB
9
star
53

dt-cargo

Recorded Real Driving Data and Computed Track-Wise Metadata
Jupyter Notebook
8
star
54

sim_VTMS

MATLAB
7
star
55

Efficiency_Models_of_Inverters_for_BMW_i3

MATLAB
7
star
56

test_scenarios_cooperation

Python
7
star
57

RUMI

Recursive Uncertainty Model Identification
Python
7
star
58

MAGIS

Python
7
star
59

TruckBatteryDesign

Battery design method for battery-electric long-haul trucks
Python
6
star
60

Damper-Defect-Detection-Using-CNN

Python
6
star
61

AuVeCoDe

Tool to design and optimize autonomous vehicle concepts.
MATLAB
6
star
62

Hamburg-Public-Charging-Station-Utilization

Public charging station utilization dataset for the city of Hamburg. Dataset is described in the respective paper: Placing BEV Charging Infrastructure: Influencing Factors, Metrics, and their Influence on Observed Charger Utilization
6
star
63

Staruml2json

Python
6
star
64

motorcycle_model

A multibody code for motorcycle simulation
MATLAB
6
star
65

BTMS-Design

Entwicklungstool zur Auslegung von Batteriethermosystemen in verschiedenen Klimabedingungen
Julia
6
star
66

SETRIC

Python
6
star
67

Sim2RealDistributionAlignedDataset

Sim-to-Real Distribution-Aligned Dataset (S2R-DAD) for Domain Shift and Domain Adaptation Analysis
5
star
68

Labcourse-Mobility-Data-Analysis

Jupyter Notebook
5
star
69

Carla_t2

Carla_T2 Sensor Kit and Vehicle Model for Autoware Universe
Python
5
star
70

GMMCalib

LiDAR-to-LiDAR Calibration
Python
5
star
71

tod_perception

C++
5
star
72

MCS_Analysis

The novel Megawatt Charging System standard Implications on battery size and cell requirements for battery-electric long-haul trucks
Python
5
star
73

EA_Battery_MDF

This repository provides a model deployment framework (MDF) for real-time lithium-ion battery model utilization in CAN-capable test benches. It can be used for the investigation of advanced battery management strategies in short- and long-term experimental studies.
Python
5
star
74

cooperative_behavior_planning

Python
4
star
75

Lane_Level_Matching

4
star
76

Vehicle-specific-Driving-Cycles-

MATLAB
4
star
77

HVAC-Consumption-Calculator

MATLAB
4
star
78

EV_Battery_DVA_Clustering

Repository for battery cell clustering in python
Python
4
star
79

SpeziSpezl

A vending machine system with RFID authentification, payment transaction and resupply tracking and PayPal deposit support.
HTML
4
star
80

TOTEM

Topology-Optimization Tool for Electric Mobility
MATLAB
4
star
81

ad_interface_functions

Interface functions used in the autonomous driving stack at TUM/FTM
Python
4
star
82

AV_Driving_Cycles

This tool develops driving cycles for specific driving style properties (comfort, consumption, fastness, subjective safety) of AVs.It is an ACC simulation of an AV that follows leading vehicle that drives one of the today known cycles. The parameters of the ACC controller vary depending on the driving style of the AV.
MATLAB
4
star
83

EA_Battery_LAB2MAT

Repository of tools for raw data postprocessing of lab devices (e.g. Gamry, Basytec, Biologic, ...) to .MAT files compatibel with Matlab.
MATLAB
4
star
84

VVUQ-Python_Framework

Python
3
star
85

VASEM

Vehicle concept development for Autonomous, Shared and Electric Mobility
MATLAB
3
star
86

Truck-Overtaking-Spot-Analyzer

Python
3
star
87

stakeholder-digital-battery-twin

HTML
3
star
88

SASIM

Smart Advisor for Sustainable Integrated Mobility (SASIM) - Full cost calculator as a routing tool for urban mobility in Munich.
JavaScript
3
star
89

EVRP_optimizer

Coupled fleet, infrastructure and deployment optimization of heterogeneous van fleets with alternative drives (E-C-VRP-HF-TW)
3
star
90

mod_interface_helperfun

TUM Roborace Team Software Stack - Miscellaneous functionality used across all repositories.
MATLAB
3
star
91

VVUQ-Framework

MATLAB
2
star
92

Efficiency-and-Thermal-Behavior-IM

MATLAB
2
star
93

tod_vehicle_interface

C++
2
star
94

1.-Standard-Load-Profile-Generator

2
star
95

LithiumIonCellMaterials

Python
2
star
96

FlexCloud

Georeferencing of Point Cloud Maps
2
star
97

sumo-prt

Python
1
star
98

deefs

Java
1
star
99

Steuerungssoftware_Gasloeslichkeitspruefstand

C++
1
star
100

BatteryBufferedEndStationCharging

Python
1
star