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対応 #201

Open
wants to merge 1 commit into
base: ros2
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
15 changes: 15 additions & 0 deletions crane_x7_examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
- [RealSense D435マウンタ搭載モデルを使用する場合](#realsense-d435マウンタ搭載モデルを使用する場合)
- [準備 (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 @@ -80,6 +82,19 @@ Gazeboを起動します。
ros2 launch crane_x7_gazebo crane_x7_with_table.launch.py
```

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

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

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

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

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

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

準備ができたらサンプルプログラムを実行します。
Expand Down
8 changes: 8 additions & 0 deletions crane_x7_examples/launch/demo.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ def generate_launch_description():
description='Use d435.'
)

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

config_file_path = os.path.join(
get_package_share_directory('crane_x7_control'),
'config',
Expand Down Expand Up @@ -78,6 +84,7 @@ def generate_launch_description():
description_loader.port_name = LaunchConfiguration('port_name')
description_loader.baudrate = LaunchConfiguration('baudrate')
description_loader.use_d435 = LaunchConfiguration('use_d435')
description_loader.use_mock_components = LaunchConfiguration('use_mock_components')
description_loader.timeout_seconds = '1.0'
description_loader.manipulator_config_file_path = config_file_path
description_loader.manipulator_links_file_path = links_file_path
Expand Down Expand Up @@ -118,6 +125,7 @@ def generate_launch_description():
declare_port_name,
declare_baudrate,
declare_use_d435,
declare_use_mock_components,
declare_rviz_config,
declare_rviz_config_camera,
move_group,
Expand Down
Loading