From a273850706e0aefb48a1a15c26b24764eadaa8cc Mon Sep 17 00:00:00 2001 From: Atsushi Kuwagata Date: Fri, 17 Jan 2025 20:25:58 +0900 Subject: [PATCH] =?UTF-8?q?mock=20components=E3=82=AA=E3=83=97=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crane_x7_examples/README.md | 15 +++++++++++++++ crane_x7_examples/launch/demo.launch.py | 8 ++++++++ 2 files changed, 23 insertions(+) diff --git a/crane_x7_examples/README.md b/crane_x7_examples/README.md index 5355116b..985037f4 100644 --- a/crane_x7_examples/README.md +++ b/crane_x7_examples/README.md @@ -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) @@ -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ではカメラを使ったサンプルを実行することはできません。 + ## サンプルプログラムを実行する 準備ができたらサンプルプログラムを実行します。 diff --git a/crane_x7_examples/launch/demo.launch.py b/crane_x7_examples/launch/demo.launch.py index 9b7cead4..15a2aa5c 100644 --- a/crane_x7_examples/launch/demo.launch.py +++ b/crane_x7_examples/launch/demo.launch.py @@ -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', @@ -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 @@ -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,