-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ArUcoサンプルとピッキング動作の追加 (#169) * arucoマーカの認識 * マーカ位置をm系に変換 * マーカ位置姿勢をtfに配信 * tfのsubscribe * マーカ位置が静止していることを検知 * スタイル修正 * picking動作追加 * 不要な記述を削除 * スタイル修正 * 不要な行を削除 * マーカ位置修正 * 把持姿勢の調整 * tf確認用rviz config追加 * URL更新 * マーカ認識位置のオフセットを削除 * Rviz configの切り替えを実装 * デフォルトで起動するスクリプトを修正 Co-authored-by: Shota Aoki <s.aoki@rt-net.jp> * ArUcoの辞書についてコメント追加 * 変数名修正 * デバッグ用処理を削除 * 変数名変更 * コメント追加 * tfの時間計算を修正 * 現在時刻の取得方法変更 * 不要なモジュールの削除 Co-authored-by: Shota Aoki <s.aoki@rt-net.jp> * Update README * Update README * PythonExpressionをUnlessConditionに置き換え * 複数マーカに対応 (cherry picked from commit aa3792b54ae873125a34611f93a0fecec57466c6) * 把持対象のframe id変更 * スタイル修正 * 待機姿勢を関節負荷の低いものに変更 * Update README * Update README * スタイル修正 Co-authored-by: Shota Aoki <s.aoki@rt-net.jp> * サンプル動画URL更新 (#172) * READMEに動画追加 * README修正 * tf2_geometry_msgs.hppの更新 * gz_ros2_controlのブランチを変更 * コメント修正 * コメント修正 * Update README --------- Co-authored-by: Shota Aoki <s.aoki@rt-net.jp>
- Loading branch information
Showing
15 changed files
with
1,167 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
]) |
Oops, something went wrong.