Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArUcoサンプルとピッキング動作の追加 #169

Merged
merged 35 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b148882
arucoマーカの認識
Kuwamai Dec 8, 2022
6da7368
マーカ位置をm系に変換
Kuwamai Dec 13, 2022
602d7f7
マーカ位置姿勢をtfに配信
Kuwamai Dec 13, 2022
94b2bfb
tfのsubscribe
Kuwamai Dec 16, 2022
adbc5f6
マーカ位置が静止していることを検知
Kuwamai Dec 19, 2022
be11326
スタイル修正
Kuwamai Dec 22, 2022
7a770ba
picking動作追加
Kuwamai Dec 22, 2022
5673cee
不要な記述を削除
Kuwamai Dec 22, 2022
db1e617
スタイル修正
Kuwamai Dec 22, 2022
172da4b
不要な行を削除
Kuwamai Dec 22, 2022
b0dadba
マーカ位置修正
Kuwamai Dec 23, 2022
af3a87f
把持姿勢の調整
Kuwamai Dec 28, 2022
a1c4500
tf確認用rviz config追加
Kuwamai Dec 28, 2022
d071873
URL更新
Kuwamai Dec 28, 2022
fcf6a51
マーカ認識位置のオフセットを削除
Kuwamai Jan 13, 2023
b7f5cc2
Rviz configの切り替えを実装
Kuwamai Jan 13, 2023
f6472af
デフォルトで起動するスクリプトを修正
Kuwamai Jan 13, 2023
0cd2777
ArUcoの辞書についてコメント追加
Kuwamai Jan 13, 2023
16bb5d7
変数名修正
Kuwamai Jan 13, 2023
13375ae
デバッグ用処理を削除
Kuwamai Jan 13, 2023
a35acaa
変数名変更
Kuwamai Jan 13, 2023
e9ffe9a
コメント追加
Kuwamai Jan 13, 2023
db4db45
tfの時間計算を修正
Kuwamai Jan 13, 2023
d3bfd67
現在時刻の取得方法変更
Kuwamai Jan 13, 2023
13fb508
不要なモジュールの削除
Kuwamai Jan 13, 2023
ffd9ff1
Update README
Kuwamai Jan 17, 2023
1f04367
Update README
Kuwamai Jan 17, 2023
b3e35b0
PythonExpressionをUnlessConditionに置き換え
Kuwamai Jan 17, 2023
e7f2551
複数マーカに対応
Kuwamai Jan 18, 2023
e0078ca
把持対象のframe id変更
Kuwamai Jan 19, 2023
4533f33
スタイル修正
Kuwamai Jan 19, 2023
114ab86
待機姿勢を関節負荷の低いものに変更
Kuwamai Jan 24, 2023
058ce44
Update README
Kuwamai Jan 24, 2023
c721807
Update README
Kuwamai Jan 24, 2023
6101fd3
スタイル修正
Kuwamai Jan 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crane_x7_examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ endif()

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(cv_bridge REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(moveit_ros_planning_interface REQUIRED)
find_package(OpenCV REQUIRED COMPONENTS core)
find_package(rclcpp REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)

Expand All @@ -29,12 +31,16 @@ set(executable_list
pose_groupstate
joint_values
pick_and_place
pick_and_place_tf
aruco_detection
)
foreach(loop_var IN LISTS executable_list)
add_executable(${loop_var} src/${loop_var}.cpp)
ament_target_dependencies(${loop_var}
cv_bridge
geometry_msgs
moveit_ros_planning_interface
OpenCV
rclcpp
tf2_geometry_msgs
)
Expand Down
89 changes: 89 additions & 0 deletions crane_x7_examples/launch/camera_example.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Copyright 2022 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.

import os

from ament_index_python.packages import get_package_share_directory
from crane_x7_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 SetParameter
from launch_ros.actions import Node
import yaml


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


def generate_launch_description():
description_loader = RobotDescriptionLoader()

robot_description_semantic_config = load_file(
'crane_x7_moveit_config', 'config/crane_x7.srdf')
robot_description_semantic = {
'robot_description_semantic': robot_description_semantic_config}

kinematics_yaml = load_yaml('crane_x7_moveit_config', 'config/kinematics.yaml')

declare_example_name = DeclareLaunchArgument(
'example', default_value='aruco_detection',
description=('Set an example executable name: '
'[aruco_detection]')
)

declare_use_sim_time = DeclareLaunchArgument(
'use_sim_time', default_value='false',
description=('Set true when using the gazebo simulator.')
)

picking_node = Node(name="pick_and_place_tf",
package='crane_x7_examples',
executable='pick_and_place_tf',
output='screen',
parameters=[{'robot_description': description_loader.load()},
robot_description_semantic,
kinematics_yaml])

detection_node = Node(name=[LaunchConfiguration('example'), '_node'],
package='crane_x7_examples',
executable=LaunchConfiguration('example'),
output='screen')

return LaunchDescription([
declare_use_sim_time,
SetParameter(name='use_sim_time', value=LaunchConfiguration('use_sim_time')),
picking_node,
detection_node,
declare_example_name
])
Loading