Skip to content

Commit

Permalink
動作確認のため、support_jazzyをマージ
Browse files Browse the repository at this point in the history
  • Loading branch information
mizonon committed Nov 8, 2024
2 parents 32a0cb8 + f2e153a commit b3f6ec1
Show file tree
Hide file tree
Showing 11 changed files with 199 additions and 78 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
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,4 @@ docs/_build/

# PyBuilder
target/
.pytest_cache
.vscode
.pytest_cache
123 changes: 123 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# crane_plus

[![industrial_ci](https://github.com/rt-net/crane_plus/workflows/industrial_ci/badge.svg?branch=master)](https://github.com/rt-net/crane_plus/actions?query=workflow%3Aindustrial_ci+branch%3Amaster)

ROS 2 package suite of CRANE+ V2.

<img src=https://www.rt-shop.jp/images/RT/CRANEplusV2.png width=400px/><img src=https://rt-net.github.io/images/crane-plus/pick_and_place.gif width=400px />

## Table of Contents

- [Supported ROS 2 distributions](#supported-ROS-2-distributions)
- [Requirements](#requirements)
- [Installation](#installation)
- [Binary installation](#binary-installation)
- [Source Build](#source-build)
- [Quick Start](#quick-start)
- [Packages](#packages)
- [License](#license)
- [Disclaimer](#disclaimer)

## Supported ROS 2 distributions

- [Foxy](https://github.com/rt-net/crane_plus/tree/foxy-devel)
- [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 24.04
- ROS
- [Jazzy Jalisco](https://docs.ros.org/en/jazzy/Installation.html)

## Installation

### Docker images

ビルド済みのパッケージ含むDocker imageを用意してます。
詳細は[.docker/README.md](./.docker/README.md)を参照してください。

### Binary installation

```sh
$ sudo apt update
$ sudo apt install ros-jazzy-crane-plus
```

### Source Build

```sh
# Setup ROS environment
$ source /opt/ros/jazzy/setup.bash

# Download crane_plus repository
$ mkdir -p ~/ros2_ws/src
$ cd ~/ros2_ws/src
$ git clone https://github.com/rt-net/crane_plus.git

# Install dependencies
$ rosdep install -r -y -i --from-paths .

# Build & Install
$ cd ~/ros2_ws
$ colcon build --symlink-install
$ source ~/ros2_ws/install/setup.bash
```

## Quick Start

```sh
# Connect CRANE+ V2 to PC, then
$ source ~/ros2_ws/install/setup.bash
$ ros2 launch crane_plus_examples demo.launch.py port_name:=/dev/ttyUSB0

# Terminal 2
$ source ~/ros2_ws/install/setup.bash
$ ros2 launch crane_plus_examples example.launch.py example:='gripper_control'

# Press [Ctrl-c] to terminate.
```

<img src=https://rt-net.github.io/images/crane-plus/gripper_control.gif width=500px />

詳細は[crane_plus_examples](./crane_plus_examples/README.md)
を参照してください。

## Packages

- crane_plus_control
- [README](./crane_plus_control/README.md)
- CRANE+ V2を制御するパッケージです
- USB通信ポートの設定方法をREAMDEに記載してます
- crane_plus_description
- [README](./crane_plus_description/README.md)
- CRANE+ V2のモデルデータ(xacro)を定義するパッケージです
- crane_plus_examples
- [README](./crane_plus_examples/README.md)
- CRANE+ V2のサンプルコード集です
- crane_plus_gazebo
- [README](./crane_plus_gazebo/README.md)
- CRANE+ V2のGazeboシミュレーションパッケージです
- crane_plus_moveit_config
- [README](./crane_plus_moveit_config/README.md)
- CRANE+ V2の`moveit2`設定ファイルです

## License

このリポジトリはApache 2.0ライセンスの元、公開されています。
ライセンスについては[LICENSE](./LICENSE)を参照ください。

サーボモータのAX-12Aに関するCADモデルの使用については、ROBOTIS社より使用許諾を受けています。
CRANE+ V2に使用されているROBOTIS社の部品類にかかる著作権、商標権、その他の知的財産権は、ROBOTIS社に帰属します。

We have obtained permission from ROBOTIS Co., Ltd. to use CAD models relating to servo motors AX-12A. The proprietary rights relating to any components or parts manufactured by ROBOTIS and used in this product, including but not limited to copyrights, trademarks, and other intellectual property rights, shall remain vested in ROBOTIS.

## Disclaimer

本ソフトウェアはApache 2.0ライセンスで、「AS IS」(現状有姿のまま)で提供しています。本ソフトウェアに関する無償サポートはありません。

当該製品および当ソフトウェアの使用中に生じたいかなる損害も株式会社アールティでは一切の責任を負いかねます。 ユーザー自身で作成されたプログラムに適切な制限動作が備わっていない場合、本体の損傷や、本体が周囲や作業者に接触、あるいは衝突し、思わぬ重大事故が発生する危険があります。 ユーザーの責任において十分に安全に注意した上でご使用下さい。

1 change: 1 addition & 0 deletions crane_plus_description/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<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>
Expand Down
12 changes: 9 additions & 3 deletions crane_plus_moveit_config/config/ompl_planning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ response_adapters:
- default_planning_response_adapters/AddTimeOptimalParameterization
- default_planning_response_adapters/ValidateSolution
- default_planning_response_adapters/DisplayMotionPath

start_state_max_bounds_error: 0.1

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()
Expand Down Expand Up @@ -141,6 +145,7 @@ planner_configs:

arm:
planner_configs:
- APSConfigDefault
- SBLkConfigDefault
- ESTkConfigDefault
- LBKPIECEkConfigDefault
Expand All @@ -167,6 +172,7 @@ arm:
- TrajOptDefault
gripper:
planner_configs:
- APSConfigDefault
- SBLkConfigDefault
- ESTkConfigDefault
- LBKPIECEkConfigDefault
Expand Down
88 changes: 37 additions & 51 deletions crane_plus_moveit_config/launch/run_move_group.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,101 +18,87 @@
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
import yaml
from moveit_configs_utils import MoveItConfigsBuilder
from moveit_configs_utils.launch_utils import DeclareBooleanLaunchArg
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_static_virtual_joint_tfs_launch
from moveit_configs_utils.launches import generate_rsp_launch
from moveit_configs_utils.launch_utils import DeclareBooleanLaunchArg

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.launches \
import generate_static_virtual_joint_tfs_launch


def generate_launch_description():
ld = LaunchDescription()

declare_loaded_description = DeclareLaunchArgument(
"loaded_description",
default_value="",
description="Set robot_description text. \
It is recommended to use RobotDescriptionLoader() in crane_plus_description.",
'loaded_description',
default_value='',
description='Set robot_description text. \
It is recommended to use RobotDescriptionLoader() in \
crane_plus_description.',
)

ld.add_action(declare_loaded_description)

ld.add_action(DeclareBooleanLaunchArg("debug", default_value=False))
ld.add_action(DeclareBooleanLaunchArg('debug', default_value=False))

ld.add_action(
DeclareLaunchArgument(
"rviz_config",
default_value=get_package_share_directory("crane_plus_moveit_config")
+ "/config/moveit.rviz",
description="Set the path to rviz configuration file.",
'rviz_config',
default_value=get_package_share_directory(
'crane_plus_moveit_config'
)
+ '/config/moveit.rviz',
description='Set the path to rviz configuration file.',
)
)

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.'
)

ld.add_action(declare_rviz_config_file)

moveit_config = (
MoveItConfigsBuilder("crane_plus")
MoveItConfigsBuilder('crane_plus')
.planning_scene_monitor(
publish_robot_description=True,
publish_robot_description_semantic=True,
)
.robot_description(
file_path=os.path.join(
get_package_share_directory("crane_plus_description"),
"urdf",
"crane_plus.urdf.xacro",
get_package_share_directory('crane_plus_description'),
'urdf',
'crane_plus.urdf.xacro',
),
mappings={},
)
.robot_description_semantic(
file_path="config/crane_plus.srdf",
mappings={"model": "crane_plus"},
file_path='config/crane_plus.srdf',
mappings={'model': 'crane_plus'},
)
.joint_limits(file_path="config/joint_limits.yaml")
.joint_limits(file_path='config/joint_limits.yaml')
.trajectory_execution(
file_path="config/controllers.yaml", moveit_manage_controllers=True
file_path='config/controllers.yaml', moveit_manage_controllers=True
)
.planning_pipelines(pipelines=["ompl"])
.robot_description_kinematics(file_path="config/kinematics.yaml")
.planning_pipelines(pipelines=['ompl'])
.robot_description_kinematics(file_path='config/kinematics.yaml')
.to_moveit_configs()
)

moveit_config.robot_description = {
"robot_description": LaunchConfiguration("loaded_description")
'robot_description': LaunchConfiguration('loaded_description')
}

moveit_config.move_group_capabilities = {
"capabilities": ""
'capabilities': ''
}

# Move group
ld.add_entity(generate_move_group_launch(moveit_config))

# RViz
ld.add_entity(generate_moveit_rviz_launch(moveit_config))

Expand Down
Loading

0 comments on commit b3f6ec1

Please sign in to comment.