From 478e9a38edd9cd66d35c6a256f2001bac0182707 Mon Sep 17 00:00:00 2001 From: mizonon <146167126+mizonon@users.noreply.github.com> Date: Fri, 20 Dec 2024 16:15:30 +0900 Subject: [PATCH] =?UTF-8?q?Jazzy=E5=AF=BE=E5=BF=9C=20(#78)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * jazzy対応(MoveitConfigsBuilder) * MoveitCofigsBuilderを使ってmoveit_configの枠を作る * planning_plugins, requesr_adaptorsの設定をompl_planning.yamlの先頭で行う * ompl_planning.yamlにstart_state_max_bounds_errorの設定を追加 * 7/19ここまで * MoveitConfigsBuilderを使うに伴った、yamlファイルの指定の項目追加 * 一通りMoveItConfigsBuilderに対応 * MoveIt Setup Assistantを使って設定ファイルを生成 * urdfの指定を追加 * crane_plus_configのrun_move_group.launchを呼ぶ * Unable to parse SRDFのエラーが解決できない * demo.launchが起動できるようになった * 余計なコメントアウト部分削除 * 余計なコメントアウト削除 * rviz上でMottionPlanningができるようになった * 余計なコメントアウト削除 * 不要なコメント削除 * 不要ファイルのignore * crane_plus_moveit_config/launchの中の不要ファイル削除 * default_***_scaling_factorを0.1->1.0に変更 * setup assistantによる書換わりを元の書き方に修正 * exampleのdemo.lauch修正 * run_move_group.rviz削除 * sensors_3d.yaml削除 * solverを元に戻す * .gitignore変更 * setup_assistant関連のファイル追加 * ciのjazzy対応 * run_move_froup.lauch.pyの整理 * 不要な権限変更 * 不要な権限変更 * 不要なscript削除 * kinematicの設定修正 * ソルバーをKDLに戻す * warehouse_ros_mongoをcrane_plus_moveit_configのpackage.xmlに含めない * レビュー結果反映 * README.md(jazzy対応&バイナリインストール方法追加) * .dockerのREADME.mdのjazzy対応 * CI対応(copyright追加) * CI対応 * CI対応(setup_assistant.launch.py) * CI対応(package.xmlの不要な部分削除) * コメントをjazzyに合わせる * ign fuelでgazeboのモデルをダウンロードする記述削除 * ciのDockerイメージをjazzyに対応 * 他の製品と設定を共通化 * crane_plus_description/package.xmlのauthorに溝口を追加 * ompl_planning.yamlに抜けていた記述追加 * .gitignoreの末尾に.vscode追加 * 旧115行目の改行復活 * ファイル名変更controllers.yaml->moveit_controllers.yaml * kinematics_solver_attemptsの指定削除 * RobotDescriptionLoader対応とmoveit_configの不必要な定義削除 * robot_description_kinematicsの設定を削除 * 削除したrun_move_group.rvizの内容をmoveit.rvizとして反映 * Sciurus17のrun_move_group.launch.pyの書き方に合わせる * gz_sim対応(crane_plus_gazeboパッケージ) * gz_sim対応(crane_plus_descriptionパッケージ) * Ignitionを使用するかのパラメタuse_ignition削除 * test_use_gazeboをGazebo Harmonicに対応 * 3D SceneのGUIをGazebo Harmonicに対応 * MoveitConfigsBuilderを使いつつ、rvizの設定ファイルを適切に設定する要修正 * MoveitConfigsBuilderを使いつつ、rvizの設定ファイルを適切に設定する修正 * Gazebo環境にカメラを追加 (#83) * カメラ追加 * use_sim_timeオプション追加 * カメラの画角調整 * 色検出サンプルの色しきい値調整 * 把持位置調整 * 現バージョンのデフォルト設定を反映 * ArUcoマーカ付きの立方体を追加 * ワールド、launchファイル追加 * use_cameraの有効化 * use_cameraを引数で切り替えられるように変更 * カメラスタンドのURDF修正 * GazeboのCameraモデル対応したコードのign->gz対応 * CI対応 * CI対応 * rviz_configの名称統一 * spawn_gripper_contolollerの記述を他のコントローラの記述と合わせる * rviz_configの切替えの仕方を修正 * スタイル修正 * declare_rviz_config追加 * configファイルのパス設定を修正 * gazebo表記をgzに統一 * スタイル修正 * gui.config修正 --------- Co-authored-by: Kuwamai --- .docker/README.md | 10 +- .docker/build_source.sh | 2 +- .docker/source/Dockerfile | 8 +- .github/workflows/build_docker_image.yml | 2 +- .github/workflows/industrial_ci.yml | 2 +- .gitignore | 3 +- README.md | 13 +- .../robot_description_loader.py | 2 - crane_plus_description/package.xml | 4 +- .../test/test_robot_description_loader.py | 12 +- .../urdf/crane_plus.gazebo.xacro | 22 +-- .../urdf/crane_plus.gazebo_ros2_control.xacro | 9 +- .../urdf/crane_plus.urdf.xacro | 5 +- crane_plus_examples/launch/demo.launch.py | 50 +++--- crane_plus_examples/src/aruco_detection.cpp | 2 +- crane_plus_examples/src/color_detection.cpp | 4 +- crane_plus_gazebo/gui/gui.config | 76 +++++---- .../crane_plus_with_aruco_cube.launch.py | 2 +- .../launch/crane_plus_with_red_cube.launch.py | 2 +- .../launch/crane_plus_with_table.launch.py | 79 +++++---- crane_plus_gazebo/worlds/table.sdf | 18 +-- .../worlds/table_with_aruco_cube.sdf | 18 +-- .../worlds/table_with_red_cube.sdf | 19 +-- crane_plus_moveit_config/.setup_assistant | 25 +++ crane_plus_moveit_config/CMakeLists.txt | 9 +- .../config/controllers.yaml | 20 --- .../config/crane_plus.srdf | 41 +++-- .../config/joint_limits.yaml | 36 +++++ .../config/kinematics.yaml | 5 +- .../moveit.rviz} | 2 +- .../config/moveit_controllers.yaml | 25 +++ .../config/ompl_planning.yaml | 22 +++ .../config/pilz_cartesian_limits.yaml | 6 + .../launch/run_move_group.launch.py | 151 +++++------------- .../launch/setup_assistant.launch.py | 24 +++ crane_plus_moveit_config/package.xml | 28 +++- 36 files changed, 397 insertions(+), 361 deletions(-) mode change 100644 => 100755 .github/workflows/industrial_ci.yml mode change 100644 => 100755 .gitignore mode change 100644 => 100755 crane_plus_description/package.xml create mode 100644 crane_plus_moveit_config/.setup_assistant delete mode 100644 crane_plus_moveit_config/config/controllers.yaml create mode 100644 crane_plus_moveit_config/config/joint_limits.yaml rename crane_plus_moveit_config/{launch/run_move_group.rviz => config/moveit.rviz} (99%) create mode 100644 crane_plus_moveit_config/config/moveit_controllers.yaml create mode 100644 crane_plus_moveit_config/config/pilz_cartesian_limits.yaml mode change 100644 => 100755 crane_plus_moveit_config/launch/run_move_group.launch.py create mode 100755 crane_plus_moveit_config/launch/setup_assistant.launch.py mode change 100644 => 100755 crane_plus_moveit_config/package.xml diff --git a/.docker/README.md b/.docker/README.md index 51fda6ee..c570f387 100644 --- a/.docker/README.md +++ b/.docker/README.md @@ -7,10 +7,10 @@ https://github.com/rt-net/crane_plus/pkgs/container/crane_plus をアップロードしています。 tagにはROSのディストリビューションを指定してください。 -Humbleディストリビューションのイメージをダウンロードする場合は次のコマンドを実行します。 +Jazzyディストリビューションのイメージをダウンロードする場合は次のコマンドを実行します。 ```sh -$ docker pull ghcr.io/rt-net/crane_plus:humble +$ docker pull ghcr.io/rt-net/crane_plus:jazzy ``` ### ノードの起動 @@ -67,9 +67,9 @@ $ rocker --x11 --net=host --privileged \ `./build_source.sh $ROS_DISTRO`を実行してイメージを作成します。 ```sh -# humbleディストリビューションのイメージを作成する +# jazzyディストリビューションのイメージを作成する $ cd crane_plus/.docker -$ ./build_source.sh humble +$ ./build_source.sh jazzy ... -Successfully tagged crane_plus:humble +Successfully tagged crane_plus:jazzy ``` diff --git a/.docker/build_source.sh b/.docker/build_source.sh index 26ae5e94..b49c45bc 100755 --- a/.docker/build_source.sh +++ b/.docker/build_source.sh @@ -4,7 +4,7 @@ set -e if [ $# -eq 0 ]; then echo "Please set ROS_DISTRO to the argument." - echo "e.g. ./build_source.sh humble" + echo "e.g. ./build_source.sh jazzy" fi ROS_DISTRO=$1 diff --git a/.docker/source/Dockerfile b/.docker/source/Dockerfile index fa674b61..f5da789d 100644 --- a/.docker/source/Dockerfile +++ b/.docker/source/Dockerfile @@ -1,4 +1,4 @@ -ARG ROS_DISTRO="humble" +ARG ROS_DISTRO="jazzy" FROM osrf/ros:${ROS_DISTRO}-desktop ENV OVERLAY_WS /root/overlay_ws WORKDIR $OVERLAY_WS/src @@ -31,12 +31,6 @@ RUN mkdir -p /root/.gazebo/models && \ git pull origin master && \ rm -rf .git -# Download ignition model -RUN ign fuel download -v 4 -u https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/sun && \ - ign fuel download -v 4 -u https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/ground%20plane && \ - ign fuel download -v 4 -u https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/wood%20cube%205cm && \ - ign fuel download -v 4 -u https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/table - # Edit entrypoint to source overlay setup file WORKDIR $OVERLAY_WS RUN sed --in-place --expression \ diff --git a/.github/workflows/build_docker_image.yml b/.github/workflows/build_docker_image.yml index ff083505..0c5f9cd4 100644 --- a/.github/workflows/build_docker_image.yml +++ b/.github/workflows/build_docker_image.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: env: - ROS_DISTRO: humble + ROS_DISTRO: jazzy REGISTRY: ghcr.io jobs: diff --git a/.github/workflows/industrial_ci.yml b/.github/workflows/industrial_ci.yml old mode 100644 new mode 100755 index f539e586..d809d96e --- a/.github/workflows/industrial_ci.yml +++ b/.github/workflows/industrial_ci.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: env: - - { ROS_DISTRO: humble, ROS_REPO: ros } + - { ROS_DISTRO: jazzy, ROS_REPO: ros } runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index ba6ffecc..6b73f639 --- a/.gitignore +++ b/.gitignore @@ -56,5 +56,4 @@ docs/_build/ # PyBuilder target/ .pytest_cache - -.vscode +.vscode \ No newline at end of file diff --git a/README.md b/README.md index 99fbaba5..b30a063f 100644 --- a/README.md +++ b/README.md @@ -21,17 +21,17 @@ ROS 2 package suite of CRANE+ V2. ## Supported ROS 2 distributions - [Foxy](https://github.com/rt-net/crane_plus/tree/foxy-devel) -- Humble - +- [Humble](https://github.com/rt-net/crane_plus/tree/humble-devel) +- Jazzy ## Requirements - CRANE+ V2 - [Product Introduction](https://rt-net.jp/products/cranev2/) - [Web Shop](https://www.rt-shop.jp/index.php?main_page=product_info&cPath=1348_1&products_id=3626&language=ja) - Linux OS - - Ubuntu 22.04 + - Ubuntu 24.04 - ROS - - [Humble Hawksbill](https://docs.ros.org/en/humble/Installation.html) + - [Jazzy Jalisco](https://docs.ros.org/en/jazzy/Installation.html) ## Installation @@ -43,14 +43,15 @@ ROS 2 package suite of CRANE+ V2. ### Binary installation ```sh -TBD +$ sudo apt update +$ sudo apt install ros-jazzy-crane-plus ``` ### Source Build ```sh # Setup ROS environment -$ source /opt/ros/humble/setup.bash +$ source /opt/ros/jazzy/setup.bash # Download crane_plus repository $ mkdir -p ~/ros2_ws/src diff --git a/crane_plus_description/crane_plus_description/robot_description_loader.py b/crane_plus_description/crane_plus_description/robot_description_loader.py index ebb9950f..48e271c3 100755 --- a/crane_plus_description/crane_plus_description/robot_description_loader.py +++ b/crane_plus_description/crane_plus_description/robot_description_loader.py @@ -27,7 +27,6 @@ def __init__(self): 'crane_plus.urdf.xacro') self.port_name = '/dev/ttyUSB0' self.use_gazebo = 'false' - self.use_ignition = 'false' self.use_camera = 'false' self.gz_control_config_package = '' self.gz_control_config_file_path = '' @@ -38,7 +37,6 @@ def load(self): self.robot_description_path, ' port_name:=', self.port_name, ' use_gazebo:=', self.use_gazebo, - ' use_ignition:=', self.use_ignition, ' use_camera:=', self.use_camera, ' gz_control_config_package:=', self.gz_control_config_package, ' gz_control_config_file_path:=', self.gz_control_config_file_path diff --git a/crane_plus_description/package.xml b/crane_plus_description/package.xml old mode 100644 new mode 100755 index cf986cda..2ac40181 --- a/crane_plus_description/package.xml +++ b/crane_plus_description/package.xml @@ -9,12 +9,12 @@ Shota Aoki Atsushi Kuwagata + Nozomi Mizoguchi ament_cmake ament_cmake_python - gazebo_ros2_control - ign_ros2_control + gz_ros2_control joint_state_publisher_gui launch robot_state_publisher diff --git a/crane_plus_description/test/test_robot_description_loader.py b/crane_plus_description/test/test_robot_description_loader.py index ea93d343..47358fd3 100644 --- a/crane_plus_description/test/test_robot_description_loader.py +++ b/crane_plus_description/test/test_robot_description_loader.py @@ -52,17 +52,7 @@ def test_use_gazebo(): rdl.use_gazebo = 'true' rdl.gz_control_config_package = 'crane_plus_description' rdl.gz_control_config_file_path = 'test/dummy_controllers.yaml' - assert 'gazebo_ros2_control/GazeboSystem' in exec_load(rdl) - - -def test_use_ignition(): - # use_gazeboとuse_ignitionが変更され、xacroにign_ros2_controlがセットされることを期待 - rdl = RobotDescriptionLoader() - rdl.use_gazebo = 'true' - rdl.use_ignition = 'true' - rdl.gz_control_config_package = 'crane_plus_description' - rdl.gz_control_config_file_path = 'test/dummy_controllers.yaml' - assert 'ign_ros2_control/IgnitionSystem' in exec_load(rdl) + assert 'gz_ros2_control/GazeboSimSystem' in exec_load(rdl) def test_use_camera(): diff --git a/crane_plus_description/urdf/crane_plus.gazebo.xacro b/crane_plus_description/urdf/crane_plus.gazebo.xacro index 26daa5af..30a7611a 100644 --- a/crane_plus_description/urdf/crane_plus.gazebo.xacro +++ b/crane_plus_description/urdf/crane_plus.gazebo.xacro @@ -27,24 +27,14 @@ name_link_4 name_link_hand use_camera - use_ignition config_package config_file_path "> - - - $(find ${config_package})/${config_file_path} - - - - - - gazebo_ros2_control/GazeboSystem - $(find ${config_package})/${config_file_path} - - + + $(find ${config_package})/${config_file_path} + @@ -85,9 +75,9 @@ - - ogre2 - + + ogre2 + diff --git a/crane_plus_description/urdf/crane_plus.gazebo_ros2_control.xacro b/crane_plus_description/urdf/crane_plus.gazebo_ros2_control.xacro index 5ae8c744..95678218 100644 --- a/crane_plus_description/urdf/crane_plus.gazebo_ros2_control.xacro +++ b/crane_plus_description/urdf/crane_plus.gazebo_ros2_control.xacro @@ -18,18 +18,11 @@ joint_4_upper_limit joint_hand_lower_limit joint_hand_upper_limit - use_ignition "> - - ign_ros2_control/IgnitionSystem - - - - gazebo_ros2_control/GazeboSystem - + gz_ros2_control/GazeboSimSystem diff --git a/crane_plus_description/urdf/crane_plus.urdf.xacro b/crane_plus_description/urdf/crane_plus.urdf.xacro index 2989e4cb..e0906ead 100644 --- a/crane_plus_description/urdf/crane_plus.urdf.xacro +++ b/crane_plus_description/urdf/crane_plus.urdf.xacro @@ -13,7 +13,6 @@ - @@ -131,7 +130,6 @@ name_link_4="${NAME_LINK_4}" name_link_hand="${NAME_LINK_HAND}" use_camera="$(arg use_camera)" - use_ignition="$(arg use_ignition)" config_package="$(arg gz_control_config_package)" config_file_path="$(arg gz_control_config_file_path)" /> @@ -151,8 +149,7 @@ joint_4_lower_limit="${JOINT_4_LOWER_LIMIT}" joint_4_upper_limit="${JOINT_4_UPPER_LIMIT}" joint_hand_lower_limit="${JOINT_HAND_LOWER_LIMIT}" - joint_hand_upper_limit="${JOINT_HAND_UPPER_LIMIT}" - use_ignition="$(arg use_ignition)" /> + joint_hand_upper_limit="${JOINT_HAND_UPPER_LIMIT}"/> diff --git a/crane_plus_examples/launch/demo.launch.py b/crane_plus_examples/launch/demo.launch.py index 12a7dbeb..1099c8bb 100644 --- a/crane_plus_examples/launch/demo.launch.py +++ b/crane_plus_examples/launch/demo.launch.py @@ -43,33 +43,38 @@ def generate_launch_description(): description='Set video device.' ) + declare_rviz_config = DeclareLaunchArgument( + 'rviz_config', + default_value=get_package_share_directory( + 'crane_plus_moveit_config' + ) + '/config/moveit.rviz', + description='Set the path to rviz configuration file.', + condition=UnlessCondition(LaunchConfiguration('use_camera')), + ) + + declare_rviz_config_camera = DeclareLaunchArgument( + 'rviz_config', + default_value=get_package_share_directory( + 'crane_plus_examples' + ) + '/launch/camera_example.rviz', + description='Set the path to rviz configuration file.', + condition=IfCondition(LaunchConfiguration('use_camera')), + ) + description_loader = RobotDescriptionLoader() description_loader.port_name = LaunchConfiguration('port_name') description_loader.use_camera = LaunchConfiguration('use_camera') description = description_loader.load() move_group = IncludeLaunchDescription( - PythonLaunchDescriptionSource([ - get_package_share_directory('crane_plus_moveit_config'), - '/launch/run_move_group.launch.py']), - condition=UnlessCondition(LaunchConfiguration('use_camera')), - launch_arguments={ - 'loaded_description': description - }.items() - ) - - rviz_config_file = get_package_share_directory( - 'crane_plus_examples') + '/launch/camera_example.rviz' - move_group_camera = IncludeLaunchDescription( - PythonLaunchDescriptionSource([ - get_package_share_directory('crane_plus_moveit_config'), - '/launch/run_move_group.launch.py']), - condition=IfCondition(LaunchConfiguration('use_camera')), - launch_arguments={ - 'loaded_description': description, - 'rviz_config_file': rviz_config_file - }.items() - ) + PythonLaunchDescriptionSource([ + get_package_share_directory('crane_plus_moveit_config'), + '/launch/run_move_group.launch.py']), + launch_arguments={ + 'loaded_description': description, + 'rviz_config': LaunchConfiguration('rviz_config') + }.items() + ) control_node = IncludeLaunchDescription( PythonLaunchDescriptionSource([ @@ -96,8 +101,9 @@ def generate_launch_description(): declare_port_name, declare_use_camera, declare_video_device, + declare_rviz_config, + declare_rviz_config_camera, move_group, - move_group_camera, control_node, usb_cam_node ]) diff --git a/crane_plus_examples/src/aruco_detection.cpp b/crane_plus_examples/src/aruco_detection.cpp index bdf9b19d..7a70f071 100644 --- a/crane_plus_examples/src/aruco_detection.cpp +++ b/crane_plus_examples/src/aruco_detection.cpp @@ -27,7 +27,7 @@ #include "sensor_msgs/msg/image.hpp" #include "opencv2/opencv.hpp" #include "opencv2/aruco.hpp" -#include "cv_bridge/cv_bridge.h" +#include "cv_bridge/cv_bridge.hpp" #include "tf2/LinearMath/Quaternion.h" #include "tf2/LinearMath/Matrix3x3.h" #include "tf2_ros/transform_broadcaster.h" diff --git a/crane_plus_examples/src/color_detection.cpp b/crane_plus_examples/src/color_detection.cpp index c4cd53f2..b6c46b67 100644 --- a/crane_plus_examples/src/color_detection.cpp +++ b/crane_plus_examples/src/color_detection.cpp @@ -29,8 +29,8 @@ #include "tf2_ros/transform_broadcaster.h" #include "opencv2/opencv.hpp" #include "opencv2/imgproc/imgproc.hpp" -#include "cv_bridge/cv_bridge.h" -#include "image_geometry/pinhole_camera_model.h" +#include "cv_bridge/cv_bridge.hpp" +#include "image_geometry/pinhole_camera_model.hpp" using std::placeholders::_1; class ImageSubscriber : public rclcpp::Node diff --git a/crane_plus_gazebo/gui/gui.config b/crane_plus_gazebo/gui/gui.config index 0acf58f9..172e60d7 100644 --- a/crane_plus_gazebo/gui/gui.config +++ b/crane_plus_gazebo/gui/gui.config @@ -28,11 +28,11 @@ - + 3D View false docked - + ogre2 scene @@ -44,87 +44,86 @@ - + floating 5 5 false - + - + false 5 5 floating false - + - + false 5 5 floating false - + - + false 5 5 floating false - + - + false 5 5 floating false - + - + false 5 5 floating false - + - + false 5 5 floating false - + - + false 5 5 floating false - + - + World control false false 72 - 121 1 floating @@ -132,7 +131,7 @@ - + true true @@ -143,7 +142,7 @@ - + World stats false false @@ -156,7 +155,7 @@ - + true true @@ -166,7 +165,7 @@ - + false 0 0 @@ -175,12 +174,12 @@ floating false #666666 - + - + false 250 0 @@ -189,12 +188,12 @@ floating false #666666 - + - + false 0 50 @@ -203,15 +202,12 @@ floating false #777777 - - - - false + - + false 250 50 @@ -220,12 +216,12 @@ floating false #777777 - + - + false 300 50 @@ -234,21 +230,21 @@ floating false #777777 - + - + false docked - + - + false docked - + diff --git a/crane_plus_gazebo/launch/crane_plus_with_aruco_cube.launch.py b/crane_plus_gazebo/launch/crane_plus_with_aruco_cube.launch.py index 077e9b4c..f56fb086 100644 --- a/crane_plus_gazebo/launch/crane_plus_with_aruco_cube.launch.py +++ b/crane_plus_gazebo/launch/crane_plus_with_aruco_cube.launch.py @@ -17,8 +17,8 @@ from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription from launch.actions import IncludeLaunchDescription -from launch_ros.actions import SetParameter from launch.launch_description_sources import PythonLaunchDescriptionSource +from launch_ros.actions import SetParameter def generate_launch_description(): diff --git a/crane_plus_gazebo/launch/crane_plus_with_red_cube.launch.py b/crane_plus_gazebo/launch/crane_plus_with_red_cube.launch.py index 8d7130a2..4a081ed8 100644 --- a/crane_plus_gazebo/launch/crane_plus_with_red_cube.launch.py +++ b/crane_plus_gazebo/launch/crane_plus_with_red_cube.launch.py @@ -17,8 +17,8 @@ from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription from launch.actions import IncludeLaunchDescription -from launch_ros.actions import SetParameter from launch.launch_description_sources import PythonLaunchDescriptionSource +from launch_ros.actions import SetParameter def generate_launch_description(): diff --git a/crane_plus_gazebo/launch/crane_plus_with_table.launch.py b/crane_plus_gazebo/launch/crane_plus_with_table.launch.py index f13715f9..b17b5a7f 100644 --- a/crane_plus_gazebo/launch/crane_plus_with_table.launch.py +++ b/crane_plus_gazebo/launch/crane_plus_with_table.launch.py @@ -23,9 +23,9 @@ from launch.conditions import IfCondition from launch.conditions import UnlessCondition from launch.launch_description_sources import PythonLaunchDescriptionSource +from launch.substitutions import LaunchConfiguration from launch_ros.actions import Node from launch_ros.actions import SetParameter -from launch.substitutions import LaunchConfiguration def generate_launch_description(): @@ -35,31 +35,54 @@ def generate_launch_description(): description='Use camera.' ) + declare_rviz_config = DeclareLaunchArgument( + 'rviz_config', + default_value=get_package_share_directory( + 'crane_plus_moveit_config' + ) + '/config/moveit.rviz', + description='Set the path to rviz configuration file.', + condition=UnlessCondition(LaunchConfiguration('use_camera')), + ) + + declare_rviz_config_camera = DeclareLaunchArgument( + 'rviz_config', + default_value=get_package_share_directory( + 'crane_plus_examples' + ) + '/launch/camera_example.rviz', + description='Set the path to rviz configuration file.', + condition=IfCondition(LaunchConfiguration('use_camera')), + ) + declare_world_name = DeclareLaunchArgument( 'world_name', default_value=os.path.join( - get_package_share_directory('crane_plus_gazebo'), 'worlds', 'table.sdf'), + get_package_share_directory('crane_plus_gazebo'), 'worlds', + 'table.sdf'), description='Set world name.' ) # PATHを追加で通さないとSTLファイルが読み込まれない - env = {'IGN_GAZEBO_SYSTEM_PLUGIN_PATH': os.environ['LD_LIBRARY_PATH'], - 'IGN_GAZEBO_RESOURCE_PATH': os.path.dirname( + env = {'GZ_SIM_SYSTEM_PLUGIN_PATH': os.environ['LD_LIBRARY_PATH'], + 'GZ_SIM_RESOURCE_PATH': os.path.dirname( get_package_share_directory('crane_plus_description')) + ':' + - os.path.join(get_package_share_directory('crane_plus_gazebo'), 'models'), + os.path.join(get_package_share_directory('crane_plus_gazebo'), + 'models'), } gui_config = os.path.join( get_package_share_directory('crane_plus_gazebo'), 'gui', 'gui.config') # -r オプションで起動時にシミュレーションをスタートしないと、コントローラが起動しない - ign_gazebo = ExecuteProcess( - cmd=['ign gazebo -r', LaunchConfiguration('world_name'), '--gui-config', gui_config], + gz_sim = ExecuteProcess( + cmd=['gz sim -r', + LaunchConfiguration('world_name'), + '--gui-config', + gui_config], output='screen', additional_env=env, shell=True ) - gazebo_spawn_entity = Node( + gz_sim_spawn_entity = Node( package='ros_gz_sim', executable='create', output='screen', @@ -72,7 +95,6 @@ def generate_launch_description(): description_loader = RobotDescriptionLoader() description_loader.use_camera = LaunchConfiguration('use_camera') description_loader.use_gazebo = 'true' - description_loader.use_ignition = 'true' description_loader.gz_control_config_package = 'crane_plus_control' description_loader.gz_control_config_file_path = 'config/crane_plus_controllers.yaml' description = description_loader.load() @@ -81,37 +103,29 @@ def generate_launch_description(): PythonLaunchDescriptionSource([ get_package_share_directory('crane_plus_moveit_config'), '/launch/run_move_group.launch.py']), - condition=UnlessCondition(LaunchConfiguration('use_camera')), - launch_arguments={'loaded_description': description}.items() - ) - - rviz_config_file = get_package_share_directory( - 'crane_plus_examples') + '/launch/camera_example.rviz' - move_group_camera = IncludeLaunchDescription( - PythonLaunchDescriptionSource([ - get_package_share_directory('crane_plus_moveit_config'), - '/launch/run_move_group.launch.py']), - condition=IfCondition(LaunchConfiguration('use_camera')), launch_arguments={ 'loaded_description': description, - 'rviz_config_file': rviz_config_file - }.items() + 'rviz_config': LaunchConfiguration('rviz_config') + }.items() ) spawn_joint_state_controller = ExecuteProcess( - cmd=['ros2 run controller_manager spawner joint_state_broadcaster'], + cmd=['ros2 run controller_manager spawner ' + 'joint_state_broadcaster'], shell=True, output='screen', ) spawn_arm_controller = ExecuteProcess( - cmd=['ros2 run controller_manager spawner crane_plus_arm_controller'], + cmd=['ros2 run controller_manager spawner ' + 'crane_plus_arm_controller'], shell=True, output='screen', ) spawn_gripper_controller = ExecuteProcess( - cmd=['ros2 run controller_manager spawner crane_plus_gripper_controller'], + cmd=['ros2 run controller_manager spawner ' + 'crane_plus_gripper_controller'], shell=True, output='screen', ) @@ -119,20 +133,23 @@ def generate_launch_description(): bridge = Node( package='ros_gz_bridge', executable='parameter_bridge', - arguments=['/clock@rosgraph_msgs/msg/Clock[ignition.msgs.Clock', - 'image_raw@sensor_msgs/msg/Image[ignition.msgs.Image', - 'camera_info@sensor_msgs/msg/CameraInfo[ignition.msgs.CameraInfo'], + arguments=[ + '/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock', + 'image_raw@sensor_msgs/msg/Image[gz.msgs.Image', + 'camera_info@sensor_msgs/msg/CameraInfo[gz.msgs.CameraInfo' + ], output='screen' ) return LaunchDescription([ SetParameter(name='use_sim_time', value=True), declare_use_camera, + declare_rviz_config, + declare_rviz_config_camera, declare_world_name, - ign_gazebo, - gazebo_spawn_entity, + gz_sim, + gz_sim_spawn_entity, move_group, - move_group_camera, spawn_joint_state_controller, spawn_arm_controller, spawn_gripper_controller, diff --git a/crane_plus_gazebo/worlds/table.sdf b/crane_plus_gazebo/worlds/table.sdf index 7e1da5de..ec7e7548 100644 --- a/crane_plus_gazebo/worlds/table.sdf +++ b/crane_plus_gazebo/worlds/table.sdf @@ -6,33 +6,33 @@ 1.0 + filename="gz-sim-physics-system" + name="gz::sim::systems::Physics"> + filename="gz-sim-user-commands-system" + name="gz::sim::systems::UserCommands"> + filename="gz-sim-scene-broadcaster-system" + name="gz::sim::systems::SceneBroadcaster"> - https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Sun + https://fuel.gazebosim.org/1.0/OpenRobotics/models/Sun - https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Ground%20Plane + https://fuel.gazebosim.org/1.0/OpenRobotics/models/Ground%20Plane - https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Table + https://fuel.gazebosim.org/1.0/OpenRobotics/models/Table 0.29 0 0 0 0 1.5708 diff --git a/crane_plus_gazebo/worlds/table_with_aruco_cube.sdf b/crane_plus_gazebo/worlds/table_with_aruco_cube.sdf index fbc4ce8c..7750d857 100644 --- a/crane_plus_gazebo/worlds/table_with_aruco_cube.sdf +++ b/crane_plus_gazebo/worlds/table_with_aruco_cube.sdf @@ -6,33 +6,33 @@ 1.0 + filename="gz-sim-physics-system" + name="gz::sim::systems::Physics"> + filename="gz-sim-user-commands-system" + name="gz::sim::systems::UserCommands"> + filename="gz-sim-scene-broadcaster-system" + name="gz::sim::systems::SceneBroadcaster"> - https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Sun + https://fuel.gazebosim.org/1.0/OpenRobotics/models/Sun - https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Ground%20Plane + https://fuel.gazebosim.org/1.0/OpenRobotics/models/Ground%20Plane - https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Table + https://fuel.gazebosim.org/1.0/OpenRobotics/models/Table 0.29 0 0 0 0 1.5708 diff --git a/crane_plus_gazebo/worlds/table_with_red_cube.sdf b/crane_plus_gazebo/worlds/table_with_red_cube.sdf index 0804c9f5..f073c528 100644 --- a/crane_plus_gazebo/worlds/table_with_red_cube.sdf +++ b/crane_plus_gazebo/worlds/table_with_red_cube.sdf @@ -5,34 +5,35 @@ 0.001 1.0 + + filename="gz-sim-physics-system" + name="gz::sim::systems::Physics"> + filename="gz-sim-user-commands-system" + name="gz::sim::systems::UserCommands"> + filename="gz-sim-scene-broadcaster-system" + name="gz::sim::systems::SceneBroadcaster"> - https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Sun + https://fuel.gazebosim.org/1.0/OpenRobotics/models/Sun - https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Ground%20Plane + https://fuel.gazebosim.or/1.0/OpenRobotics/models/Ground%20Plane - https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Table + https://fuel.gazebosim.or/1.0/OpenRobotics/models/Table 0.29 0 0 0 0 1.5708 diff --git a/crane_plus_moveit_config/.setup_assistant b/crane_plus_moveit_config/.setup_assistant new file mode 100644 index 00000000..3058c8a2 --- /dev/null +++ b/crane_plus_moveit_config/.setup_assistant @@ -0,0 +1,25 @@ +moveit_setup_assistant_config: + urdf: + package: crane_plus_description + relative_path: urdf/crane_plus.urdf.xacro + srdf: + relative_path: config/crane_plus.srdf + package_settings: + author_name: RT Corporation + author_email: shop@rt-net.jp + generated_timestamp: 1721799427 + control_xacro: + command: + - position + state: + - position + - velocity + modified_urdf: + xacros: + - control_xacro + control_xacro: + command: + - position + state: + - position + - velocity \ No newline at end of file diff --git a/crane_plus_moveit_config/CMakeLists.txt b/crane_plus_moveit_config/CMakeLists.txt index b9b9f1f6..1227603e 100644 --- a/crane_plus_moveit_config/CMakeLists.txt +++ b/crane_plus_moveit_config/CMakeLists.txt @@ -3,11 +3,10 @@ project(crane_plus_moveit_config) find_package(ament_cmake REQUIRED) -install(DIRECTORY - launch - config - DESTINATION share/${PROJECT_NAME}/ -) +install(DIRECTORY launch DESTINATION share/${PROJECT_NAME} + PATTERN "setup_assistant.launch" EXCLUDE) +install(DIRECTORY config DESTINATION share/${PROJECT_NAME}) +install(FILES .setup_assistant DESTINATION share/${PROJECT_NAME}) if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) diff --git a/crane_plus_moveit_config/config/controllers.yaml b/crane_plus_moveit_config/config/controllers.yaml deleted file mode 100644 index 4625155f..00000000 --- a/crane_plus_moveit_config/config/controllers.yaml +++ /dev/null @@ -1,20 +0,0 @@ -controller_names: - - crane_plus_arm_controller - - crane_plus_gripper_controller - -crane_plus_arm_controller: - action_ns: follow_joint_trajectory - type: FollowJointTrajectory - default: true - joints: - - crane_plus_joint1 - - crane_plus_joint2 - - crane_plus_joint3 - - crane_plus_joint4 - -crane_plus_gripper_controller: - action_ns: follow_joint_trajectory - type: FollowJointTrajectory - default: true - joints: - - crane_plus_joint_hand diff --git a/crane_plus_moveit_config/config/crane_plus.srdf b/crane_plus_moveit_config/config/crane_plus.srdf index 7e3685c5..af40281f 100644 --- a/crane_plus_moveit_config/config/crane_plus.srdf +++ b/crane_plus_moveit_config/config/crane_plus.srdf @@ -1,43 +1,42 @@ - + - + - + - - + + - - - - + + + + - - - - + + + + - + - + - - - - - - + + + + + diff --git a/crane_plus_moveit_config/config/joint_limits.yaml b/crane_plus_moveit_config/config/joint_limits.yaml new file mode 100644 index 00000000..20737bce --- /dev/null +++ b/crane_plus_moveit_config/config/joint_limits.yaml @@ -0,0 +1,36 @@ +# joint_limits.yaml allows the dynamics properties specified in the URDF to be overwritten or augmented as needed + +# For beginners, we downscale velocity and acceleration limits. +# You can always specify higher scaling factors (<= 1.0) in your motion requests. # Increase the values below to 1.0 to always move at maximum speed. +default_velocity_scaling_factor: 1.0 +default_acceleration_scaling_factor: 1.0 + +# Specific joint properties can be changed with the keys [max_position, min_position, max_velocity, max_acceleration] +# Joint limits can be turned off with [has_velocity_limits, has_acceleration_limits] +joint_limits: + crane_plus_joint1: + has_velocity_limits: true + max_velocity: 2.0 + has_acceleration_limits: true + max_acceleration: 1.0 + crane_plus_joint2: + has_velocity_limits: true + max_velocity: 2.0 + has_acceleration_limits: true + max_acceleration: 1.0 + crane_plus_joint3: + has_velocity_limits: true + max_velocity: 2.0 + has_acceleration_limits: true + max_acceleration: 1.0 + crane_plus_joint4: + has_velocity_limits: true + max_velocity: 2.0 + has_acceleration_limits: true + max_acceleration: 1.0 + crane_plus_joint_hand: + has_velocity_limits: true + max_velocity: 2.0 + has_acceleration_limits: true + max_acceleration: 1.0 + \ No newline at end of file diff --git a/crane_plus_moveit_config/config/kinematics.yaml b/crane_plus_moveit_config/config/kinematics.yaml index a07a406d..05573e5c 100644 --- a/crane_plus_moveit_config/config/kinematics.yaml +++ b/crane_plus_moveit_config/config/kinematics.yaml @@ -1,5 +1,4 @@ arm: - kinematics_solver: lma_kinematics_plugin/LMAKinematicsPlugin - kinematics_solver_attempts: 10 + kinematics_solver: kdl_kinematics_plugin/KDLKinematicsPlugin kinematics_solver_search_resolution: 0.005 - kinematics_solver_timeout: 0.005 + kinematics_solver_timeout: 0.005 \ No newline at end of file diff --git a/crane_plus_moveit_config/launch/run_move_group.rviz b/crane_plus_moveit_config/config/moveit.rviz similarity index 99% rename from crane_plus_moveit_config/launch/run_move_group.rviz rename to crane_plus_moveit_config/config/moveit.rviz index 44b5c6a9..23014c90 100644 --- a/crane_plus_moveit_config/launch/run_move_group.rviz +++ b/crane_plus_moveit_config/config/moveit.rviz @@ -348,4 +348,4 @@ Window Geometry: collapsed: false Width: 1920 X: 0 - Y: 0 + Y: 0 \ No newline at end of file diff --git a/crane_plus_moveit_config/config/moveit_controllers.yaml b/crane_plus_moveit_config/config/moveit_controllers.yaml new file mode 100644 index 00000000..f30686de --- /dev/null +++ b/crane_plus_moveit_config/config/moveit_controllers.yaml @@ -0,0 +1,25 @@ +# MoveIt uses this configuration for controller management +moveit_controller_manager: moveit_simple_controller_manager/MoveItSimpleControllerManager + +moveit_simple_controller_manager: + controller_names: + - crane_plus_arm_controller + - crane_plus_gripper_controller + + crane_plus_arm_controller: + action_ns: follow_joint_trajectory + type: FollowJointTrajectory + default: true + joints: + - crane_plus_joint1 + - crane_plus_joint2 + - crane_plus_joint3 + - crane_plus_joint4 + + crane_plus_gripper_controller: + action_ns: follow_joint_trajectory + type: FollowJointTrajectory + default: true + joints: + - crane_plus_joint_hand + diff --git a/crane_plus_moveit_config/config/ompl_planning.yaml b/crane_plus_moveit_config/config/ompl_planning.yaml index 2e197f5a..0d88b7fa 100644 --- a/crane_plus_moveit_config/config/ompl_planning.yaml +++ b/crane_plus_moveit_config/config/ompl_planning.yaml @@ -1,4 +1,24 @@ +planning_plugins: + - ompl_interface/OMPLPlanner +# To optionally use Ruckig for jerk-limited smoothing, add this line to the request adapters below +# default_planning_request_adapters/AddRuckigTrajectorySmoothing +request_adapters: + - default_planning_request_adapters/ResolveConstraintFrames + - default_planning_request_adapters/ValidateWorkspaceBounds + - default_planning_request_adapters/CheckStartStateBounds + - default_planning_request_adapters/CheckStartStateCollision +response_adapters: + - default_planning_response_adapters/AddTimeOptimalParameterization + - default_planning_response_adapters/ValidateSolution + - default_planning_response_adapters/DisplayMotionPath planner_configs: + APSConfigDefault: + type: geometric::AnytimePathShortening + shortcut: 1 # Attempt to shortcut all new solution paths + hybridize: 1 # Compute hybrid solution trajectories + max_hybrid_paths: 36 # Number of hybrid paths generated per iteration + num_planners: 8 # The number of default planners to use for planning + planners: "RRTConnect,RRTConnect,RRTConnect,RRTConnect,RRTConnect,RRTConnect,RRTConnect,RRTConnect" # A comma-separated list of planner types (e.g., "PRM,EST,RRTConnect"Optionally, planner parameters can be passed to change the default:"PRM[max_nearest_neighbors=5],EST[goal_bias=.5],RRT[range=10. goal_bias=.1]" SBLkConfigDefault: type: geometric::SBL range: 0.0 # Max motion added to tree. ==> maxDistance_ default: 0.0, if 0.0, set on setup() @@ -125,6 +145,7 @@ planner_configs: arm: planner_configs: + - APSConfigDefault - SBLkConfigDefault - ESTkConfigDefault - LBKPIECEkConfigDefault @@ -151,6 +172,7 @@ arm: - TrajOptDefault gripper: planner_configs: + - APSConfigDefault - SBLkConfigDefault - ESTkConfigDefault - LBKPIECEkConfigDefault diff --git a/crane_plus_moveit_config/config/pilz_cartesian_limits.yaml b/crane_plus_moveit_config/config/pilz_cartesian_limits.yaml new file mode 100644 index 00000000..b2997caf --- /dev/null +++ b/crane_plus_moveit_config/config/pilz_cartesian_limits.yaml @@ -0,0 +1,6 @@ +# Limits for the Pilz planner +cartesian_limits: + max_trans_vel: 1.0 + max_trans_acc: 2.25 + max_trans_dec: -5.0 + max_rot_vel: 1.57 diff --git a/crane_plus_moveit_config/launch/run_move_group.launch.py b/crane_plus_moveit_config/launch/run_move_group.launch.py old mode 100644 new mode 100755 index 7e442baf..0a8ec0b8 --- a/crane_plus_moveit_config/launch/run_move_group.launch.py +++ b/crane_plus_moveit_config/launch/run_move_group.launch.py @@ -12,136 +12,61 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -from ament_index_python.packages import get_package_share_directory +from crane_plus_description.robot_description_loader import RobotDescriptionLoader from launch import LaunchDescription from launch.actions import DeclareLaunchArgument from launch.substitutions import LaunchConfiguration -from launch_ros.actions import Node -import yaml - - -# Reference: https://github.com/ros-planning/moveit2/blob/main/moveit_demo_nodes/ -# run_move_group/launch/run_move_group.launch.py - -def load_file(package_name, file_path): - package_path = get_package_share_directory(package_name) - absolute_file_path = os.path.join(package_path, file_path) - - try: - with open(absolute_file_path, 'r') as file: - return file.read() - except EnvironmentError: # parent of IOError, OSError *and* WindowsError where available - return None - - -def load_yaml(package_name, file_path): - package_path = get_package_share_directory(package_name) - absolute_file_path = os.path.join(package_path, file_path) - - try: - with open(absolute_file_path, 'r') as file: - return yaml.safe_load(file) - except EnvironmentError: # parent of IOError, OSError *and* WindowsError where available - return None +from moveit_configs_utils import MoveItConfigsBuilder +from moveit_configs_utils.launches import generate_move_group_launch +from moveit_configs_utils.launches import generate_moveit_rviz_launch +from moveit_configs_utils.launches import generate_rsp_launch +from moveit_configs_utils.launches import generate_static_virtual_joint_tfs_launch def generate_launch_description(): - declare_loaded_description = DeclareLaunchArgument( - 'loaded_description', - default_value='', - description='Set robot_description text. \ - It is recommended to use RobotDescriptionLoader() in crane_plus_description.' + ld = LaunchDescription() + + description_loader = RobotDescriptionLoader() + + ld.add_action( + DeclareLaunchArgument( + 'loaded_description', + default_value=description_loader.load(), + description='Set robot_description text. \ + It is recommended to use RobotDescriptionLoader() \ + in crane_plus_description.', + ) ) - declare_rviz_config_file = DeclareLaunchArgument( - 'rviz_config_file', - default_value=get_package_share_directory( - 'crane_plus_moveit_config') + '/launch/run_move_group.rviz', - description='Set the path to rviz configuration file.' + moveit_config = ( + MoveItConfigsBuilder('crane_plus') + .planning_scene_monitor( + publish_robot_description=True, + publish_robot_description_semantic=True, + ) + .planning_pipelines(pipelines=['ompl']) + .to_moveit_configs() ) - robot_description = {'robot_description': LaunchConfiguration('loaded_description')} - - robot_description_semantic_config = load_file( - 'crane_plus_moveit_config', 'config/crane_plus.srdf') - robot_description_semantic = { - 'robot_description_semantic': robot_description_semantic_config} - - kinematics_yaml = load_yaml('crane_plus_moveit_config', 'config/kinematics.yaml') - - # Planning Functionality - ompl_planning_pipeline_config = {'move_group': { - 'planning_plugin': 'ompl_interface/OMPLPlanner', - 'request_adapters': 'default_planner_request_adapters/AddTimeOptimalParameterization \ - default_planner_request_adapters/FixWorkspaceBounds \ - default_planner_request_adapters/FixStartStateBounds \ - default_planner_request_adapters/FixStartStateCollision \ - default_planner_request_adapters/FixStartStatePathConstraints', - 'start_state_max_bounds_error': 0.1}} - ompl_planning_yaml = load_yaml('crane_plus_moveit_config', 'config/ompl_planning.yaml') - ompl_planning_pipeline_config['move_group'].update(ompl_planning_yaml) - - # Trajectory Execution Functionality - controllers_yaml = load_yaml('crane_plus_moveit_config', 'config/controllers.yaml') - moveit_controllers = { - 'moveit_simple_controller_manager': controllers_yaml, - 'moveit_controller_manager': - 'moveit_simple_controller_manager/MoveItSimpleControllerManager'} - - trajectory_execution = {'moveit_manage_controllers': True, - 'trajectory_execution.allowed_execution_duration_scaling': 1.2, - 'trajectory_execution.allowed_goal_duration_margin': 0.5, - 'trajectory_execution.allowed_start_tolerance': 0.1} + moveit_config.robot_description = { + 'robot_description': LaunchConfiguration('loaded_description') + } - planning_scene_monitor_parameters = {'publish_planning_scene': True, - 'publish_geometry_updates': True, - 'publish_state_updates': True, - 'publish_transforms_updates': True} + moveit_config.move_group_capabilities = { + 'capabilities': '' + } - # Start the actual move_group node/action server - run_move_group_node = Node(package='moveit_ros_move_group', - executable='move_group', - output='screen', - parameters=[robot_description, - robot_description_semantic, - kinematics_yaml, - ompl_planning_pipeline_config, - trajectory_execution, - moveit_controllers, - planning_scene_monitor_parameters]) + # Move group + ld.add_entity(generate_move_group_launch(moveit_config)) # RViz - rviz_config_file = LaunchConfiguration('rviz_config_file') - rviz_node = Node(package='rviz2', - executable='rviz2', - name='rviz2', - output='log', - arguments=['-d', rviz_config_file], - parameters=[robot_description, - robot_description_semantic, - ompl_planning_pipeline_config, - kinematics_yaml]) + ld.add_entity(generate_moveit_rviz_launch(moveit_config)) # Static TF - static_tf = Node(package='tf2_ros', - executable='static_transform_publisher', - name='static_transform_publisher', - output='log', - arguments=['0.0', '0.0', '0.0', '0.0', '0.0', '0.0', 'world', 'base_link']) + ld.add_entity(generate_static_virtual_joint_tfs_launch(moveit_config)) # Publish TF - robot_state_publisher = Node(package='robot_state_publisher', - executable='robot_state_publisher', - name='robot_state_publisher', - output='both', - parameters=[robot_description]) + ld.add_entity(generate_rsp_launch(moveit_config)) - return LaunchDescription([declare_loaded_description, - declare_rviz_config_file, - run_move_group_node, - rviz_node, - static_tf, - robot_state_publisher, - ]) + return ld diff --git a/crane_plus_moveit_config/launch/setup_assistant.launch.py b/crane_plus_moveit_config/launch/setup_assistant.launch.py new file mode 100755 index 00000000..77eb4d9f --- /dev/null +++ b/crane_plus_moveit_config/launch/setup_assistant.launch.py @@ -0,0 +1,24 @@ +# Copyright 2020 RT Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from moveit_configs_utils import MoveItConfigsBuilder +from moveit_configs_utils.launches import generate_setup_assistant_launch + + +def generate_launch_description(): + moveit_config = MoveItConfigsBuilder( + 'crane_plus', package_name='crane_plus_moveit_config' + ).to_moveit_configs() + return generate_setup_assistant_launch(moveit_config) diff --git a/crane_plus_moveit_config/package.xml b/crane_plus_moveit_config/package.xml old mode 100644 new mode 100755 index 857a4e80..f0ee884e --- a/crane_plus_moveit_config/package.xml +++ b/crane_plus_moveit_config/package.xml @@ -6,22 +6,36 @@ CRANE+ V2 move_group config package RT Corporation Apache License 2.0 - Shota Aoki Atsushi Kuwagata + Nozomi Mizoguchi ament_cmake - moveit - robot_state_publisher - rviz2 - tf2_ros - xacro + moveit_kinematics + moveit_planners + moveit_simple_controller_manager + joint_state_publisher + joint_state_publisher_gui + tf2_ros + xacro + controller_manager + crane_plus_description + moveit_configs_utils + moveit_ros_move_group + moveit_ros_visualization + moveit_ros_warehouse + moveit_setup_assistant + robot_state_publisher + rviz2 + rviz_common + rviz_default_plugins + ament_lint_auto ament_lint_common - ament_cmake + ament_cmake