Skip to content

Commit

Permalink
Fix typo: 120/1200.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikelBueno committed Feb 28, 2023
1 parent a867739 commit 51a6938
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<!-- ========== ========== ========== ========== ========== ========== -->
<!-- CELL LAYOUT SELECTION: -->

<!-- CELL LAYOUT N1) ABB IRB120 Robot alone: -->
<!-- CELL LAYOUT N1) ABB IRB1200 Robot alone: -->
<xacro:if value="${cell_layout_1}">
<joint name="world-base_link-fixed" type="fixed">
<parent link="world"/>
Expand Down
2 changes: 1 addition & 1 deletion ABBRobots/IRB1200/irb1200_ros2_moveit2/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}

Expand All @@ -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,
Expand Down

0 comments on commit 51a6938

Please sign in to comment.