このパッケージはSciurus17 ROS 2パッケージのPythonサンプルコード集です。
Sciurus17の起動方法はsciurus17_examplesのREADMEを参照してください。
準備ができたらサンプルプログラムを実行します。 例えばグリッパを開閉するサンプルは次のコマンドで実行できます。
ros2 launch sciurus17_examples_py example.launch.py example:='gripper_control'終了するときはCtrl+cを入力します。
Note
Gazeboでサンプルプログラムを実行する場合はuse_sim_timeオプションを付けます。
ros2 launch sciurus17_examples_py example.launch.py example:='gripper_control' use_sim_time:='true'demo.launchを実行している状態で各サンプルを実行できます。
- gripper_control
- pose_groupstate
- joint_values
- neck_control
- waist_control
- pick_and_place_right_arm_waist
- pick_and_place_left_arm
- color_detection
Note
実行できるサンプルの一覧は、example.launch.pyにオプション-sを付けて実行することで表示できます。
ros2 launch sciurus17_examples_py example.launch.py -sハンドを開閉させるコード例です。
次のコマンドを実行します。
ros2 launch sciurus17_examples_py example.launch.py example:='gripper_control'group_stateを使うコード例です。
SRDFファイルsciurus17_moveit_config/config/sciurus17.srdfに記載されているtwo_arm_init_poseとtwo_arm_push_forward_poseの姿勢に移行します。
次のコマンドを実行します。
ros2 launch sciurus17_examples_py example.launch.py example:='pose_groupstate'左側のアームのジョイント角度を1つずつ変化させるコード例です。
SRDFファイルsciurus17_moveit_config/config/sciurus17.srdfに記載されているl_arm_init_poseから、各関節角度を15度ずつ順番に変化させます。
次のコマンドを実行します。
ros2 launch sciurus17_examples_py example.launch.py example:='joint_values'首を上下左右へ動かすコード例です。
次のコマンドを実行します。
ros2 launch sciurus17_examples_py example.launch.py example:='neck_control'腰を左右へひねる動作をするコード例です。
次のコマンドを実行します。
ros2 launch sciurus17_examples_py example.launch.py example:='waist_control'右手でターゲットを掴んで動かすコード例です。腰の回転も使用します。
次のコマンドを実行します。
ros2 launch sciurus17_examples_py example.launch.py example:='pick_and_place_right_arm_waist'左手でターゲットを掴んで動かすコード例です。
次のコマンドを実行します。
ros2 launch sciurus17_examples_py example.launch.py example:='pick_and_place_left_arm'特定の色の物体を検出して掴むコード例です。
- デフォルトでは青い物体の位置をtfのフレームとして配信します。
- 検出した物体のフレーム名は
target_0です。 - 色の検出にはOpenCVを使用しています。
- 検出した物体の距離は深度画像から取得します。
次のコマンドを実行します。
ros2 launch sciurus17_examples_py camera_example.launch.py example:='color_detection'