-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.1.0リリースのためにros2ブランチの変更差分をhumble-develブランチへマージ (#49)
Co-authored-by: Daisuke Sato <daisuke.sato@rt-net.jp> Co-authored-by: Shota Aoki <s.aoki@rt-net.jp>
- Loading branch information
1 parent
bdd3e2a
commit 833a5e2
Showing
17 changed files
with
399 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: industrial_ci | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- 'docs/**' | ||
- '**.md' | ||
pull_request: | ||
paths-ignore: | ||
- 'docs/**' | ||
- '**.md' | ||
schedule: | ||
- cron: "0 2 * * 0" # Weekly on Sundays at 02:00 | ||
|
||
jobs: | ||
industrial_ci: | ||
strategy: | ||
matrix: | ||
env: | ||
- { ROS_DISTRO: humble, ROS_REPO: ros } | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: "ros-industrial/industrial_ci@master" | ||
env: ${{ matrix.env }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Contribution Guide | ||
|
||
本リポジトリへのコントリビュート方法について記載しています。 | ||
|
||
## Issues | ||
|
||
リポジトリの品質向上にご協力頂きありがとうございます。 | ||
|
||
Issueの作成を簡単にするテンプレートを用意しているので活用してください。 | ||
|
||
## Pull Requests | ||
|
||
Pull Requestの作成ありがとうございます。 | ||
提出したPull Request(PR)には次のルールが適用されます。 | ||
|
||
- PRの内容には本リポジトリのライセンス([LICENSE](./LICENSE)と[README.md](./README.md)に記載されています)が適用されます | ||
- PRは`rt-net`のメンバーによるレビューを経てからマージされます | ||
- すべてのPRがマージされるわけではなく、希望に添えない場合もありますのでご容赦ください | ||
- リポジトリにテストが設定されている場合はできるだけテストを通してください | ||
- 何かしらの理由(テストに間違いがある場合など)でテストを通さずPRを出す場合はその旨をPRに記載してください | ||
- マージする際にはPR内の全コミットが1つのコミットに`squash`されます | ||
- [コミットをスカッシュしてマージする | GitHub Docs](https://docs.github.com/ja/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-commits) | ||
- 1つのPRでリクエストする変更はできるだけシンプルにしてください | ||
- 異なる内容の変更を含む場合はPRを分割してください | ||
- 例えば、複数の機能追加したり、機能追加とリファクタリングを同時にする場合はそれぞれ別々のPRとしてください | ||
- squashマージしても履歴を辿りやすくするためです | ||
|
||
## LICENSE | ||
|
||
Any contribution that you make to this repository will | ||
be under the MIT license, as dictated by that | ||
[license](https://opensource.org/licenses/MIT). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# The MIT License (MIT) | ||
# | ||
# Copyright 2023 RT Corporation <support@rt-net.jp> | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
# this software and associated documentation files (the "Software"), to deal in | ||
# the Software without restriction, including without limitation the rights to | ||
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
# the Software, and to permit persons to whom the Software is furnished to do so, | ||
# subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
import os | ||
|
||
from ament_index_python.packages import get_package_share_directory | ||
from launch.substitutions import Command | ||
|
||
|
||
class RobotDescriptionLoader(): | ||
|
||
def __init__(self): | ||
self.robot_description_path = os.path.join( | ||
get_package_share_directory('raspimouse_description'), | ||
'urdf', | ||
'raspimouse.urdf.xacro') | ||
self.lidar = 'none' | ||
self.lidar_frame = 'laser' | ||
self.use_gazebo = 'false' | ||
self.use_rgb_camera = 'false' | ||
self.gz_control_config_package = '' | ||
self.gz_control_config_file_path = '' | ||
|
||
def load(self): | ||
return Command([ | ||
'xacro ', | ||
self.robot_description_path, | ||
' lidar:=', self.lidar, | ||
' lidar_frame:=', self.lidar_frame, | ||
' use_gazebo:=', self.use_gazebo, | ||
' use_rgb_camera:=', self.use_rgb_camera, | ||
' gz_control_config_package:=', self.gz_control_config_package, | ||
' gz_control_config_file_path:=', self.gz_control_config_file_path | ||
]) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
# The MIT License (MIT) | ||
# | ||
# Copyright 2023 RT Corporation <support@rt-net.jp> | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
# this software and associated documentation files (the "Software"), to deal in | ||
# the Software without restriction, including without limitation the rights to | ||
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
# the Software, and to permit persons to whom the Software is furnished to do so, | ||
# subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
from raspimouse_description.robot_description_loader import RobotDescriptionLoader | ||
from launch.launch_context import LaunchContext | ||
import pytest | ||
|
||
|
||
def exec_load(loader): | ||
# Command substitutionの実行方法はCommandのテストを参考にした | ||
# https://github.com/ros2/launch/blob/074cd2903ddccd61bce8f40a0f58da0b7c200481/launch/test/launch/substitutions/test_command.py#L47 | ||
context = LaunchContext() | ||
return loader.load().perform(context) | ||
|
||
|
||
def test_load_description(): | ||
# xacroの読み込みが成功することを期待 | ||
rdl = RobotDescriptionLoader() | ||
assert exec_load(rdl) | ||
|
||
|
||
def test_change_description_path(): | ||
# xacroのファイルパスを変更し、読み込みが失敗することを期待 | ||
rdl = RobotDescriptionLoader() | ||
rdl.robot_description_path = 'hoge' | ||
with pytest.raises(Exception) as e: | ||
exec_load(rdl) | ||
assert e.value | ||
|
||
|
||
def test_lidar_none(): | ||
# lidarが変更されて、xacroに何もセットされないことを期待 | ||
rdl = RobotDescriptionLoader() | ||
rdl.lidar = 'none' | ||
assert 'laser' not in exec_load(rdl) | ||
|
||
|
||
def test_lidar_urg(): | ||
# lidarが変更されて、xacroにURGがセットされることを期待 | ||
rdl = RobotDescriptionLoader() | ||
rdl.lidar = 'urg' | ||
assert 'urg_mount_link' in exec_load(rdl) | ||
|
||
|
||
def test_lidar_lds(): | ||
# lidarが変更されて、xacroにLDSがセットされることを期待 | ||
rdl = RobotDescriptionLoader() | ||
rdl.lidar = 'lds' | ||
assert 'lds_multi_mount_link' in exec_load(rdl) | ||
|
||
|
||
def test_lidar_rplidar(): | ||
# lidarが変更されて、xacroにRPLiDARがセットされることを期待 | ||
rdl = RobotDescriptionLoader() | ||
rdl.lidar = 'rplidar' | ||
assert 'rplidar_multi_mount_link' in exec_load(rdl) | ||
|
||
|
||
def test_lidar_frame(): | ||
# lidar_frameが変更されて、xacroにlaserがセットされることを期待 | ||
rdl = RobotDescriptionLoader() | ||
rdl.lidar = 'urg' | ||
rdl.lidar_frame = 'laser' | ||
assert 'laser' in exec_load(rdl) | ||
|
||
|
||
def test_use_gazebo(): | ||
# use_gazeboが変更され、xacroにgazebo_ros2_controlがセットされることを期待 | ||
rdl = RobotDescriptionLoader() | ||
rdl.use_gazebo = 'true' | ||
rdl.gz_control_config_package = 'raspimouse_description' | ||
rdl.gz_control_config_file_path = 'test/dummy_controllers.yaml' | ||
assert 'ign_ros2_control/IgnitionSystem' in exec_load(rdl) | ||
|
||
|
||
def test_use_rgb_camera(): | ||
# use_rgb_cameraが変更され、xacroにRGB Cameraがセットされることを期待 | ||
rdl = RobotDescriptionLoader() | ||
rdl.use_rgb_camera = 'true' | ||
rdl.gz_control_config_package = 'raspimouse_description' | ||
rdl.gz_control_config_file_path = 'test/dummy_controllers.yaml' | ||
assert 'realsense2_description/meshes/d435.dae' in exec_load(rdl) | ||
|
||
|
||
def test_camera_link(): | ||
# use_gazeboとuse_rgb_cameraが変更され、xacroにcamera linkがセットされることを期待 | ||
rdl = RobotDescriptionLoader() | ||
rdl.use_gazebo = 'true' | ||
rdl.use_rgb_camera = 'true' | ||
rdl.gz_control_config_package = 'raspimouse_description' | ||
rdl.gz_control_config_file_path = 'test/dummy_controllers.yaml' | ||
assert 'camera_link' in exec_load(rdl) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.