Skip to content

Commit

Permalink
Merge remote-tracking branch 'remote2/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Dec 15, 2023
2 parents e3b10c3 + 4d73a4e commit ad42a33
Show file tree
Hide file tree
Showing 21 changed files with 1,131 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
Language: Cpp
BasedOnStyle: Google
# ---
#AccessModifierOffset: -4
AlignAfterOpenBracket: AlwaysBreak # Values: Align, DontAlign, AlwaysBreak
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
#AlignEscapedNewlinesLeft: true
#AlignOperands: false
AlignTrailingComments: false # Should be off, causes many dummy problems!!
#AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
#AllowShortCaseLabelsOnASingleLine: false
#AllowShortFunctionsOnASingleLine: Empty
#AllowShortIfStatementsOnASingleLine: false
#AllowShortLoopsOnASingleLine: false
#AlwaysBreakAfterDefinitionReturnType: None
#AlwaysBreakAfterReturnType: None
#AlwaysBreakBeforeMultilineStrings: true
#AlwaysBreakTemplateDeclarations: true
#BinPackArguments: false
#BinPackParameters: false
#BraceWrapping:
#AfterClass: false
#AfterControlStatement: false
#AfterEnum: false
#AfterFunction: false
#AfterNamespace: false
#AfterObjCDeclaration: false
#AfterStruct: false
#AfterUnion: false
#BeforeCatch: false
#BeforeElse: true
#IndentBraces: false
#BreakBeforeBinaryOperators: None
BreakBeforeBraces: Allman
#BreakBeforeTernaryOperators: true
#BreakConstructorInitializersBeforeComma: false
ColumnLimit: 80
#CommentPragmas: ''
#ConstructorInitializerAllOnOneLineOrOnePerLine: true
#ConstructorInitializerIndentWidth: 4
#ContinuationIndentWidth: 4
#Cpp11BracedListStyle: true
#DerivePointerAlignment: false
#DisableFormat: false
#ExperimentalAutoDetectBinPacking: false
##FixNamespaceComments: true # Not applicable in 3.8
#ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
#IncludeCategories:
#- Regex: '.*'
#Priority: 1
IndentCaseLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: true
#KeepEmptyLinesAtTheStartOfBlocks: true
#MacroBlockBegin: ''
#MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
#PenaltyBreakBeforeFirstCallParameter: 19
#PenaltyBreakComment: 300
#PenaltyBreakFirstLessLess: 120
#PenaltyBreakString: 1000
#PenaltyExcessCharacter: 1000000
#PenaltyReturnTypeOnItsOwnLine: 200
DerivePointerAlignment: false
#PointerAlignment: Left
ReflowComments: true # Should be true, otherwise clang-format doesn't touch comments
SortIncludes: true
#SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
#SpaceBeforeParens: ControlStatements
#SpaceInEmptyParentheses: false
#SpacesBeforeTrailingComments: 2
#SpacesInAngles: false
#SpacesInContainerLiterals: true
#SpacesInCStyleCastParentheses: false
#SpacesInParentheses: false
#SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: Never # Available options are Never, Always, ForIndentation
11 changes: 11 additions & 0 deletions docs/module-demos.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. _mola_demos:

========================================
Module: mola_demos
========================================

Write me!

.. index::
single: mola_demos
module: mola_demos
14 changes: 14 additions & 0 deletions mola_demos/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package mola_demos
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.2.2 (2023-09-08)
------------------
* Progress with demo
* Import first demo files
* Contributors: Jose Luis Blanco-Claraco

0.2.1 (2023-09-08)
------------------
* Initial commit
* Contributors: Jose Luis Blanco-Claraco
46 changes: 46 additions & 0 deletions mola_demos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# ------------------------------------------------------------------------------
# A Modular Optimization framework for Localization and mApping
# (MOLA)
#
# Copyright (C) 2018-2023, Jose Luis Blanco-Claraco, contributors (AUTHORS.md)
# All rights reserved.
# Released under GNU GPL v3. See LICENSE file
# ------------------------------------------------------------------------------

# Minimum CMake vesion: limited by CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
cmake_minimum_required(VERSION 3.4)

if("$ENV{ROS_VERSION}" STREQUAL "2")
set(DETECTED_ROS2 TRUE)
endif()

# Tell CMake we'll use C++ for use in its tests/flags
project(mola_demos LANGUAGES CXX)

# MOLA CMake scripts: "mola_xxx()"
#find_package(mola_common REQUIRED)

# Instrumental lib:
add_library(${PROJECT_NAME} INTERFACE)

# Install files:
install(DIRECTORY
launch
DESTINATION
share/${PROJECT_NAME}
)


# -----------------------------------------------------------------------------
# ROS2
# -----------------------------------------------------------------------------
if (DETECTED_ROS2)
# find dependencies
find_package(ament_cmake REQUIRED)

#ament_target_dependencies(MY_TARGET
# rclcpp...
#)

ament_package()
endif()
29 changes: 29 additions & 0 deletions mola_demos/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2005-2019, Individual contributors, see AUTHORS file
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 changes: 22 additions & 0 deletions mola_demos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# mola_demos
Demo and example launch files for MOLA

Note that there are launch files for both, ROS 2 and standalone builds of MOLA.

## Examples and demos

### Read an external Ouster lidar into MOLA

```bash
# In one terminal
mola-cli -c $(ros2 pkg prefix --share mola_demos)/launch/ros2_ouster_just_view.yaml

# In another terminal:
ros2 bag play my_lidar_dataset.mcap
```

## Build and install
Refer to the [root MOLA repository](https://github.com/MOLAorg/mola).

## License
This package is released under the BSD-3 license.
32 changes: 32 additions & 0 deletions mola_demos/launch/euroc_stereo_just_replay.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# -----------------------------------------------------------------------------
# SLAM system definition for MOLA
# This file defines:
# an EUROC dataset reader. No actual SLAM or localization with this file!
# -----------------------------------------------------------------------------

modules:
# =====================
# EurocDataset
# =====================
- name: euroc_input
type: mola::EurocDataset
execution_rate: 50 # Hz
# (The following requires creating a MolaViz instance)
gui_preview_sensors:
- raw_sensor_label: cam0
decimation: 1
win_pos: 0 0 500 200 # [x,y,width,height]
- raw_sensor_label: cam1
decimation: 1
win_pos: 510 0 500 200 # [x,y,width,height]
params:
base_dir: ${EUROC_BASE_DIR}
sequence: vicon_room1/V1_01_easy/
time_warp_scale: 1.0
# =====================
# MolaViz
# =====================
- name: viz
type: mola::MolaViz
#verbosity_level: DEBUG
params: ~ # none
41 changes: 41 additions & 0 deletions mola_demos/launch/kitti_just_replay.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# -----------------------------------------------------------------------------
# SLAM system definition for MOLA
#
# This file just replays (no SLAM) the raw data of a sequence of the KITTI dataset
# -----------------------------------------------------------------------------

modules:
# =====================
# KittiOdometryDataset
# =====================
- type: mola::KittiOdometryDataset
name: kitti_input
execution_rate: 20 # Hz
#export_to_rawlog: kitti_${KITTI_SEQ}.rawlog
#verbosity_level: INFO
gui_preview_sensors:
- raw_sensor_label: lidar
decimation: 1
win_pos: 5 70 400 400
- raw_sensor_label: image_0
decimation: 1
win_pos: 5 370 600 200
- raw_sensor_label: image_1
decimation: 1
win_pos: 5 500 600 200
params:
base_dir: ${KITTI_BASE_DIR}
sequence: ${KITTI_SEQ}
time_warp_scale: 1.0
publish_lidar: true
publish_image_0: true
publish_image_1: true
publish_ground_truth: true

# =====================
# MolaViz
# =====================
- name: viz
type: mola::MolaViz
#verbosity_level: DEBUG
params: ~ # none
60 changes: 60 additions & 0 deletions mola_demos/launch/live_velodyne_just_view.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# -----------------------------------------------------------------------------
# SLAM system definition for MOLA
# This file defines:
# a live sensor input (Velodyne scanner). No SLAM, just shows the received data
# -----------------------------------------------------------------------------

modules:
# Offline or online sensory data sources =====================
- type: mola::GenericSensor
name: velodyne_input
execution_rate: 100 # Hz (max processing rate)
#verbosity_level: INFO
gui_preview_sensors:
- raw_sensor_label: Velodyne1_SCAN
decimation: 1
win_pos: 5 5 400 400
# GenericSensor parameters are the same than those in share/mrpt/rawlog_grabber/*.ini
# which can be converted to YAML using the mrpt tool "ini2yaml".
# Refer to docs for http://mrpt.ual.es/reference/devel/classmrpt_1_1hwdrivers_1_1_c_generic_sensor.html
# for possible sensors and available parameters.
params:
driver: CVelodyneScanner
# Optional but recommended: put here your vendor-provided calibration file
#calibration_file: PUT_HERE_FULL_PATH_TO_CALIB_FILE.xml
# model: Can be any of: `VLP16`,`HDL32`,`HDL64` (It is used to load default calibration file. Parameter not required if `calibration_file` is provided.
model: VLP16
# ---- Online operation ----
# IP address of the device. UDP packets from other IPs will be ignored. Leave commented or blank
# if only one scanner is present (no IP filtering)
#device_ip: 10.0.0.100
# Sensor RPM (Default: unchanged). Requires setting `device_ip`
# If set, an HTTP request will be issued to change the device settings.
#rpm: 300
# Any of: 'STRONGEST', 'LAST', 'DUAL'. Requires setting `device_ip`
# If set, an HTTP request will be issued to change the device settings.
#return_type: STRONGEST
# ---- Offline operation ----
# If uncommented, and non-empty, this class will read from the PCAP instead of connecting and listening
# for online network packets.
#pcap_input: ${PCAP_INPUT}
#pcap_read_once: false # Do not loop
#pcap_read_fast: false # fast forward skipping non-velodyne packets
#pcap_read_full_scan_delay_ms: 100 # Used to simulate a reasonable number of full scans / second
#pcap_repeat_delay: 0.0 # seconds
# ---- Save to PCAP file ----
# If uncommented, a PCAP file named `[pcap_output_prefix]_[DATE_TIME].pcap` will be
# written simultaneously to the normal operation of this class.
#pcap_output: velodyne_log
#
# Sensor pose on the robot/vehicle:
pose_pitch: 0
pose_roll: 0
pose_x: 0
pose_y: 0
pose_yaw: 0
pose_z: 0
# This driver will generate observations:
# - ${sensorLabel}_SCAN: Velodyne scans
# - ${sensorLabel}_GPS: RMC GPS frames
sensorLabel: Velodyne1
33 changes: 33 additions & 0 deletions mola_demos/launch/mulran_just_replay.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -----------------------------------------------------------------------------
# SLAM system definition for MOLA
#
# This file just replays (no SLAM) the raw data of a sequence of the Mulran dataset
# -----------------------------------------------------------------------------

modules:
# =====================
# MulranDataset
# =====================
- type: mola::MulranDataset
name: mulran_input
execution_rate: 20 # Hz
#export_to_rawlog: mulran_${MULRAN_SEQ}.rawlog
#verbosity_level: INFO
gui_preview_sensors:
- raw_sensor_label: lidar
decimation: 1
win_pos: 5 70 400 400
params:
base_dir: ${MULRAN_BASE_DIR}
sequence: ${MULRAN_SEQ}
time_warp_scale: 1.0
publish_lidar: true
publish_ground_truth: true

# =====================
# MolaViz
# =====================
- name: viz
type: mola::MolaViz
#verbosity_level: DEBUG
params: ~ # none
Loading

0 comments on commit ad42a33

Please sign in to comment.