Skip to content

Commit

Permalink
CI (#3)
Browse files Browse the repository at this point in the history
* Workflows
* Linting
* README badges
  • Loading branch information
roncapat authored Jan 4, 2024
1 parent 8fa9e3c commit fbb38e3
Show file tree
Hide file tree
Showing 9 changed files with 365 additions and 219 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/iron.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Ubuntu 22.04 Iron Build

on:
pull_request:
push:
branches:
- iron

jobs:
Build:
runs-on: ubuntu-latest
container:
image: osrf/ros:iron-desktop-full-jammy

steps:
- name: Update
run: apt update

- name: Install PIP
run: apt install -y python3-pip lcov

- name: Install colcon tools
run: python3 -m pip install colcon-lcov-result colcon-coveragepy-result

- name: Checkout
uses: actions/checkout@v2

- name: Run Tests
uses: ros-tooling/action-ros-ci@0.3.5
with:
target-ros2-distro: iron

- name: Upload Logs
uses: actions/upload-artifact@v1
with:
name: colcon-logs
path: ros_ws/log
if: always()
38 changes: 38 additions & 0 deletions .github/workflows/rolling.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Ubuntu 22.04 Rolling Build

on:
pull_request:
push:
branches:
- iron

jobs:
Build:
runs-on: ubuntu-latest
container:
image: osrf/ros:rolling-desktop-full-jammy

steps:
- name: Update
run: apt update

- name: Install PIP
run: apt install -y python3-pip lcov

- name: Install colcon tools
run: python3 -m pip install colcon-lcov-result colcon-coveragepy-result

- name: Checkout
uses: actions/checkout@v2

- name: Run Tests
uses: ros-tooling/action-ros-ci@0.3.5
with:
target-ros2-distro: rolling

- name: Upload Logs
uses: actions/upload-artifact@v1
with:
name: colcon-logs
path: ros_ws/log
if: always()
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ find_package(tf2_ros REQUIRED)
include(ExternalProject)
find_package(Git REQUIRED)

ExternalProject_Add(
externalproject_add(
covariance_geometry_cpp
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/covariance_geometry_cpp
GIT_REPOSITORY https://github.com/andreaostuni/covariance_geometry.git
Expand All @@ -39,8 +39,8 @@ include_directories(

add_library(${PROJECT_NAME} SHARED src/covariance_geometry_ros.cpp)
target_include_directories(
${PROJECT_NAME}
PUBLIC
${PROJECT_NAME}
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>"
)
Expand Down Expand Up @@ -78,7 +78,7 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/covariance_geometry_cpp/src/lib/ D

ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET)

ament_export_dependencies(
ament_export_dependencies(
Eigen3
covariance_geometry_cpp
geometry_msgs
Expand All @@ -89,12 +89,12 @@ if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()

set(TEST_NAMES
conversion_test
# composition_test
)
)

foreach(TEST_NAME ${TEST_NAMES})
ament_add_gtest(${TEST_NAME} test/${TEST_NAME}.cpp)

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
## covariance_geometry_ros

[![Ubuntu 22.04 Iron Build](https://github.com/giafranchini/covariance_geometry_ros/actions/workflows/iron.yaml/badge.svg)](https://github.com/giafranchini/covariance_geometry_ros/actions/workflows/iron.yaml)
[![Ubuntu 22.04 Rolling Build](https://github.com/giafranchini/covariance_geometry_ros/actions/workflows/rolling.yaml/badge.svg)](https://github.com/giafranchini/covariance_geometry_ros/actions/workflows/rolling.yaml)

A simple ROS2 wrapper for poses and covariances composition based on covariance_geometry library.
187 changes: 110 additions & 77 deletions include/covariance_geometry_ros/covariance_geometry_ros.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
#ifndef COVARIANCE_GEOMETRY_ROS_HPP_
#define COVARIANCE_GEOMETRY_ROS_HPP_
// Copyright 2023 Andrea Ostuni, Giacomo Franchini - PIC4SeR
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef COVARIANCE_GEOMETRY_ROS__COVARIANCE_GEOMETRY_ROS_HPP_
#define COVARIANCE_GEOMETRY_ROS__COVARIANCE_GEOMETRY_ROS_HPP_

#include <geometry_msgs/msg/pose.hpp>
#include <geometry_msgs/msg/pose_with_covariance.hpp>
Expand All @@ -10,83 +23,103 @@ using PoseWithCovariance = geometry_msgs::msg::PoseWithCovariance;

namespace covariance_geometry
{
/** @name Pose composition: out = a (+) b
/** @name Pose composition: out = a (+) b
@{ */
void compose(const Pose &a, const Pose &b, Pose &out);
void compose(const PoseWithCovariance &a, const PoseWithCovariance &b,
PoseWithCovariance &out);
void compose(const PoseWithCovariance &a, const Pose &b,
PoseWithCovariance &out);
void compose(const Pose &a, const PoseWithCovariance &b,
PoseWithCovariance &out);

// Return-by-value versions:
static inline Pose compose(const Pose &a, const Pose &b) {
Pose out;
compose(a, b, out);
return out;
}
static inline PoseWithCovariance compose(const PoseWithCovariance &a,
const PoseWithCovariance &b) {
PoseWithCovariance out;
compose(a, b, out);
return out;
}
static inline PoseWithCovariance compose(const PoseWithCovariance &a,
const Pose &b) {
PoseWithCovariance out;
compose(a, b, out);
return out;
}
static inline PoseWithCovariance compose(const Pose &a,
const PoseWithCovariance &b) {
PoseWithCovariance out;
compose(a, b, out);
return out;
}
void compose(const Pose & a, const Pose & b, Pose & out);
void compose(
const PoseWithCovariance & a, const PoseWithCovariance & b,
PoseWithCovariance & out);
void compose(
const PoseWithCovariance & a, const Pose & b,
PoseWithCovariance & out);
void compose(
const Pose & a, const PoseWithCovariance & b,
PoseWithCovariance & out);

// Return-by-value versions using TF2 transforms:
// PoseWithCovariance compose(const PoseWithCovariance &a,
// const tf2::Transform &b);
/** @} */
/** @name Pose inverse composition (a "as seen from" b): out = a (-) b
// Return-by-value versions:
static inline Pose compose(const Pose & a, const Pose & b)
{
Pose out;
compose(a, b, out);
return out;
}
static inline PoseWithCovariance compose(
const PoseWithCovariance & a,
const PoseWithCovariance & b)
{
PoseWithCovariance out;
compose(a, b, out);
return out;
}
static inline PoseWithCovariance compose(
const PoseWithCovariance & a,
const Pose & b)
{
PoseWithCovariance out;
compose(a, b, out);
return out;
}
static inline PoseWithCovariance compose(
const Pose & a,
const PoseWithCovariance & b)
{
PoseWithCovariance out;
compose(a, b, out);
return out;
}

// Return-by-value versions using TF2 transforms:
// PoseWithCovariance compose(const PoseWithCovariance &a,
// const tf2::Transform &b);
/** @} */
/** @name Pose inverse composition (a "as seen from" b): out = a (-) b
@{ */
void inverseCompose(const Pose &a, const Pose &b, Pose &out);
void inverseCompose(const PoseWithCovariance &a, const PoseWithCovariance &b,
PoseWithCovariance &out);
void inverseCompose(const PoseWithCovariance &a, const Pose &b,
PoseWithCovariance &out);
void inverseCompose(const Pose &a, const PoseWithCovariance &b,
PoseWithCovariance &out);
// Return-by-value versions:
static inline Pose inverseCompose(const Pose &a, const Pose &b) {
Pose out;
inverseCompose(a, b, out);
return out;
}
static inline PoseWithCovariance inverseCompose(const PoseWithCovariance &a,
const PoseWithCovariance &b) {
PoseWithCovariance out;
inverseCompose(a, b, out);
return out;
}
static inline PoseWithCovariance inverseCompose(const PoseWithCovariance &a,
const Pose &b) {
PoseWithCovariance out;
inverseCompose(a, b, out);
return out;
}
static inline PoseWithCovariance inverseCompose(const Pose &a,
const PoseWithCovariance &b) {
PoseWithCovariance out;
inverseCompose(a, b, out);
return out;
}
// Return-by-value versions using TF2 transforms:
// PoseWithCovariance inverseCompose(const PoseWithCovariance &a,
// const tf2::Transform &b);
void inverseCompose(const Pose & a, const Pose & b, Pose & out);
void inverseCompose(
const PoseWithCovariance & a, const PoseWithCovariance & b,
PoseWithCovariance & out);
void inverseCompose(
const PoseWithCovariance & a, const Pose & b,
PoseWithCovariance & out);
void inverseCompose(
const Pose & a, const PoseWithCovariance & b,
PoseWithCovariance & out);
// Return-by-value versions:
static inline Pose inverseCompose(const Pose & a, const Pose & b)
{
Pose out;
inverseCompose(a, b, out);
return out;
}
static inline PoseWithCovariance inverseCompose(
const PoseWithCovariance & a,
const PoseWithCovariance & b)
{
PoseWithCovariance out;
inverseCompose(a, b, out);
return out;
}
static inline PoseWithCovariance inverseCompose(
const PoseWithCovariance & a,
const Pose & b)
{
PoseWithCovariance out;
inverseCompose(a, b, out);
return out;
}
static inline PoseWithCovariance inverseCompose(
const Pose & a,
const PoseWithCovariance & b)
{
PoseWithCovariance out;
inverseCompose(a, b, out);
return out;
}
// Return-by-value versions using TF2 transforms:
// PoseWithCovariance inverseCompose(const PoseWithCovariance &a,
// const tf2::Transform &b);

/** @} */
} // namespace covariance_geometry
/** @} */
} // namespace covariance_geometry

#endif // COVARIANCE_GEOMETRY_ROS_HPP_
#endif // COVARIANCE_GEOMETRY_ROS__COVARIANCE_GEOMETRY_ROS_HPP_
Loading

0 comments on commit fbb38e3

Please sign in to comment.