Skip to content

Commit

Permalink
Merge pull request #11 from MrBearing/bug/fix_ci_settings
Browse files Browse the repository at this point in the history
fix ci setting
  • Loading branch information
MrBearing authored Oct 23, 2024
2 parents 4f41e33 + ae69a48 commit 461d0e3
Show file tree
Hide file tree
Showing 9 changed files with 195 additions and 174 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci_jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
ci:
runs-on: ${{ matrix.os }}
if: |
((github.event.action == 'labeled') && (github.event.label.name == 'TESTING') && (github.base_ref == 'main' )) ||
((github.event.action == 'synchronize') && (github.base_ref == 'main') && contains(github.event.pull_request.labels.*.name, 'TESTING')) ||
(github.ref_name == 'main')
((github.event.action == 'labeled') && (github.event.label.name == 'TESTING') && (github.base_ref == 'jazzy' )) ||
((github.event.action == 'synchronize') && (github.base_ref == 'jazzy') && contains(github.event.pull_request.labels.*.name, 'TESTING')) ||
(github.ref_name == 'jazzy')
container:
image: osrf/ros:${{ matrix.ros_distribution }}-desktop
timeout-minutes: 20
Expand All @@ -32,8 +32,8 @@ jobs:
with:
target-ros2-distro: ${{ matrix.ros_distribution }}
import-token: ${{ secrets.GITHUB_TOKEN }}
vcs-repo-file-url: build_depends.repos
package-name: |
sanehal
sanehal_bringup
sanehal_description
vcs-repo-file-url: build_depends.repos
sanehal_vehicle_description
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
"/opt/ros/jazzy/lib/python3.10/site-packages",
"/opt/ros/jazzy/local/lib/python3.10/dist-packages"
],
"ros.distro": "jazzy"
"ros.distro": "jazzy",
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
}
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Project SANEHAL

[![ci_jazzy](https://github.com/MrBearing/sanehal/actions/workflows/ci_jazzy.yaml/badge.svg)](https://github.com/MrBearing/sanehal/actions/workflows/ci_jazzy.yaml)

## 事前準備

- ROSのインストール
Expand Down
2 changes: 1 addition & 1 deletion build_depends.repos
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repositories:
ldlidar_stl_ros2:
type: git
url: https://github.com/MrBearing/ldlidar_stl_ros2.git
version: master
version: jazzy
ldlidar_stl_utils:
type: git
url: https://github.com/MrBearing/ldlidar_stl_utils.git
Expand Down
104 changes: 60 additions & 44 deletions sanehal_bringup/launch/diffbot.launch.py
Original file line number Diff line number Diff line change
@@ -1,97 +1,111 @@
# Copyright 2020 ros2_control Development Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# 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,
# 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 RegisterEventHandler
from launch.event_handlers import OnProcessExit
from launch.substitutions import Command, FindExecutable, PathJoinSubstitution,LaunchConfiguration
from launch.actions import DeclareLaunchArgument
from launch.actions import DeclareLaunchArgument, Node, RegisterEventHandler

from launch_ros.actions import Node
from launch.event_handlers import OnProcessExit
from launch.substitutions import (
Command,
FindExecutable,
LaunchConfiguration,
PathJoinSubstitution,
)
from launch_ros.substitutions import FindPackageShare


def generate_launch_description():
# Get URDF via xacro
robot_description_content = Command(
[
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution([FindExecutable(name='xacro')]),
' ',
PathJoinSubstitution(
[FindPackageShare("sanehal_vehicle_description"), "urdf", "diffbot.urdf.xacro"]
[
FindPackageShare('sanehal_vehicle_description'),
'urdf',
'diffbot.urdf.xacro',
]
),
]
)
robot_description = {"robot_description": robot_description_content}
robot_description = {'robot_description': robot_description_content}

robot_controllers = PathJoinSubstitution(
[
FindPackageShare("sanehal_vehicle_description"),
"controllers",
"diffbot_controllers.yaml",
FindPackageShare('sanehal_vehicle_description'),
'controllers',
'diffbot_controllers.yaml',
]
)
rviz_config_file = PathJoinSubstitution(
[FindPackageShare("sanehal_vehicle_description"), "config", "diffbot.rviz"]
[FindPackageShare('sanehal_vehicle_description'), 'config', 'diffbot.rviz']
)

# for debug
logger = LaunchConfiguration("log_level")
logger = LaunchConfiguration('log_level')
launch_arg = DeclareLaunchArgument(
"log_level",
default_value=["debug"],
description="Logging level",
'log_level',
default_value=['debug'],
description='Logging level',
)

control_node = Node(
package="controller_manager",
executable="ros2_control_node",
package='controller_manager',
executable='ros2_control_node',
parameters=[robot_description, robot_controllers],
output="both",
arguments=['--ros-args',
# '--log-level', logger
]
output='both',
arguments=[
'--ros-args',
'--log-level', logger
],
)
robot_state_pub_node = Node(
package="robot_state_publisher",
executable="robot_state_publisher",
output="both",
package='robot_state_publisher',
executable='robot_state_publisher',
output='both',
parameters=[robot_description],
remappings=[
("/diff_drive_controller/cmd_vel_unstamped", "/cmd_vel"),
('/diff_drive_controller/cmd_vel_unstamped', '/cmd_vel'),
],
)
rviz_node = Node(
package="rviz2",
executable="rviz2",
name="rviz2",
output="log",
arguments=["-d", rviz_config_file,
package='rviz2',
executable='rviz2',
name='rviz2',
output='log',
arguments=[
'-d',
rviz_config_file,
# '--ros-args', '--log-level', logger
],
)

joint_state_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
package='controller_manager',
executable='spawner',
arguments=[
'joint_state_broadcaster',
'--controller-manager',
'/controller_manager',
],
)

robot_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["diffbot_base_controller", "-c", "/controller_manager"],
package='controller_manager',
executable='spawner',
arguments=['diffbot_base_controller', '-c', '/controller_manager'],
)

# Delay rviz start after `joint_state_broadcaster`
Expand All @@ -103,10 +117,12 @@ def generate_launch_description():
)

# Delay start of robot_controller after `joint_state_broadcaster`
delay_robot_controller_spawner_after_joint_state_broadcaster_spawner = RegisterEventHandler(
event_handler=OnProcessExit(
target_action=joint_state_broadcaster_spawner,
on_exit=[robot_controller_spawner],
delay_robot_controller_spawner_after_joint_state_broadcaster_spawner = (
RegisterEventHandler(
event_handler=OnProcessExit(
target_action=joint_state_broadcaster_spawner,
on_exit=[robot_controller_spawner],
)
)
)

Expand Down
60 changes: 27 additions & 33 deletions sanehal_bringup/launch/diffbot_on_pi.launch.py
Original file line number Diff line number Diff line change
@@ -1,82 +1,76 @@
# Copyright 2020 ros2_control Development Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# 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,
# 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 RegisterEventHandler
from launch.event_handlers import OnProcessExit
from launch.substitutions import Command, FindExecutable, PathJoinSubstitution,LaunchConfiguration
from launch.actions import DeclareLaunchArgument

from launch.substitutions import (
Command,
FindExecutable,
PathJoinSubstitution,
)
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare


def generate_launch_description():
robot_description_content = Command(
[
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution([FindExecutable(name='xacro')]),
' ',
PathJoinSubstitution(
[FindPackageShare("sanehal_vehicle_description"), "urdf", "diffbot.urdf.xacro"]
[FindPackageShare('sanehal_vehicle_description'), 'urdf', 'diffbot.urdf.xacro']
),
]
)
robot_description = {"robot_description": robot_description_content}
robot_description = {'robot_description': robot_description_content}

robot_controllers = PathJoinSubstitution(
[
FindPackageShare("sanehal_vehicle_description"),
"controllers",
"diffbot_controllers.yaml",
FindPackageShare('sanehal_vehicle_description'),
'controllers',
'diffbot_controllers.yaml',
]
)

# for debug
# logger = LaunchConfiguration("log_level")
# launch_arg = DeclareLaunchArgument(
# "log_level",
# default_value=["debug"],
# description="Logging level",
# )

control_node = Node(
package="controller_manager",
executable="ros2_control_node",
package='controller_manager',
executable='ros2_control_node',
parameters=[robot_description, robot_controllers],
output="both",
output='both',
# arguments=['--ros-args', '--log-level', logger]
)
robot_state_pub_node = Node(
package="robot_state_publisher",
executable="robot_state_publisher",
output="both",
package='robot_state_publisher',
executable='robot_state_publisher',
output='both',
parameters=[robot_description],
remappings=[
("/diff_drive_controller/cmd_vel_unstamped", "/cmd_vel"),
('/diff_drive_controller/cmd_vel_unstamped', '/cmd_vel'),
],
)

joint_state_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
package='controller_manager',
executable='spawner',
arguments=['joint_state_broadcaster', '--controller-manager', '/controller_manager'],
)

robot_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["diffbot_base_controller", "-c", "/controller_manager"],
package='controller_manager',
executable='spawner',
arguments=['diffbot_base_controller', '-c', '/controller_manager'],
)

# Delay start of robot_controller after `joint_state_broadcaster`
Expand Down
Loading

0 comments on commit 461d0e3

Please sign in to comment.