-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 点群検出ノード追加 * pick_and_place_tf追加 * RealSenseのパラメータ名修正 * プレーシング位置調整 * 把持判定条件の整理 * 初期化動作修正 * 把持角度調整 * RVizの表示を調整 * RVizの表示を調整 * 使用するライブラリを整理 * スタイル修正 * Update README * 左右判別用enum作成、パラメータの定数化 * 点群が空のときの判定処理を修正 * 配信する点群を予めreserveする * スタイル修正 * 点群の取得範囲を修正 * 平面検出時の判定条件を修正 * コメント修正
- Loading branch information
Showing
8 changed files
with
930 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# Copyright 2024 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 sciurus17_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( | ||
'sciurus17_moveit_config', 'config/sciurus17.srdf') | ||
robot_description_semantic = { | ||
'robot_description_semantic': robot_description_semantic_config} | ||
|
||
kinematics_yaml = load_yaml('sciurus17_moveit_config', 'config/kinematics.yaml') | ||
|
||
declare_example_name = DeclareLaunchArgument( | ||
'example', default_value='point_cloud_detection', | ||
description=('Set an example executable name: ' | ||
'[point_cloud_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='sciurus17_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='sciurus17_examples', | ||
executable=LaunchConfiguration('example'), | ||
output='screen') | ||
|
||
return LaunchDescription([ | ||
declare_use_sim_time, | ||
SetParameter(name='use_sim_time', value=LaunchConfiguration('use_sim_time')), | ||
picking_node, | ||
declare_example_name, | ||
detection_node | ||
]) |
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
Oops, something went wrong.