sciurus17examplespy
July 21, 2026 · View on GitHub
このパッケージはSciurus17 ROS 2パッケージのPythonサンプルコード集です。
Table of Contents
Setup
Sciurus17の起動方法はsciurus17_examplesのREADMEを参照してください。
How to Run Examples
準備ができたらサンプルプログラムを実行します。 例えばグリッパを開閉するサンプルは次のコマンドで実行できます。
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'
Examples
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
gripper_control
ハンドを開閉させるコード例です。
次のコマンドを実行します。
ros2 launch sciurus17_examples_py example.launch.py example:='gripper_control'
pose_groupstate
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'
joint_values
左側のアームのジョイント角度を1つずつ変化させるコード例です。
SRDFファイルsciurus17_moveit_config/config/sciurus17.srdfに記載されているl_arm_init_poseから、各関節角度を15度ずつ順番に変化させます。
次のコマンドを実行します。
ros2 launch sciurus17_examples_py example.launch.py example:='joint_values'
neck_control
首を上下左右へ動かすコード例です。
次のコマンドを実行します。
ros2 launch sciurus17_examples_py example.launch.py example:='neck_control'
waist_control
腰を左右へひねる動作をするコード例です。
次のコマンドを実行します。
ros2 launch sciurus17_examples_py example.launch.py example:='waist_control'
pick_and_place_right_arm_waist
右手でターゲットを掴んで動かすコード例です。腰の回転も使用します。
次のコマンドを実行します。
ros2 launch sciurus17_examples_py example.launch.py example:='pick_and_place_right_arm_waist'
pick_and_place_left_arm
左手でターゲットを掴んで動かすコード例です。
次のコマンドを実行します。
ros2 launch sciurus17_examples_py example.launch.py example:='pick_and_place_left_arm'
aruco_detection
モノに取り付けたArUcoマーカをカメラで検出し、マーカ位置に合わせて掴むコード例です。
- マーカはaruco_markers.pdfをA4紙に印刷し、一辺50mmの立方体に取り付けます。
- 検出されたマーカの位置姿勢はtfのフレームとして配信されます。
- 各マーカはIDに対応した
tfフレームとして配信され、ID0のマーカはtarget_0フレームになります。 - 掴む対象は
target_0に設定されています。 - マーカ検出にはOpenCVを使用しています。
次のコマンドを実行します。
ros2 launch sciurus17_examples_py camera_example.launch.py example:='aruco_detection'
color_detection
特定の色の物体を検出して掴むコード例です。
- デフォルトでは青い物体の位置をtfのフレームとして配信します。
- 検出した物体のフレーム名は
target_0です。 - 色の検出にはOpenCVを使用しています。
- 検出した物体の距離は深度画像から取得します。
次のコマンドを実行します。
ros2 launch sciurus17_examples_py camera_example.launch.py example:='color_detection'