Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# This config uses industrial_ci (https://github.com/ros-industrial/industrial_ci.git).
# For troubleshooting, see readme (https://github.com/ros-industrial/industrial_ci/blob/master/README.rst)

name: Build

on:
workflow_dispatch:
pull_request:
push:
branches:
- ros2

jobs:
industrial_ci:
strategy:
matrix:
env:
- ROS_DISTRO: iron
ROS_REPO: main
- ROS_DISTRO: iron
ROS_REPO: testing
- ROS_DISTRO: humble
ROS_REPO: main
- ROS_DISTRO: humble
ROS_REPO: testing
- ROS_DISTRO: rolling
ROS_REPO: main
- ROS_DISTRO: rolling
ROS_REPO: testing
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
BASEDIR: ${{ github.workspace }}/.work
CACHE_PREFIX: ${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }}

name: ${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# The target directory cache doesn't include the source directory because
# that comes from the checkout. See "prepare target_ws for cache" task below
- name: cache target_ws
if: ${{ ! matrix.env.CCOV }}
uses: pat-s/always-upload-cache@v3.0.11
with:
path: ${{ env.BASEDIR }}/target_ws
key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }}
restore-keys: |
target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}
- name: cache ccache
uses: pat-s/always-upload-cache@v3.0.11
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }}
restore-keys: |
ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}
ccache-${{ env.CACHE_PREFIX }}
- name: industrial_ci
uses: 'ros-industrial/industrial_ci@master'
env: ${{ matrix.env }}
- name: upload test artifacts (on failure)
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-results
path: ${{ env.BASEDIR }}/target_ws/**/test_results/**/*.xml
- name: prepare target_ws for cache
if: ${{ always() && ! matrix.env.CCOV }}
run: |
du -sh ${{ env.BASEDIR }}/target_ws
sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete
sudo rm -rf ${{ env.BASEDIR }}/target_ws/src
du -sh ${{ env.BASEDIR }}/target_ws
20 changes: 20 additions & 0 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This is a format job. Pre-commit has a first-party GitHub action, so we use
# that: https://github.com/pre-commit/action

name: Formatting (pre-commit)

on:
workflow_dispatch:
pull_request:
push:

jobs:
pre-commit:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install clang-format-14
run: sudo apt-get install clang-format-14
- uses: pre-commit/action@v3.0.1
34 changes: 34 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# To use:
#
# pre-commit run -a
#
# Or:
#
# pre-commit install # (runs every time you commit in git)
#
# To update this file:
#
# pre-commit autoupdate
#
# See https://github.com/pre-commit/pre-commit

repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
- id: pretty-format-json
- id: trailing-whitespace
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog for package graph_msgs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.2.0 (2021-09-14)
------------------
* Port to ROS 2 (`#5 <https://github.com/PickNikRobotics/graph_msgs/issues/5>`_)
* Contributors: Dave Coleman, Henning Kayser, Tyler Weaver, Vatan Aksoy Tezer

0.1.0 (2014-10-24)
------------------
* Added header / timestamp
Expand Down
155 changes: 32 additions & 123 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,133 +1,42 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.10)
project(graph_msgs)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
message_generation
geometry_msgs
std_msgs
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()

# Disable Wredundant-decls warnings since rosidl generates redundant function
# declarations
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wno-redundant-decls")
endif()

find_package(ament_cmake REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(std_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)

set(msg_files
"msg/Edges.msg"
"msg/GeometryGraph.msg"
)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)


## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()

################################################
## Declare ROS messages, services and actions ##
################################################

## Generate messages in the 'msg' folder
add_message_files(
FILES
Edges.msg
GeometryGraph.msg
)

## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
std_msgs
geometry_msgs
)

###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES graph_msgs
CATKIN_DEPENDS
message_runtime
rosidl_generate_interfaces(${PROJECT_NAME}
${msg_files}
DEPENDENCIES
builtin_interfaces
std_msgs
geometry_msgs
# DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
${catkin_INCLUDE_DIRS}
)

## Declare a cpp library
# add_library(graph_msgs
# src/${PROJECT_NAME}/graph_msgs.cpp
# )

## Declare a cpp executable
# add_executable(graph_msgs_node src/graph_msgs_node.cpp)

## Add cmake target dependencies of the executable/library
## as an example, message headers may need to be generated before nodes
# add_dependencies(graph_msgs_node graph_msgs_generate_messages_cpp)

## Specify libraries to link a library or executable target against
# target_link_libraries(graph_msgs_node
# ${catkin_LIBRARIES}
# )

#############
## Install ##
#############

# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html

## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# install(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark executables and/or libraries for installation
# install(TARGETS graph_msgs graph_msgs_node
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
# FILES_MATCHING PATTERN "*.h"
# PATTERN ".svn" EXCLUDE
# )

## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )

#############
## Testing ##
#############
ament_export_dependencies(rosidl_default_runtime)

## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_graph_msgs.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

## Add folders to be run by python nosetests
# catkin_add_nosetests(test)
ament_package()
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Any contribution that you make to this repository will
be under the 3-Clause BSD License, as dictated by that
[license](https://opensource.org/licenses/BSD-3-Clause).
25 changes: 25 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
graph_msgs
==========
# graph_msgs

ROS messages for publishing graphs of different data types

Status:
### Continuous Integration Status

* [![Build Status](https://travis-ci.org/davetcoleman/graph_msgs.svg)](https://travis-ci.org/davetcoleman/graph_msgs) Travis CI
* [![Devel Job Status](http://jenkins.ros.org/buildStatus/icon?job=devel-indigo-graph_msgs)](http://jenkins.ros.org/job/devel-indigo-graph_msgs) Devel Job Status
* [![Build Status](http://jenkins.ros.org/buildStatus/icon?job=ros-indigo-graph-msgs_binarydeb_trusty_amd64)](http://jenkins.ros.org/job/ros-indigo-graph-msgs_binarydeb_trusty_amd64/) AMD64 Debian Job Status
[![Formatting (pre-commit)](https://github.com/PickNikRobotics/graph_msgs/actions/workflows/format.yaml/badge.svg?branch=ros2)](https://github.com/PickNikRobotics/graph_msgs/actions/workflows/format.yaml?query=branch%3Aros2)
[![Build](https://github.com/PickNikRobotics/graph_msgs/actions/workflows/build.yaml/badge.svg?branch=ros2)](https://github.com/PickNikRobotics/graph_msgs/actions/workflows/build.yaml?query=branch%3Aros2)

## Supported Graph Types

Expand Down
2 changes: 1 addition & 1 deletion msg/Edges.msg
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
uint32[] node_ids

# optional cost/weight of each edge. if vector is empty assume all weights are equal (1)
float64[] weights
float64[] weights
Loading
Loading