Skip to content

Commit

Permalink
Pushed IMU Simulator from TRIPLE gitlab to github
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximilian Nitsch committed Apr 24, 2024
0 parents commit abc72ba
Show file tree
Hide file tree
Showing 23 changed files with 6,332 additions and 0 deletions.
162 changes: 162 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
cmake_minimum_required(VERSION 3.8)
project(imu_simulator_package)

# Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()

# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(diagnostic_msgs REQUIRED)
find_package(tf2_ros REQUIRED)

find_package(eigen3_cmake_module REQUIRED)
find_package(Eigen3 REQUIRED)

include_directories(
include/imu_simulator_package
${EIGEN3_INCLUDE_DIR}
${YAML_CPP_INCLUDE_DIR})

set(HEADER_FILES
include/imu_simulator_package/imu_simulator.h)

add_library(imu_simulator SHARED
src/imu_simulator.cpp
${HEADER_FILES})

# add imu_simulator_node
add_executable(${PROJECT_NAME}_node src/imu_simulator_node.cpp)

ament_target_dependencies(${PROJECT_NAME}_node PUBLIC
rclcpp
std_msgs
sensor_msgs
nav_msgs
geometry_msgs
diagnostic_msgs
tf2_ros
Eigen3)

target_link_libraries(${PROJECT_NAME}_node PUBLIC imu_simulator)

target_include_directories(${PROJECT_NAME}_node PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)

target_compile_features(${PROJECT_NAME}_node PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17

install(TARGETS
${PROJECT_NAME}_node
DESTINATION
lib/${PROJECT_NAME})

# add csv_test_executable
add_executable(imu_simulator_static_csv src/imu_simulator_static_csv.cpp)

ament_target_dependencies(imu_simulator_static_csv PUBLIC
Eigen3)

target_link_libraries(imu_simulator_static_csv PUBLIC imu_simulator)

target_include_directories(imu_simulator_static_csv PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)

target_compile_features(imu_simulator_static_csv PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17

install(TARGETS
imu_simulator_static_csv
DESTINATION lib/${PROJECT_NAME})

install(TARGETS imu_simulator
EXPORT imu_simulator
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include)

# add odometry test publisher
add_executable(ground_truth_test_publisher_node src/ground_truth_test_publisher_node.cpp)

ament_target_dependencies(ground_truth_test_publisher_node PUBLIC
rclcpp
nav_msgs
geometry_msgs
tf2_ros
Eigen3)

target_link_libraries(ground_truth_test_publisher_node PUBLIC imu_simulator)

target_include_directories(ground_truth_test_publisher_node PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)

target_compile_features(ground_truth_test_publisher_node PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17

install(TARGETS
ground_truth_test_publisher_node
DESTINATION lib/${PROJECT_NAME})

install(DIRECTORY
launch
config
DESTINATION
share/${PROJECT_NAME}/)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)

# the following line skips uncrustify (source code formatting)
# set(ament_cmake_uncrustify_FOUND TRUE)

find_package(ament_cmake_gtest REQUIRED)

set(TEST_FILES
test/main.cpp
test/imu_simulator_test.cpp)

ament_add_gtest(${PROJECT_NAME}_test ${TEST_FILES})

target_link_libraries(${PROJECT_NAME}_test imu_simulator)

install(TARGETS
${PROJECT_NAME}_test
DESTINATION lib/${PROJECT_NAME})

# the following line skips cpplint (only works in a git repo)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)

list(APPEND AMENT_LINT_AUTO_EXCLUDE
ament_cmake_uncrustify)

# enforce linters and static code analyzers defined in ament_lint_common package
ament_lint_auto_find_test_dependencies()

# uncomment to include uncrustify explicitly
# find_package(ament_cmake_uncrustify)
# ament_uncrustify(CONFIG_FILE "./uncrustify.cfg" TESTNAME "custom_uncrustify")

endif()

ament_package()
24 changes: 24 additions & 0 deletions CODE_OF_CONDUCT
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Contributor Code of Conduct

As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests, and other activities.

We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery
- Personal attacks
- Trolling or insulting/derogatory comments
- Public or private harassment
- Publishing others' private information, such as physical or electronic addresses, without explicit permission
- Other unethical or unprofessional conduct

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [m.nitsch@irt.rwth-aachen.de](mailto:m.nitsch@irt.rwth-aachen.de). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
42 changes: 42 additions & 0 deletions CONTRIBUTING
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Contributing to Project Name

Thank you for considering contributing to our project! Here are some guidelines to help you get started.

## Code of Conduct

Please note that this project is governed by our [Code of Conduct](CODE_OF_CONDUCT.md). Please review it before contributing.

## Getting Started

To start contributing, follow these steps:

1. Fork the repository on GitHub.
2. Clone your forked repository to your local machine.
3. Create a new branch for your contribution: `git checkout -b feature/my-feature`.
4. Make your changes and commit them: `git commit -m "Add new feature"`.
5. Push your changes to your forked repository: `git push origin feature/my-feature`.
6. Open a pull request on GitHub.

## Reporting Issues

If you encounter any issues with the project, please [open an issue](https://github.com/rwth-irt/IMU-Simulator/issues) on GitHub and provide as much detail as possible.

## Code Style

Follow the existing code style and conventions of the project.

Please follow these code style and conventions:
- [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html)
- [ROS 2 Code Style Guide](http://docs.ros.org/en/humble/The-ROS2-Project/Contributing/Code-Style-Language-Versions.html)
- [ROS 2 Developer Guide](https://docs.ros.org/en/rolling/The-ROS2-Project/Contributing/Developer-Guide.html#package-layout)

Make sure your code is well-formatted and documented. Please use [Doxygen](https://www.doxygen.nl/) for commenting.

## Testing

Make sure your code is well-tested. Please use [GoogleTest](http://google.github.io/googletest/) for the core functionalities.
Before submitting a pull request, make sure all tests pass and add new tests for any new functionality or changes.

## Licensing

By contributing to this project, you agree to license your contributions under the [LICENSE](LICENSE) of the project.
35 changes: 35 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
BSD 3-Clause License

Copyright (c) [2023], [Maximilian Nitsch]
All rights reserved.

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

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

2. 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.

3. 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 [Maximilian Nitsch] at [Institute of Automatic Control - RWTH Aachen University].

Contact Information:
[m.nitsch@irt.rwth-aachen.de]

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.
Loading

0 comments on commit abc72ba

Please sign in to comment.