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

mock componentsに対応します #159

Merged
merged 17 commits into from
Nov 25, 2024
Merged
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
15 changes: 15 additions & 0 deletions sciurus17_examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
- [3. move\_groupとcontrollerを起動する](#3-move_groupとcontrollerを起動する)
- [準備 (Gazeboを使う場合)](#準備-gazeboを使う場合)
- [1. move\_groupとGazeboを起動する](#1-move_groupとgazeboを起動する)
- [準備(Mock Componentsを使う場合)](#準備mock-componentsを使う場合)
- [1. move\_groupとcontrollerを起動する](#1-move_groupとcontrollerを起動する)
- [サンプルプログラムを実行する](#サンプルプログラムを実行する)
- [Gazeboでサンプルプログラムを実行する場合](#gazeboでサンプルプログラムを実行する場合)
- [Examples](#examples)
Expand Down Expand Up @@ -64,6 +66,19 @@ ros2 launch sciurus17_gazebo sciurus17_with_table.launch.py
ros2 launch sciurus17_gazebo sciurus17_with_table.launch.py use_head_camera:=false use_chest_camera:=false
```

## 準備(Mock Componentsを使う場合)

### 1. move_groupとcontrollerを起動する

次のコマンドでmove_group (`sciurus17_moveit_config`)と
controller (`sciurus17_control`)を起動します。

```sh
ros2 launch sciurus17_examples demo.launch.py use_mock_components:=true
```

Mock Componentsではカメラを使ったサンプルを実行することはできません。

## サンプルプログラムを実行する

準備ができたらサンプルプログラムを実行します。
Expand Down
8 changes: 8 additions & 0 deletions sciurus17_examples/launch/demo.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,18 @@ def generate_launch_description():
'manipulator_config.yaml'
)

declare_use_mock_components = DeclareLaunchArgument(
'use_mock_components',
default_value='false',
description='Use mock_components or not.'
)

description_loader = RobotDescriptionLoader()
description_loader.port_name = LaunchConfiguration('port_name')
description_loader.baudrate = LaunchConfiguration('baudrate')
description_loader.timeout_seconds = '1.0'
description_loader.manipulator_config_file_path = config_file_path
description_loader.use_mock_components = LaunchConfiguration('use_mock_components')

description = description_loader.load()

Expand Down Expand Up @@ -98,6 +105,7 @@ def generate_launch_description():
declare_baudrate,
declare_use_head_camera,
declare_use_chest_camera,
declare_use_mock_components,
move_group,
control_node,
head_camera_node,
Expand Down