From 5e4db91c71b811875c3af83ddf20b0894ce368bc Mon Sep 17 00:00:00 2001 From: YusukeKato Date: Tue, 5 Sep 2023 14:59:49 +0900 Subject: [PATCH] =?UTF-8?q?CRANE+=20V2=E3=81=AE=E3=83=81=E3=83=A5=E3=83=BC?= =?UTF-8?q?=E3=83=88=E3=83=AA=E3=82=A2=E3=83=AB=E3=81=ABHumble=E3=81=AE?= =?UTF-8?q?=E6=83=85=E5=A0=B1=E3=82=92=E8=BF=BD=E5=8A=A0=20(#34)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/cranev2/ros/install.md | 104 ++++++++++++----- docs/cranev2/ros/package-install.md | 28 +++-- docs/cranev2/ros/samples.md | 134 +++++++++++++++++++-- docs/cranev2/ros/simulator.md | 173 ++++++++++++++++++++++++++-- 4 files changed, 382 insertions(+), 57 deletions(-) diff --git a/docs/cranev2/ros/install.md b/docs/cranev2/ros/install.md index be9998e..43a58bb 100644 --- a/docs/cranev2/ros/install.md +++ b/docs/cranev2/ros/install.md @@ -12,52 +12,98 @@ robot: CRANE+ V2 * 設置済みCRANE+ V2本体 * [製品マニュアル](https://rt-net.jp/products/cranev2/)を読んで設置済みの状態を前提としています * ノートパソコン等のPC - * OS(**Ubuntu Desktop 20.04**)がインストール済みであることを前提としています + * OS(**Ubuntu Desktop**)がインストール済みであることを前提としています + * `ROS 2 Humble`を使用する場合(推奨): **Ubuntu Desktop 22.04** + * `ROS 2 Foxy`を使用する場合(非推奨): **Ubuntu Desktop 20.04** + +!!! info + `ROS 2 Foxy`は2023年6月にEOL(サポート終了)を迎えたため、`ROS 2 Humble`の使用を推奨しています。 ## ROS 2のインストール(公式のドキュメントに沿って進める場合) {: #official-document} -=== "ROS 2" +=== "ROS 2 Humble(推奨)" + + [https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html){target=_blank rel=noopener} + を参考に、`ROS 2 Humble`をインストールします。 + + GUIを使用する場合は`Desktop`を、 使用しない場合は`ROS-Base`パッケージをインストールします。 + + [https://docs.ros.org/en/humble/Tutorials/Colcon-Tutorial.html](https://docs.ros.org/en/humble/Tutorials/Colcon-Tutorial.html){target=_blank rel=noopener} + を参考に、パッケージビルドツールの`colcon`をインストールします。 -[https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html](https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html){target=_blank rel=noopener} -を参考に、`ROS 2 Foxy`をインストールします。 +=== "ROS 2 Foxy(非推奨)" -GUIを使用する場合は`Desktop`を、 使用しない場合は`ROS-Base`パッケージをインストールします。 + [https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html](https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html){target=_blank rel=noopener} + を参考に、`ROS 2 Foxy`をインストールします。 -[https://docs.ros.org/en/foxy/Tutorials/Colcon-Tutorial.html](https://docs.ros.org/en/foxy/Tutorials/Colcon-Tutorial.html){target=_blank rel=noopener} -を参考に、パッケージビルドツールの`colcon`をインストールします。 + GUIを使用する場合は`Desktop`を、 使用しない場合は`ROS-Base`パッケージをインストールします。 + + [https://docs.ros.org/en/foxy/Tutorials/Colcon-Tutorial.html](https://docs.ros.org/en/foxy/Tutorials/Colcon-Tutorial.html){target=_blank rel=noopener} + を参考に、パッケージビルドツールの`colcon`をインストールします。 ## ROS 2のインストール(インストールスクリプトを使う場合) {: #install-script} 非公式のインストールスクリプトを使うことで簡単にROS 2をインストールできます。 -=== "ROS 2" +=== "ROS 2 Humble(推奨)" + + このROS 2インストールスクリプトは`curl`と`git`を使用します。以下のコマンドで + インストールします。 + + ```sh + sudo apt install -y curl git + ``` + + 以下のコマンドでROS 2インストールスクリプトを実行します。 + 環境にもよりますが完了までは10分以上かかる場合があります。 + + ```sh + git clone https://github.com/Tiryoh/ros2_setup_scripts_ubuntu.git + cd ros2_setup_scripts_ubuntu + ./ros2-humble-desktop-main.sh + ``` + + スクリプトが問題なく実行できれば以下のメッセージが表示されます。 + + ```txt + Success installing ROS humble + Run 'source ~/.bashrc' + ``` + + 以下のコマンドでインストールした設定を読み込みます。 + + ```sh + source ~/.bashrc + ``` + +=== "ROS 2 Foxy(非推奨)" -このROS 2インストールスクリプトは`curl`と`git`を使用します。以下のコマンドで -インストールします。 + このROS 2インストールスクリプトは`curl`と`git`を使用します。以下のコマンドで + インストールします。 -```sh -sudo apt install -y curl git -``` + ```sh + sudo apt install -y curl git + ``` -以下のコマンドでROS 2インストールスクリプトを実行します。 -環境にもよりますが完了までは10分以上かかる場合があります。 + 以下のコマンドでROS 2インストールスクリプトを実行します。 + 環境にもよりますが完了までは10分以上かかる場合があります。 -```sh -git clone https://github.com/Tiryoh/ros2_setup_scripts_ubuntu.git -cd ros2_setup_scripts_ubuntu -./ros2-foxy-desktop-main.sh -``` + ```sh + git clone https://github.com/Tiryoh/ros2_setup_scripts_ubuntu.git + cd ros2_setup_scripts_ubuntu + ./ros2-foxy-desktop-main.sh + ``` -スクリプトが問題なく実行できれば以下のメッセージが表示されます。 + スクリプトが問題なく実行できれば以下のメッセージが表示されます。 -```txt -Success installing ROS foxy -Run 'source ~/.bashrc' -``` + ```txt + Success installing ROS foxy + Run 'source ~/.bashrc' + ``` -以下のコマンドでインストールした設定を読み込みます。 + 以下のコマンドでインストールした設定を読み込みます。 -```sh -source ~/.bashrc -``` + ```sh + source ~/.bashrc + ``` diff --git a/docs/cranev2/ros/package-install.md b/docs/cranev2/ros/package-install.md index 7412707..a7e7d4c 100644 --- a/docs/cranev2/ros/package-install.md +++ b/docs/cranev2/ros/package-install.md @@ -12,18 +12,30 @@ robot: CRANE+ V2 * 設置済みCRANE+ V2本体 * [製品マニュアル](https://rt-net.jp/products/cranev2/)を読んで設置済みの状態を前提としています * ノートパソコン等のPC - * OS(**Ubuntu Desktop 20.04**)がインストール済みであることを前提としています + * OS(**Ubuntu Desktop**)がインストール済みであることを前提としています + * `ROS 2 Humble`を使用する場合(推奨): **Ubuntu Desktop 22.04** + * `ROS 2 Foxy`を使用する場合(非推奨): **Ubuntu Desktop 20.04** * ROS 2がインストール済みであることを前提としています * [ROS 2のインストール手順](./install.md)を参照してください ## ROS 2パッケージのインストール {: #installation-binary} -=== "ROS 2" +=== "ROS 2 Humble(推奨)" -ノートパソコン等のPCに、 -ROS 2パッケージ[rt-net/crane_plus](https://github.com/rt-net/crane_plus){target=_blank rel=noopener} -をインストールします。 + ノートパソコン等のPCに、 + ROS 2パッケージ[rt-net/crane_plus](https://github.com/rt-net/crane_plus){target=_blank rel=noopener} + をインストールします。 -```sh -sudo apt install ros-foxy-crane-plus -``` + ```sh + sudo apt install ros-humble-crane-plus + ``` + +=== "ROS 2 Foxy(非推奨)" + + ノートパソコン等のPCに、 + ROS 2パッケージ[rt-net/crane_plus](https://github.com/rt-net/crane_plus){target=_blank rel=noopener} + をインストールします。 + + ```sh + sudo apt install ros-foxy-crane-plus + ``` diff --git a/docs/cranev2/ros/samples.md b/docs/cranev2/ros/samples.md index a9a485d..0e64718 100644 --- a/docs/cranev2/ros/samples.md +++ b/docs/cranev2/ros/samples.md @@ -14,7 +14,9 @@ robot: CRANE+ V2 * 設置済みCRANE+ V2本体 * [製品マニュアル](https://rt-net.jp/products/cranev2/)を読んで設置済みの状態を前提としています * ノートパソコン等のPC - * OS(**Ubuntu Desktop 20.04**)がインストール済みであることを前提としています + * OS(**Ubuntu Desktop**)がインストール済みであることを前提としています + * `ROS 2 Humble`を使用する場合(推奨): **Ubuntu Desktop 22.04** + * `ROS 2 Foxy`を使用する場合(非推奨): **Ubuntu Desktop 20.04** * ROS 2がインストール済みであることを前提としています * [ROS 2のインストール手順](./install.md)を参照してください * ROS 2用のパッケージがインストール済みであることを前提としています @@ -36,16 +38,130 @@ sudo chmod 666 /dev/ttyUSB0 ## ROS 2サンプルの実行 {: examples} +### gripper_control + === "ROS 2" -次のコマンドでmove_group(`crane_plus_moveit_config`)とcontroller(`crane_plus_control`)を起動します。 + 詳しい実行手順は[サンプル集のgripper_control](https://github.com/rt-net/crane_plus/tree/master/crane_plus_examples#gripper_control){target=_blank rel=noopener} + を参照してください。 -```sh -ros2 launch crane_plus_examples demo.launch.py port_name:=/dev/ttyUSB0 -``` + 次のコマンドでmove_group(`crane_plus_moveit_config`)とcontroller(`crane_plus_control`)を起動します。 + + ```sh + ros2 launch crane_plus_examples demo.launch.py port_name:=/dev/ttyUSB0 + ``` + + 別のターミナルで次のコマンドを実行すると、CRANE+ V2のグリッパが開閉します。 + + ```sh + ros2 launch crane_plus_examples example.launch.py example:='gripper_control' + ``` -別のターミナルで次のコマンドを実行すると、CRANE+ V2のグリッパが開閉します。 + -```sh -ros2 launch crane_plus_examples example.launch.py example:='gripper_control' -``` +### pose_groupstate + +=== "ROS 2" + + 詳しい実行手順は[サンプル集のpose_groupstate](https://github.com/rt-net/crane_plus/blob/master/crane_plus_examples/README.md#pose_groupstate){target=_blank rel=noopener} + を参照してください。 + + 次のコマンドでmove_group(`crane_plus_moveit_config`)とcontroller(`crane_plus_control`)を起動します。 + + ```sh + ros2 launch crane_plus_examples demo.launch.py port_name:=/dev/ttyUSB0 + ``` + + 別のターミナルで次のコマンドを実行すると、CRANE+ V2が`home`と`vertical`の姿勢へ移行します。 + + ```sh + ros2 launch crane_plus_examples example.launch.py example:='pose_groupstate' + ``` + + + +### joint_values + +=== "ROS 2" + + 詳しい実行手順は[サンプル集のjoint_values](https://github.com/rt-net/crane_plus/blob/master/crane_plus_examples/README.md#joint_values){target=_blank rel=noopener} + を参照してください。 + + 次のコマンドでmove_group(`crane_plus_moveit_config`)とcontroller(`crane_plus_control`)を起動します。 + + ```sh + ros2 launch crane_plus_examples demo.launch.py port_name:=/dev/ttyUSB0 + ``` + + 別のターミナルで次のコマンドを実行すると、CRANE+ V2の各関節が一つずつ変化します。 + + ```sh + ros2 launch crane_plus_examples example.launch.py example:='joint_values' + ``` + + + +### pick_and_place + +=== "ROS 2" + + 詳しい実行手順は[サンプル集のpick_and_place](https://github.com/rt-net/crane_plus/blob/master/crane_plus_examples/README.md#pick_and_place){target=_blank rel=noopener} + を参照してください。 + + 次のコマンドでmove_group(`crane_plus_moveit_config`)とcontroller(`crane_plus_control`)を起動します。 + + ```sh + ros2 launch crane_plus_examples demo.launch.py port_name:=/dev/ttyUSB0 + ``` + + 別のターミナルで次のコマンドを実行すると、CRANE+ V2がピックアンドプレース動作を行います。 + + ```sh + ros2 launch crane_plus_examples example.launch.py example:='pick_and_place' + ``` + + + +## ROS 2カメラサンプルの実行 {: camera_examples} + +### aruco_detection + +=== "ROS 2" + + 詳しい実行手順は[サンプル集のaruco_detection](https://github.com/rt-net/crane_plus/blob/master/crane_plus_examples/README.md#aruco_detection){target=_blank rel=noopener} + を参照してください。 + + 次のコマンドでmove_group(`crane_plus_moveit_config`)とcontroller(`crane_plus_control`)、カメラノードを起動します。 + + ```sh + ros2 launch crane_plus_examples demo.launch.py port_name:=/dev/ttyUSB0 use_camera:=true video_device:=/dev/video0 + ``` + + 別のターミナルで次のコマンドを実行すると、カメラ画像から物体に取り付けたマーカを検出し、CRANE+ V2がピックアンドプレースを行います。 + + ```sh + ros2 launch crane_plus_examples example.launch.py example:='aruco_detection' + ``` + + + +### color_detection + +=== "ROS 2" + + 詳しい実行手順は[サンプル集のcolor_detection](https://github.com/rt-net/crane_plus/blob/master/crane_plus_examples/README.md#color_detection){target=_blank rel=noopener} + を参照してください。 + + 次のコマンドでmove_group(`crane_plus_moveit_config`)とcontroller(`crane_plus_control`)、カメラノードを起動します。 + + ```sh + ros2 launch crane_plus_examples demo.launch.py port_name:=/dev/ttyUSB0 use_camera:=true video_device:=/dev/video0 + ``` + + 別のターミナルで次のコマンドを実行すると、カメラ画像から特定の色の物体を検出し、CRANE+ V2がピックアンドプレースを行います。 + + ```sh + ros2 launch crane_plus_examples example.launch.py example:='color_detection' + ``` + + diff --git a/docs/cranev2/ros/simulator.md b/docs/cranev2/ros/simulator.md index e102c62..2e0b706 100644 --- a/docs/cranev2/ros/simulator.md +++ b/docs/cranev2/ros/simulator.md @@ -14,25 +14,176 @@ robot: CRANE+ V2 * 設置済みCRANE+ V2本体 * [製品マニュアル](https://rt-net.jp/products/cranev2/)を読んで設置済みの状態を前提としています * ノートパソコン等のPC - * OS(**Ubuntu Desktop 20.04**)がインストール済みであることを前提としています + * OS(**Ubuntu Desktop**)がインストール済みであることを前提としています + * `ROS 2 Humble`を使用する場合(推奨): **Ubuntu Desktop 22.04** + * `ROS 2 Foxy`を使用する場合(非推奨): **Ubuntu Desktop 20.04** * ROS 2がインストール済みであることを前提としています * [ROS 2のインストール手順](./install.md)を参照してください * ROS 2用のパッケージがインストール済みであることを前提としています * [ROS 2パッケージのインストール手順](./package-install.md)を参照してください -## シミュレータの動作確認 {: simulator} +## ROS 2サンプルの実行 -=== "ROS 2" +### gripper_control -次のコマンドでmove_group(`crane_plus_moveit_config`)とIgnition Gazeboを起動します。 +=== "ROS 2 Humble(推奨)" -```sh -ros2 launch crane_plus_ignition crane_plus_ignition.launch.py -``` + 詳しい実行手順は[サンプル集のgripper_control](https://github.com/rt-net/crane_plus/tree/master/crane_plus_examples#gripper_control){target=_blank rel=noopener} + を参照してください。 -別のターミナルで次のコマンドを実行すると、シミュレータ上のCRANE+ V2のグリッパが開閉します。 + 次のコマンドでmove_group(`crane_plus_moveit_config`)とIgnition Gazeboを起動します。 -```sh -ros2 launch crane_plus_examples example.launch.py example:='gripper_control' -``` + ```sh + ros2 launch crane_plus_gazebo crane_plus_with_table.launch.py + ``` + 別のターミナルで次のコマンドを実行すると、CRANE+ V2のグリッパが開閉します。 + + ```sh + ros2 launch crane_plus_examples example.launch.py example:='gripper_control' use_sim_time:=true + ``` + + + + + +=== "ROS 2 Foxy(非推奨)" + + 詳しい実行手順は[サンプル集のgripper_control](https://github.com/rt-net/crane_plus/tree/master/crane_plus_examples#gripper_control){target=_blank rel=noopener} + を参照してください。 + + 次のコマンドでmove_group(`crane_plus_moveit_config`)とIgnition Gazeboを起動します。 + + ```sh + ros2 launch crane_plus_ignition crane_plus_ignition.launch.py + ``` + + 別のターミナルで次のコマンドを実行すると、CRANE+ V2のグリッパが開閉します。 + + ```sh + ros2 launch crane_plus_examples example.launch.py example:='gripper_control' use_sim_time:=true + ``` + + + + + +### pose_groupstate + +=== "ROS 2 Humble(推奨)" + + 詳しい実行手順は[サンプル集のpose_groupstate](https://github.com/rt-net/crane_plus/blob/master/crane_plus_examples/README.md#pose_groupstate){target=_blank rel=noopener} + を参照してください。 + + 次のコマンドでmove_group(`crane_plus_moveit_config`)とIgnition Gazeboを起動します。 + + ```sh + ros2 launch crane_plus_gazebo crane_plus_with_table.launch.py + ``` + + 別のターミナルで次のコマンドを実行すると、CRANE+ V2が`home`と`vertical`の姿勢へ移行します。 + + ```sh + ros2 launch crane_plus_examples example.launch.py example:='pose_groupstate' use_sim_time:=true + ``` + + + +=== "ROS 2 Foxy(非推奨)" + + 詳しい実行手順は[サンプル集のpose_groupstate](https://github.com/rt-net/crane_plus/blob/master/crane_plus_examples/README.md#pose_groupstate){target=_blank rel=noopener} + を参照してください。 + + 次のコマンドでmove_group(`crane_plus_moveit_config`)とIgnition Gazeboを起動します。 + + ```sh + ros2 launch crane_plus_ignition crane_plus_ignition.launch.py + ``` + + 別のターミナルで次のコマンドを実行すると、CRANE+ V2が`home`と`vertical`の姿勢へ移行します。 + + ```sh + ros2 launch crane_plus_examples example.launch.py example:='pose_groupstate' use_sim_time:=true + ``` + + + +### joint_values + +=== "ROS 2 Humble(推奨)" + + 詳しい実行手順は[サンプル集のjoint_values](https://github.com/rt-net/crane_plus/blob/master/crane_plus_examples/README.md#joint_values){target=_blank rel=noopener} + を参照してください。 + + 次のコマンドでmove_group(`crane_plus_moveit_config`)とIgnition Gazeboを起動します。 + + ```sh + ros2 launch crane_plus_gazebo crane_plus_with_table.launch.py + ``` + + 別のターミナルで次のコマンドを実行すると、CRANE+ V2の各関節が一つずつ変化します。 + + ```sh + ros2 launch crane_plus_examples example.launch.py example:='joint_values' use_sim_time:=true + ``` + + + +=== "ROS 2 Foxy(非推奨)" + + 詳しい実行手順は[サンプル集のjoint_values](https://github.com/rt-net/crane_plus/blob/master/crane_plus_examples/README.md#joint_values){target=_blank rel=noopener} + を参照してください。 + + 次のコマンドでmove_group(`crane_plus_moveit_config`)とIgnition Gazeboを起動します。 + + ```sh + ros2 launch crane_plus_ignition crane_plus_ignition.launch.py + ``` + + 別のターミナルで次のコマンドを実行すると、CRANE+ V2の各関節が一つずつ変化します。 + + ```sh + ros2 launch crane_plus_examples example.launch.py example:='joint_values' use_sim_time:=true + ``` + + + +### pick_and_place + +=== "ROS 2 Humble(推奨)" + + 詳しい実行手順は[サンプル集のpick_and_place](https://github.com/rt-net/crane_plus/blob/master/crane_plus_examples/README.md#pick_and_place){target=_blank rel=noopener} + を参照してください。 + + 次のコマンドでmove_group(`crane_plus_moveit_config`)とcontroller(`crane_plus_control`)を起動します。 + + ```sh + ros2 launch crane_plus_gazebo crane_plus_with_table.launch.py + ``` + + 別のターミナルで次のコマンドを実行すると、CRANE+ V2がピックアンドプレース動作を行います。 + + ```sh + ros2 launch crane_plus_examples example.launch.py example:='pick_and_place' use_sim_time:=true + ``` + + + +=== "ROS 2 Foxy(非推奨)" + + 詳しい実行手順は[サンプル集のpick_and_place](https://github.com/rt-net/crane_plus/blob/master/crane_plus_examples/README.md#pick_and_place){target=_blank rel=noopener} + を参照してください。 + + 次のコマンドでmove_group(`crane_plus_moveit_config`)とcontroller(`crane_plus_control`)を起動します。 + + ```sh + ros2 launch crane_plus_ignition crane_plus_ignition.launch.py + ``` + + 別のターミナルで次のコマンドを実行すると、CRANE+ V2がピックアンドプレース動作を行います。 + + ```sh + ros2 launch crane_plus_examples example.launch.py example:='pick_and_place' use_sim_time:=true + ``` + +