Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: [capability] Add GitHub CI config #29

Open
wants to merge 3 commits into
base: kinetic
Choose a base branch
from
Open
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
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI

on:
# direct pushes to protected branches are not supported
pull_request:
push:
workflow_dispatch:

jobs:
i_ci:
name: ubuntu_bionic (${{ matrix.ros_repo }})
runs-on: ubuntu-latest

strategy:
matrix:
ros_distro: [ melodic, noetic ]
ros_repo: [ main, testing ]

env:
CCACHE_DIR: "${{ github.workspace }}/.ccache"
CATKIN_LINT: "true"
CATKIN_LINT_ARGS: --ignore launch_depend

steps:
- name: Fetch repository
uses: actions/checkout@v2

- name: ccache cache
uses: actions/cache@v2
with:
path: ${{ env.CCACHE_DIR }}
# we always want the ccache cache to be persisted, as we cannot easily
# determine whether dependencies have changed, and ccache will manage
# updating the cache for us. Adding 'run_id' to the key will force an
# upload at the end of the job.
key: ccache-${{ matrix.ros_distro }}-${{ matrix.ros_repo }}-${{github.run_id}}
restore-keys: |
ccache-${{ matrix.ros_distro }}-${{ matrix.ros_repo }}

- name: Run industrial_ci
uses: ros-industrial/industrial_ci@master
env:
ROS_DISTRO: ${{ matrix.ros_distro }}
ROS_REPO: ${{ matrix.ros_repo }}
8 changes: 4 additions & 4 deletions bag_tools/scripts/bag_add_time_offset.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,20 @@ def fix_bagfile(inbag, outbag, topics, offset):
rospy.loginfo('Closing output bagfile.')
outbag.close()
rospy.loginfo('Changed the following:')
for k, v in count.iteritems():
for k, v in count.items():
rospy.loginfo( '%s:%s messages.',k,v)

if __name__ == "__main__":
rospy.init_node('bag_add_time_offset')
parser = argparse.ArgumentParser(
description='Shift the publishing time of given topics in input bagfile.')
parser.add_argument('-o', metavar='OUTPUT_BAGFILE', required=True, help='output bagfile')
parser.add_argument('-i', metavar='INPUT_BAGFILE', required=True, help='input bagfile(s)', nargs='+')
parser.add_argument('-i', metavar='INPUT_BAGFILE', required=True, help='input bagfile(s)')
parser.add_argument('-of', metavar='OFFSET', required=True, type=float, help='time offset to add in seconds')
parser.add_argument('-t', metavar='TOPIC', required=True, help='topic(s) to change', nargs='+')
args = parser.parse_args()
try:
fix_bagfile(args.i, args.o, arg.t, args.of)
except Exception, e:
fix_bagfile(args.i, args.o, args.t, args.of)
except Exception as e:
import traceback
traceback.print_exc()
7 changes: 4 additions & 3 deletions bag_tools/scripts/check_delay.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import os
import sys
import argparse
import statistics

def check_delay(inbags):
delays = {}
Expand All @@ -59,12 +60,12 @@ def check_delay(inbags):
delays[key].append(delay)
max_len = max(len(topic) for topic in delays.keys())
topics = delays.keys()
topics.sort()
list(topics).sort()
for topic in topics:
delay_list = delays[topic]
delay_list.sort()
dmin, dmax, dmean = min(delay_list), max(delay_list), sum(delay_list)/len(delay_list)
dmedian = delay_list[len(delay_list)/2]
dmedian = statistics.median(delay_list)
rospy.loginfo('%s : mean = %s, min = %s, max = %s, median = %s', topic.ljust(max_len + 2), dmean, dmin, dmax, dmedian)

if __name__ == "__main__":
Expand All @@ -77,6 +78,6 @@ def check_delay(inbags):
args = parser.parse_args()
try:
check_delay(args.inbag)
except Exception, e:
except Exception as e:
import traceback
traceback.print_exc()