Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ajtudela/slg_msgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3.8.0
Choose a base ref
...
head repository: ajtudela/slg_msgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 7 commits
  • 11 files changed
  • 1 contributor

Commits on Jul 22, 2024

  1. Fix Readme

    Signed-off-by: Alberto Tudela <[email protected]>
    ajtudela committed Jul 22, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    ajtudela Alberto Tudela
    Copy the full SHA
    e39abea View commit details
  2. Improve msgs

    Signed-off-by: Alberto Tudela <[email protected]>
    ajtudela committed Jul 22, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    ajtudela Alberto Tudela
    Copy the full SHA
    8c4f09d View commit details

Commits on Jul 31, 2024

  1. Update to use modern CMake idioms

    Signed-off-by: Alberto Tudela <[email protected]>
    ajtudela committed Jul 31, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    ajtudela Alberto Tudela
    Copy the full SHA
    7013c16 View commit details

Commits on Feb 6, 2025

  1. First jazzy release

    Signed-off-by: Alberto Tudela <[email protected]>
    ajtudela committed Feb 6, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    ajtudela Alberto Tudela
    Copy the full SHA
    9c3a743 View commit details
  2. Update readme

    Signed-off-by: Alberto Tudela <[email protected]>
    ajtudela committed Feb 6, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    ajtudela Alberto Tudela
    Copy the full SHA
    6ae5e67 View commit details
  3. Added test results to Codecov

    Signed-off-by: Alberto Tudela <[email protected]>
    ajtudela committed Feb 6, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    ajtudela Alberto Tudela
    Copy the full SHA
    4aeb40f View commit details

Commits on Feb 7, 2025

  1. Update Readme

    Signed-off-by: Alberto Tudela <[email protected]>
    ajtudela committed Feb 7, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    ajtudela Alberto Tudela
    Copy the full SHA
    c3a20a7 View commit details
Showing with 114 additions and 54 deletions.
  1. +9 −3 .github/workflows/build.yml
  2. +10 −2 CHANGELOG.rst
  3. +17 −20 CMakeLists.txt
  4. +31 −2 README.md
  5. +21 −10 msg/Segment.msg
  6. +4 −2 msg/SegmentArray.msg
  7. +1 −1 package.xml
  8. +15 −11 test/CMakeLists.txt
  9. +1 −0 test/test_point2d.cpp
  10. +2 −0 test/test_polygon.cpp
  11. +3 −3 test/test_segment2d.cpp
12 changes: 9 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -11,19 +11,19 @@ on:

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4.1.6
- name: Setup ROS 2
uses: ros-tooling/setup-ros@0.7.5
with:
required-ros-distributions: humble
required-ros-distributions: jazzy
- name: Install dependencies
uses: ros-tooling/action-ros-ci@0.3.13
with:
package-name: slg_msgs
target-ros2-distro: humble
target-ros2-distro: jazzy
colcon-defaults: |
{
"build": {
@@ -41,3 +41,9 @@ jobs:
files: ros_ws/lcov/total_coverage.info,ros_ws/coveragepy/.coverage
flags: unittests
name: codecov-umbrella
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
12 changes: 10 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package slg_msgs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

3.9.2 (06-02-2025)
------------------
* First jazzy release.

3.9.1 (31-07-2024)
------------------
* Update to use modern CMake idioms.

3.9.0 (29-02-2024)
------------------
37 changes: 17 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -66,33 +66,26 @@ rosidl_generate_interfaces(${PROJECT_NAME}
DEPENDENCIES std_msgs geometry_msgs
)

add_library(${PROJECT_NAME}_includes INTERFACE)
target_include_directories(${PROJECT_NAME}_includes INTERFACE
set(library_name slg_core)

add_library(${library_name} INTERFACE)
target_include_directories(${library_name} INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>"
)

# ##########
# # Build ##
# ##########
# # Specify additional locations of header files
# # Your package locations should be listed before other locations
include_directories(
include
)

# ############
# # Install ##
# ############
install(DIRECTORY include/${PROJECT_NAME}/
install(DIRECTORY include/
DESTINATION include/${PROJECT_NAME}
FILES_MATCHING PATTERN "*.hpp"

# PATTERN ".svn" EXCLUDE
)

install(TARGETS ${PROJECT_NAME}_includes
EXPORT export_${PROJECT_NAME}
install(TARGETS ${library_name}
EXPORT ${library_name}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)

# ############
@@ -110,7 +103,11 @@ endif()
# ##################################
# # ament specific configuration ##
# ##################################
ament_export_include_directories(include)
ament_export_targets(export_${PROJECT_NAME})
ament_export_dependencies(rosidl_default_runtime)
ament_export_include_directories(include/${PROJECT_NAME})
ament_export_dependencies(
geometry_msgs
std_msgs
rosidl_default_runtime
)
ament_export_targets(${library_name})
ament_package()
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# slg_msgs

![ROS2](https://img.shields.io/badge/ros2-humble-blue?logo=ros&logoColor=white)
![ROS2](https://img.shields.io/badge/ros2-jazzy-blue?logo=ros&logoColor=white)
![License](https://img.shields.io/github/license/ajtudela/slg_msgs)
[![Build](https://github.com/ajtudela/slg_msgs/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/ajtudela/slg_msgs/actions/workflows/build.yml)
[![codecov](https://codecov.io/gh/ajtudela/slg_msgs/graph/badge.svg?token=R48HZO62SQ)](https://codecov.io/gh/ajtudela/slg_msgs)
@@ -15,4 +15,33 @@ This package provides classes and messages to interact with laser related geomet

## Messages (.msg)
* [Segment](msg/Segment.msg): Describes a laserscan splitted in segment.
* [SegmentArray](msg/BatteryState.msg): An array of Segment messages.
* [SegmentArray](msg/SegmentArray.msg): An array of Segment messages.

## Installation

### Binaries

On Ubuntu 24.04 you can install the latest version of this package using the following command

```bash
sudo apt-get update
sudo apt-get install ros-jazzy-slg-msgs
```

### Building from Source

#### Dependencies

- [Robot Operating System (ROS) 2](https://docs.ros.org/en/jazzy/) (middleware for robotics),

#### Building

To build from source, clone the latest version from the main repository into your colcon workspace and compile the package using

```bash
cd colcon_workspace/src
git clone https://github.com/ajtudela/slg_msgs.git -b jazzy
cd ../
rosdep install -i --from-path src --rosdistro jazzy -y
colcon build --symlink-install
```
31 changes: 21 additions & 10 deletions msg/Segment.msg
Original file line number Diff line number Diff line change
@@ -5,15 +5,26 @@
# Segment messages can be used as an input to a classifier such as a person detector, or for annotating
# sensor_msgs/Laserscan messages with groundtruth person tracks.

uint64 id 0 # Id of the segment
uint32 label 0 # Label of the segment
float64 angular_distance 0.0 # Angular distance to the closest boundary (in rads)
geometry_msgs/Point last_point_prior_segment # Last point of the previous segment
geometry_msgs/Point first_point_next_segment # First point of the next segment
geometry_msgs/Point[] points # Points per segment
# ID of the segment
uint64 id 0

# Label of the segment
uint32 label 0

# Angular distance to the closest boundary (in rads)
float64 angular_distance 0.0

# Last point of the previous segment
geometry_msgs/Point last_point_prior_segment

# First point of the next segment
geometry_msgs/Point first_point_next_segment

# Points of the segment
geometry_msgs/Point[] points

# Type of the labels
uint32 BACKGROUND = 0
uint32 PERSON = 1
uint32 PERSON_CANE = 2
uint32 PERSON_WHEEL_CHAIR = 3
uint32 BACKGROUND = 0
uint32 PERSON = 1
uint32 PERSON_CANE = 2
uint32 PERSON_WHEEL_CHAIR = 3
6 changes: 4 additions & 2 deletions msg/SegmentArray.msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Message for array of Segment

std_msgs/Header header # Standard message header.
Segment[] segments # List of sorted segments.
std_msgs/Header header

# Array of sorted segments
Segment[] segments
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>slg_msgs</name>
<version>3.8.0</version>
<version>3.9.2</version>
<description>This package provides classes and messages to interact with laser related geometry.</description>
<maintainer email="ajtudela@gmail.com">Alberto Tudela</maintainer>
<license>Apache-2.0</license>
26 changes: 15 additions & 11 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
ament_add_gtest(test_point2d
test_point2d.cpp
)
ament_target_dependencies(test_point2d
geometry_msgs
target_link_libraries(test_point2d
${geometry_msgs_TARGETS}
${library_name}
)

ament_add_gtest(test_polygon
test_polygon.cpp
test_polygon.cpp
)
ament_target_dependencies(test_polygon
geometry_msgs
target_link_libraries(test_polygon
${geometry_msgs_TARGETS}
${library_name}
)

ament_add_gtest(test_segment2d
test_segment2d.cpp
test_segment2d.cpp
)
rosidl_get_typesupport_target(cpp_typesupport_target
${PROJECT_NAME} rosidl_typesupport_cpp)

ament_target_dependencies(test_segment2d
geometry_msgs
${PROJECT_NAME} rosidl_typesupport_cpp
)
target_link_libraries(test_segment2d "${cpp_typesupport_target}")

target_link_libraries(test_segment2d
${geometry_msgs_TARGETS}
${library_name}
"${cpp_typesupport_target}"
)
1 change: 1 addition & 0 deletions test/test_point2d.cpp
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
// limitations under the License.

#include "gtest/gtest.h"
#include "geometry_msgs/msg/point.hpp"
#include "slg_msgs/point2D.hpp"

// Default constructor, constructor with values and copy constructor
2 changes: 2 additions & 0 deletions test/test_polygon.cpp
Original file line number Diff line number Diff line change
@@ -13,6 +13,8 @@
// limitations under the License.

#include "gtest/gtest.h"
#include "geometry_msgs/msg/polygon.hpp"
#include "geometry_msgs/msg/point32.hpp"
#include "slg_msgs/polygon.hpp"

slg::Polygon square()
6 changes: 3 additions & 3 deletions test/test_segment2d.cpp
Original file line number Diff line number Diff line change
@@ -29,9 +29,9 @@ TEST(Segment2DTest, constructors) {
EXPECT_DOUBLE_EQ(segment1.get_last_centroid().x, 0.0);
EXPECT_DOUBLE_EQ(segment1.get_last_centroid().y, 0.0);
// Constructor with values
slg::Segment2D segment2(1, slg::Point2D(1.0, 2.0, slg::PERSON), slg::Point2D(
3.0, 4.0,
slg::PERSON),
slg::Segment2D segment2(1,
slg::Point2D(1.0, 2.0, slg::PERSON),
slg::Point2D(3.0, 4.0, slg::PERSON),
slg::Point2D(5.0, 6.0, slg::PERSON));
EXPECT_EQ(segment2.get_id(), 1);
EXPECT_EQ(segment2.get_label(), slg::BACKGROUND);