-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a867739
commit 51a6938
Showing
3 changed files
with
80 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
<package format="3"> | ||
<name>irb1200_ros2_moveit2</name> | ||
<version>0.0.0</version> | ||
<description>IFRA Group - Cranfield University. ABB-IRB120 MoveIt!2 Config package for ROS2 simulation of the ABB-IRB120 Robot.</description> | ||
<description>IFRA Group - Cranfield University. ABB-IRB1200 MoveIt!2 Config package for ROS2 simulation of the ABB-IRB1200 Robot.</description> | ||
|
||
<author>Mikel Bueno Viso</author> | ||
<maintainer email="[email protected]">Mikel Bueno Viso</maintainer> | ||
|
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 |
---|---|---|
|
@@ -20,16 +20,16 @@ | |
# Seemal Asif - [email protected] # | ||
# Phil Webb - [email protected] # | ||
# # | ||
# Date: July, 2022. # | ||
# Date: September, 2022. # | ||
# # | ||
# ===================================== COPYRIGHT ===================================== # | ||
|
||
# ======= CITE OUR WORK ======= # | ||
# You can cite our work with the following statement: | ||
# IFRA (2022) ROS2.0 ROBOT SIMULATION. URL: https://github.com/IFRA-Cranfield/ros2_RobotSimulation. | ||
|
||
# irb6640_simulation.launch.py: | ||
# Launch file for the ABB-IRB6640 Robot GAZEBO SIMULATION in ROS2 Foxy: | ||
# irb1200_simulation.launch.py: | ||
# Launch file for the ABB-IRB1200 Robot GAZEBO SIMULATION in ROS2 Foxy: | ||
|
||
# Import libraries: | ||
import os | ||
|
@@ -68,28 +68,90 @@ def generate_launch_description(): | |
|
||
# ***** GAZEBO ***** # | ||
# DECLARE Gazebo WORLD file: | ||
irb6640_ros2_gazebo = os.path.join( | ||
get_package_share_directory('irb6640_ros2_gazebo'), | ||
irb1200_ros2_gazebo = os.path.join( | ||
get_package_share_directory('irb1200_ros2_gazebo'), | ||
'worlds', | ||
'irb6640.world') | ||
'irb1200.world') | ||
# DECLARE Gazebo LAUNCH file: | ||
gazebo = IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource([os.path.join( | ||
get_package_share_directory('gazebo_ros'), 'launch'), '/gazebo.launch.py']), | ||
launch_arguments={'world': irb6640_ros2_gazebo}.items(), | ||
launch_arguments={'world': irb1200_ros2_gazebo}.items(), | ||
) | ||
|
||
# ========== COMMAND LINE ARGUMENTS ========== # | ||
print("") | ||
print(" --- Cranfield University --- ") | ||
print(" (c) IFRA Group ") | ||
print("") | ||
|
||
print("ros2_RobotSimulation --> ABB IRB-1200") | ||
print("Launch file -> irb1200_simulation.launch.py") | ||
|
||
print("") | ||
print("Robot configuration:") | ||
print("") | ||
|
||
# Cell Layout: | ||
print("- Cell layout:") | ||
print(" + No cell layout variants for this robot.") | ||
cell_layout_1 = "true" | ||
|
||
# error = True | ||
# while (error == True): | ||
# print(" + Option N1: ABB IRB-1200 alone.") | ||
# print(" + Option N2: ***.") | ||
# cell_layout = input (" Please select: ") | ||
# if (cell_layout == "1"): | ||
# error = False | ||
# cell_layout_1 = "true" | ||
# cell_layout_2 = "false" | ||
# elif (cell_layout == "2"): | ||
# error = False | ||
# cell_layout_1 = "false" | ||
# cell_layout_2 = "true" | ||
# else: | ||
# print (" Please select a valid option!") | ||
print("") | ||
|
||
# End-Effector: | ||
print("- End-effector:") | ||
print(" + No EE variants for this robot.") | ||
EE_no = "true" | ||
|
||
# error = True | ||
# while (error == True): | ||
# print(" + Option N1: No end-effector.") | ||
# print(" + Option N2: ***.") | ||
# end_effector = input (" Please select: ") | ||
# if (end_effector == "1"): | ||
# error = False | ||
# EE_no = "true" | ||
# EE_*** = "false" | ||
# elif (end_effector == "2"): | ||
# error = False | ||
# EE_no = "false" | ||
# EE_*** = "true" | ||
# else: | ||
# print (" Please select a valid option!") | ||
print("") | ||
|
||
# ***** ROBOT DESCRIPTION ***** # | ||
# ABB-IRB6640 Description file package: | ||
irb6640_description_path = os.path.join( | ||
get_package_share_directory('irb6640_ros2_gazebo')) | ||
# ABB-IRB6640 ROBOT urdf file path: | ||
xacro_file = os.path.join(irb6640_description_path, | ||
# ABB-IRB1200 Description file package: | ||
irb1200_description_path = os.path.join( | ||
get_package_share_directory('irb1200_ros2_gazebo')) | ||
# ABB-IRB1200 ROBOT urdf file path: | ||
xacro_file = os.path.join(irb1200_description_path, | ||
'urdf', | ||
'irb6640.urdf.xacro') | ||
# Generate ROBOT_DESCRIPTION for ABB-IRB6640: | ||
'irb1200.urdf.xacro') | ||
# Generate ROBOT_DESCRIPTION for ABB-IRB1200: | ||
doc = xacro.parse(open(xacro_file)) | ||
xacro.process_doc(doc) | ||
xacro.process_doc(doc, mappings={ | ||
"cell_layout_1": cell_layout_1, | ||
# "cell_layout_2": cell_layout_2, | ||
"EE_no": EE_no, | ||
# "EE_**": EE_**, | ||
}) | ||
robot_description_config = doc.toxml() | ||
robot_description = {'robot_description': robot_description_config} | ||
|
||
|
@@ -104,21 +166,9 @@ def generate_launch_description(): | |
# SPAWN ROBOT TO GAZEBO: | ||
spawn_entity = Node(package='gazebo_ros', executable='spawn_entity.py', | ||
arguments=['-topic', 'robot_description', | ||
'-entity', 'irb6640'], | ||
'-entity', 'irb1200'], | ||
output='screen') | ||
|
||
# ***** CONTROLLERS ***** # | ||
# Joint STATE Controller: | ||
load_joint_state_controller = ExecuteProcess( | ||
cmd=['ros2', 'control', 'load_start_controller', 'joint_state_controller'], | ||
output='screen' | ||
) | ||
# Joint TRAJECTORY Controller: | ||
load_joint_trajectory_controller = ExecuteProcess( | ||
cmd=['ros2', 'control', 'load_start_controller', 'joint_trajectory_controller'], | ||
output='screen' | ||
) | ||
|
||
# ***** RETURN LAUNCH DESCRIPTION ***** # | ||
return LaunchDescription([ | ||
gazebo, | ||
|