Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikN committed Dec 4, 2023
1 parent 1c77d6d commit ba36cce
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 57 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/bump_version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ on:
description: Version to bump (major, minor, patch)
default: patch
required: true
pull_request:
branches: humble
types: [closed]
pull_request:
branches: humble
types: [closed]

jobs:
industrial_ci:
Expand Down
117 changes: 63 additions & 54 deletions .github/workflows/industrial_ci.yaml
Original file line number Diff line number Diff line change
@@ -1,66 +1,75 @@
---
name: Industrial CI
on:
workflow_call:
workflow_dispatch:
push:
workflow_call:
workflow_dispatch:
push:

jobs:
black:
name: Black
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Black
uses: psf/[email protected]
with:
options: --line-length=99
black:
name: Black
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Black
uses: psf/[email protected]
with:
options: --line-length=99

spellcheck:
name: Spellcheck
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Spellcheck
uses: rojopolis/[email protected]
spellcheck:
name: Spellcheck
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Spellcheck
uses: rojopolis/[email protected]

ros_industrial_ci:
name: ROS Industrial CI
needs:
- black
- spellcheck
strategy:
fail-fast: false
matrix:
ROS_DISTRO: [humble]
runs-on: ubuntu-22.04
ros_industrial_ci:
name: ROS Industrial CI
needs:
- black
- spellcheck
strategy:
fail-fast: false
matrix:
ROS_DISTRO: [humble]
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v3
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Copy to src
run: |
mkdir -p src
find . -maxdepth 1 -not -name src -not -name . -exec mv {} src/ \;
- name: Act + Docker fix
run: |
sudo chown runner:docker /var/run/docker.sock
- name: Clone installation requirements
shell: bash
run: |
python3 -m pip install -U vcstool
vcs import src < src/rosbot/rosbot_hardware.repos && vcs import src < src/rosbot/rosbot_simulation.repos
- name: Copy to src
run: |
mkdir -p src
find . -maxdepth 1 -not -name src -not -name . -exec mv {} src/ \;
- name: Copy only diff_drive_controller and imu_sensor_broadcaster, waits for features from ros2-control
shell: bash
run: |
cp -r src/ros2_controllers/diff_drive_controller src/
cp -r src/ros2_controllers/imu_sensor_broadcaster src/
rm -rf src/ros2_controllers
- name: Clone installation requirements
shell: bash
run: |
python3 -m pip install -U vcstool
vcs import src < src/rosbot/rosbot_hardware.repos && vcs import src < src/rosbot/rosbot_simulation.repos
- name: Running ROS Industrial CI
uses: ros-industrial/industrial_ci@master
env:
ROS_DISTRO: ${{matrix.ROS_DISTRO}}
DOCKER_IMAGE: ros:${{matrix.ROS_DISTRO}}-ros-base
- name: Copy only diff_drive_controller and imu_sensor_broadcaster, waits for features from ros2-control
shell: bash
run: |
cp -r src/ros2_controllers/diff_drive_controller src/
cp -r src/ros2_controllers/imu_sensor_broadcaster src/
rm -rf src/ros2_controllers
- name: Running ROS Industrial CI
uses: ros-industrial/industrial_ci@master
env:
ROS_DISTRO: ${{matrix.ROS_DISTRO}}
DOCKER_IMAGE: ros:${{matrix.ROS_DISTRO}}-ros-base
# BEFORE_INIT: |
# pwd
# sudo mkdir ./src
# ls -la
# vcs import src < ./rosbot/rosbot_hardware.repos && vcs import src < ./rosbot/rosbot_simulation.repos
90 changes: 90 additions & 0 deletions rosbot_bringup/launch/combined.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Copyright 2023 Husarion
#
# 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.

from launch import LaunchDescription
from launch.actions import (
IncludeLaunchDescription,
DeclareLaunchArgument,
SetEnvironmentVariable,
OpaqueFunction,
)
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import ThisLaunchFileDir, LaunchConfiguration
from launch_ros.actions import Node
import os


def generate_microros_agent_node(context, *args, **kwargs):
serial_port = LaunchConfiguration("serial_port").perform(context)
serial_baudrate = LaunchConfiguration("serial_baudrate").perform(context)
localhost_only_fastrtps_profiles_file = LaunchConfiguration(
"localhost_only_fastrtps_profiles_file"
).perform(context)

if os.environ.get("ROS_LOCALHOST_ONLY") == "1":
# with localhost only setup fastdds is required with a custom config
rmw_implementation = "rmw_fastrtps_cpp"
return [
SetEnvironmentVariable(name="RMW_IMPLEMENTATION", value=rmw_implementation),
SetEnvironmentVariable(
name="FASTRTPS_DEFAULT_PROFILES_FILE", value=localhost_only_fastrtps_profiles_file
),
Node(
package="micro_ros_agent",
executable="micro_ros_agent",
arguments=["serial", "-D", serial_port, "-b", serial_baudrate],
output="screen",
),
]
else:
return [
Node(
package="micro_ros_agent",
executable="micro_ros_agent",
arguments=["serial", "-D", serial_port, "-b", serial_baudrate],
output="screen",
)
]


def generate_launch_description():
declare_serial_port_arg = DeclareLaunchArgument(
"serial_port",
default_value="/dev/ttySERIAL",
description="Serial port for micro-ROS agent",
)

declare_serial_baudrate_arg = DeclareLaunchArgument(
"serial_baudrate", default_value="576000", description="Baud rate for serial communication"
)

declare_localhost_only_fastrtps_profiles_file_arg = DeclareLaunchArgument(
"localhost_only_fastrtps_profiles_file",
default_value="/microros_localhost_only.xml",
description="Path to the Fast RTPS default profiles file",
)

bringup_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource([ThisLaunchFileDir(), "/bringup.launch.py"])
)

return LaunchDescription(
[
declare_serial_port_arg,
declare_serial_baudrate_arg,
declare_localhost_only_fastrtps_profiles_file_arg,
OpaqueFunction(function=generate_microros_agent_node),
bringup_launch,
]
)

0 comments on commit ba36cce

Please sign in to comment.