Skip to content

Commit

Permalink
Jazzy対応 (#78)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
mizonon and Kuwamai authored Dec 20, 2024
1 parent 2f0964e commit 478e9a3
Show file tree
Hide file tree
Showing 36 changed files with 397 additions and 361 deletions.
10 changes: 5 additions & 5 deletions .docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

### ノードの起動
Expand Down Expand Up @@ -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
```
2 changes: 1 addition & 1 deletion .docker/build_source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 1 addition & 7 deletions .docker/source/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

env:
ROS_DISTRO: humble
ROS_DISTRO: jazzy
REGISTRY: ghcr.io

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/industrial_ci.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,4 @@ docs/_build/
# PyBuilder
target/
.pytest_cache

.vscode
.vscode
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions crane_plus_description/package.xml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

<author email="[email protected]">Shota Aoki</author>
<author email="[email protected]">Atsushi Kuwagata</author>
<author email="[email protected]">Nozomi Mizoguchi</author>

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>ament_cmake_python</buildtool_depend>

<depend>gazebo_ros2_control</depend>
<depend>ign_ros2_control</depend>
<depend>gz_ros2_control</depend>
<depend>joint_state_publisher_gui</depend>
<depend>launch</depend>
<depend>robot_state_publisher</depend>
Expand Down
12 changes: 1 addition & 11 deletions crane_plus_description/test/test_robot_description_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
22 changes: 6 additions & 16 deletions crane_plus_description/urdf/crane_plus.gazebo.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,14 @@
name_link_4
name_link_hand
use_camera
use_ignition
config_package
config_file_path
">

<gazebo>
<xacro:if value="${use_ignition}">
<plugin filename="libign_ros2_control-system.so" name="ign_ros2_control::IgnitionROS2ControlPlugin">
<parameters>$(find ${config_package})/${config_file_path}</parameters>
</plugin>
</xacro:if>

<xacro:unless value="${use_ignition}">
<plugin filename="libgazebo_ros2_control.so" name="gazebo_ros2_control">
<robot_sim_type>gazebo_ros2_control/GazeboSystem</robot_sim_type>
<parameters>$(find ${config_package})/${config_file_path}</parameters>
</plugin>
</xacro:unless>
<plugin filename="libgz_ros2_control-system.so" name="gz_ros2_control::GazeboSimROS2ControlPlugin">
<parameters>$(find ${config_package})/${config_file_path}</parameters>
</plugin>
</gazebo>

<gazebo reference="${name_link_base}">
Expand Down Expand Up @@ -85,9 +75,9 @@

<xacro:if value="$(arg use_camera)">
<gazebo>
<plugin filename="ignition-gazebo-sensors-system" name="ignition::gazebo::systems::Sensors">
<render_engine>ogre2</render_engine>
</plugin>
<plugin filename="gz-sim-sensors-system" name="gz::sim::systems::Sensors">
<render_engine>ogre2</render_engine>
</plugin>
</gazebo>

<gazebo reference="camera_color_optical_frame">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,11 @@
joint_4_upper_limit
joint_hand_lower_limit
joint_hand_upper_limit
use_ignition
">

<ros2_control name="${name}" type="system">
<hardware>
<xacro:if value="${use_ignition}">
<plugin>ign_ros2_control/IgnitionSystem</plugin>
</xacro:if>

<xacro:unless value="${use_ignition}">
<plugin>gazebo_ros2_control/GazeboSystem</plugin>
</xacro:unless>
<plugin>gz_ros2_control/GazeboSimSystem</plugin>
</hardware>

<joint name="${name_joint_1}">
Expand Down
5 changes: 1 addition & 4 deletions crane_plus_description/urdf/crane_plus.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<xacro:include filename="$(find crane_plus_description)/urdf/crane_plus.gazebo_ros2_control.xacro"/>

<xacro:arg name="use_gazebo" default="false" />
<xacro:arg name="use_ignition" default="false" />
<xacro:arg name="use_camera" default="false" />
<xacro:arg name="port_name" default="/dev/ttyUSB0" />
<xacro:arg name="baudrate" default="1000000" />
Expand Down Expand Up @@ -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)" />

Expand All @@ -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}"/>
</xacro:if>

</robot>
50 changes: 28 additions & 22 deletions crane_plus_examples/launch/demo.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand All @@ -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
])
2 changes: 1 addition & 1 deletion crane_plus_examples/src/aruco_detection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions crane_plus_examples/src/color_detection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 478e9a3

Please sign in to comment.