-
Notifications
You must be signed in to change notification settings - Fork 72
Add Pick and Place Harmonic launchers and environment #633
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
Closed
anishk85
wants to merge
11
commits into
JdeRobot:humble-devel
from
anishk85:feature/pick-place-harmonic-launchers
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4ac631d
Add Pick and Place Harmonic launchers and environment
anishk85 8b8238f
Add Pick and Place Harmonic launchers and database entriesFiles added…
anishk85 a27fe3c
Merge branch 'feature/pick-place-harmonic-launchers' of https://githu…
aleon2020 46cf160
Add Pick and Place Harmonic launchers and database entriesFiles added…
anishk85 d271cd3
Force update: Fix duplicate universe 55 entry
anishk85 e536e0f
Merge incoming
aleon2020 78234ce
Fixing duplicated database entry
aleon2020 cc773e6
Fixing environment file
aleon2020 100f93a
Force update: Fix duplicate universe 55 entry
anishk85 3d2d976
Merge branch 'humble-devel' into feature/pick-place-harmonic-launchers
anishk85 ede43c1
deleted submodules
anishk85 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,23 @@ | ||
| # Pick Place Harmonic - CustomRobots Directory | ||
|
|
||
| This directory contains resources for the Pick and Place Harmonic exercise using Gazebo Harmonic. | ||
|
|
||
| ## Structure | ||
|
|
||
| - **launch/**: Launch files for the exercise | ||
| - **models/**: Symbolic link to warehouse models from robotiq_description | ||
| - **urdf/**: Symbolic link to URDF files from ur5_gripper_description | ||
|
|
||
| ## Main Launch File | ||
|
|
||
| The main launcher is located in `/RoboticsInfrastructure/Launchers/pick_place_harmonic.launch.py` | ||
|
|
||
| This launcher wraps the `spawn_robot_warehouse.launch.py` from the `ur5_gripper_description` package, | ||
| which is part of the `pick_place_harmonic_exercise` in IndustrialRobots. | ||
|
|
||
| ## Package Dependencies | ||
|
|
||
| The exercise depends on packages from: | ||
| `/home/dev_ws/src/IndustrialRobots/pick_place_harmonic_exercise/` | ||
|
|
||
| These must be built with colcon before the exercise can run. |
This file contains hidden or 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,43 @@ | ||
| """ | ||
| Pick Place Harmonic - Main World Launcher | ||
| Wraps the spawn_robot_warehouse.launch.py from ur5_gripper_description package | ||
| Academy launches this with launch_rviz=false | ||
| """ | ||
|
|
||
| import os | ||
| from launch import LaunchDescription | ||
| from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription | ||
| from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
| from launch.substitutions import LaunchConfiguration | ||
| from ament_index_python.packages import get_package_share_directory | ||
|
|
||
|
|
||
| def generate_launch_description(): | ||
| # Get package directory | ||
| try: | ||
| ur5_gripper_pkg = get_package_share_directory('ur5_gripper_description') | ||
| except Exception as e: | ||
| print(f"ERROR: Cannot find ur5_gripper_description package: {e}") | ||
| print("Make sure packages are built in /home/ws") | ||
| raise | ||
|
|
||
| # Path to spawn_robot_warehouse launch file | ||
| warehouse_launch_file = os.path.join( | ||
| ur5_gripper_pkg, | ||
| 'launch', | ||
| 'spawn_robot_warehouse.launch.py' | ||
| ) | ||
|
|
||
| print(f"Including launch file: {warehouse_launch_file}") | ||
|
|
||
| # Include the warehouse launch with launch_rviz=false (Academy launches RViz separately) | ||
| warehouse_launch = IncludeLaunchDescription( | ||
| PythonLaunchDescriptionSource(warehouse_launch_file), | ||
| launch_arguments={ | ||
| 'launch_rviz': 'false', # Academy launches RViz separately | ||
| }.items() | ||
| ) | ||
|
|
||
| return LaunchDescription([ | ||
| warehouse_launch, | ||
| ]) |
This file contains hidden or 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,131 @@ | ||
| """ | ||
| Pick Place Harmonic - RViz + MoveIt Launcher | ||
| Launches ONLY: MoveIt move_group + RViz with motion planning | ||
| Assumes Gazebo and robot are already running | ||
| """ | ||
|
|
||
| import os | ||
| from launch import LaunchDescription | ||
| from launch_ros.actions import Node | ||
| from launch.actions import TimerAction | ||
| from ament_index_python.packages import get_package_share_directory | ||
|
|
||
|
|
||
| def generate_launch_description(): | ||
| # Get package directories | ||
| pkg_share_dir = get_package_share_directory("ur5_gripper_description") | ||
| moveit_config_package = "ur5_gripper_moveit_config" | ||
| moveit_pkg_share = get_package_share_directory(moveit_config_package) | ||
|
|
||
| # Robot description (must match what's in Gazebo) | ||
| import xacro | ||
| xacro_file = os.path.join(pkg_share_dir, "urdf", "ur5_robotiq85_gripper.urdf.xacro") | ||
| controllers_file = os.path.join(pkg_share_dir, "config", "ur5_controllers.yaml") | ||
|
|
||
| robot_description_content = xacro.process_file( | ||
| xacro_file, | ||
| mappings={ | ||
| "ur_type": "ur5", | ||
| "name": "ur", | ||
| "prefix": "", | ||
| "use_fake_hardware": "false", | ||
| "sim_gazebo": "false", | ||
| "sim_gz": "true", | ||
| "simulation_controllers": controllers_file, | ||
| } | ||
| ).toxml() | ||
|
|
||
| robot_description = {"robot_description": robot_description_content} | ||
|
|
||
| # SRDF | ||
| srdf_file = os.path.join(moveit_pkg_share, "srdf", "ur5_robotiq.srdf") | ||
| with open(srdf_file, 'r') as file: | ||
| robot_description_semantic = {"robot_description_semantic": file.read()} | ||
|
|
||
| # Kinematics | ||
| kinematics_yaml = os.path.join(moveit_pkg_share, "config", "kinematics.yaml") | ||
|
|
||
| # OMPL planning | ||
| ompl_planning_yaml = os.path.join(moveit_pkg_share, "config", "ompl_planning.yaml") | ||
|
|
||
| # MoveIt controllers | ||
| moveit_controllers = os.path.join(moveit_pkg_share, "config", "controllers.yaml") | ||
|
|
||
| # Planning pipeline | ||
| planning_pipelines_config = { | ||
| "planning_pipelines": ["ompl"], | ||
| "default_planning_pipeline": "ompl", | ||
| "ompl": { | ||
| "planning_plugin": "ompl_interface/OMPLPlanner", | ||
| "request_adapters": "default_planner_request_adapters/AddTimeOptimalParameterization default_planner_request_adapters/ResolveConstraintFrames default_planner_request_adapters/FixWorkspaceBounds default_planner_request_adapters/FixStartStateBounds default_planner_request_adapters/FixStartStateCollision default_planner_request_adapters/FixStartStatePathConstraints", | ||
| "start_state_max_bounds_error": 0.1, | ||
| } | ||
| } | ||
|
|
||
| # Trajectory execution | ||
| trajectory_execution = { | ||
| "moveit_manage_controllers": True, | ||
| "trajectory_execution.allowed_execution_duration_scaling": 1.2, | ||
| "trajectory_execution.allowed_goal_duration_margin": 0.5, | ||
| "trajectory_execution.allowed_start_tolerance": 0.01, | ||
| } | ||
|
|
||
| planning_scene_monitor_parameters = { | ||
| "publish_planning_scene": True, | ||
| "publish_geometry_updates": True, | ||
| "publish_state_updates": True, | ||
| "publish_transforms_updates": True, | ||
| } | ||
|
|
||
| # MoveIt move_group node | ||
| move_group_node = Node( | ||
| package="moveit_ros_move_group", | ||
| executable="move_group", | ||
| output="screen", | ||
| parameters=[ | ||
| robot_description, | ||
| robot_description_semantic, | ||
| kinematics_yaml, | ||
| ompl_planning_yaml, | ||
| planning_pipelines_config, | ||
| trajectory_execution, | ||
| moveit_controllers, | ||
| planning_scene_monitor_parameters, | ||
| {"use_sim_time": True}, | ||
| ], | ||
| ) | ||
|
|
||
| # RViz with MoveIt configuration | ||
| rviz_config_file = os.path.join(moveit_pkg_share, "rviz", "moveit.rviz") | ||
|
|
||
| rviz_node = Node( | ||
| package="rviz2", | ||
| executable="rviz2", | ||
| name="rviz2", | ||
| output="log", | ||
| arguments=["-d", rviz_config_file], | ||
| parameters=[ | ||
| robot_description, | ||
| robot_description_semantic, | ||
| ompl_planning_yaml, | ||
| kinematics_yaml, | ||
| {"use_sim_time": True}, | ||
| ], | ||
| ) | ||
|
|
||
| # Delay MoveIt slightly to let controllers stabilize | ||
| delay_move_group = TimerAction( | ||
| period=2.0, | ||
| actions=[move_group_node], | ||
| ) | ||
|
|
||
| # Delay RViz after MoveIt | ||
| delay_rviz = TimerAction( | ||
| period=3.0, | ||
| actions=[rviz_node], | ||
| ) | ||
|
|
||
| return LaunchDescription([ | ||
| delay_move_group, | ||
| delay_rviz, | ||
| ]) |
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There must be no changes in this file