Skip to content

Commit

Permalink
test launch files with fake hw
Browse files Browse the repository at this point in the history
  • Loading branch information
Aron Svastits committed Nov 10, 2023
1 parent dc52375 commit 73c410c
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def generate_launch_description():
"urdf", "lbr_iisy11_r1300.urdf.xacro"]
),
" ",
"use_fake_hardware:=true",
]
)
robot_description = {'robot_description': robot_description_content}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def generate_launch_description():
"urdf", "lbr_iisy15_r930.urdf.xacro"]
),
" ",
"use_fake_hardware:=true",
]
)
robot_description = {'robot_description': robot_description_content}
Expand Down
7 changes: 7 additions & 0 deletions kuka_lbr_iisy_support/launch/test_lbr_iisy3_r760.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
from launch.substitutions import Command, FindExecutable, PathJoinSubstitution
from launch_ros.substitutions import FindPackageShare
from launch_ros.actions import Node
import xacro
import os
from ament_index_python.packages import get_package_share_directory



def generate_launch_description():
Expand All @@ -30,8 +34,11 @@ def generate_launch_description():
"urdf", "lbr_iisy3_r760.urdf.xacro"]
),
" ",
"use_fake_hardware:=true",
]
)
# robot_description_content = xacro.process_file(os.path.join(get_package_share_directory('kuka_lbr_iisy_support'), 'urdf', 'lbr_iisy3_r760.urdf.xacro'))

robot_description = {'robot_description': robot_description_content}

# RViz
Expand Down
30 changes: 6 additions & 24 deletions kuka_lbr_iisy_support/urdf/lbr_iisy11_r1300.urdf.xacro
Original file line number Diff line number Diff line change
@@ -1,28 +1,10 @@
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="lbr_iisy11_r1300">
<!-- Import iisy urdf file -->
<xacro:include filename="$(find kuka_lbr_iisy_support)/urdf/lbr_iisy11_r1300_macro.xacro"/>
<!-- Import iisy urdf file -->
<xacro:include filename="$(find kuka_lbr_iisy_support)/urdf/lbr_iisy11_r1300_macro.xacro"/>

<!-- Read parameters from eci_config -->
<xacro:property name="eci_config" value="$(find kuka_rox_hw_interface)/config/eci_config.yaml" />
<xacro:property name="eci_config_dict" value="${xacro.load_yaml(eci_config)}"/>
<xacro:property name="control_mode" value="${eci_config_dict['robot_manager']['ros__parameters']['control_mode']}" />
<xacro:property name="client_ip" value="${eci_config_dict['robot_manager']['ros__parameters']['client_ip']}" />
<xacro:property name="controller_ip" value="${eci_config_dict['robot_manager']['ros__parameters']['controller_ip']}" />
<!-- Read additional arguments -->
<xacro:arg name="use_fake_hardware" default="false" />

<!-- Read QoS profile parameters -->
<xacro:property name="qos_config" value="$(find kuka_rox_hw_interface)/config/qos_profiles.yaml" />
<xacro:property name="qos_config_dict" value="${xacro.load_yaml(qos_config)}"/>
<xacro:property name="consequent_lost_packets" value="${qos_config_dict['rt_packet_loss_profile']['consequent_lost_packets']}" />
<xacro:property name="lost_packets_in_timeframe" value="${qos_config_dict['rt_packet_loss_profile']['lost_packets_in_timeframe']}" />
<xacro:property name="timeframe_ms" value="${qos_config_dict['rt_packet_loss_profile']['timeframe_ms']}" />


<xacro:kuka_lbr_iisy11_r1300_robot prefix=""
client_ip="${client_ip}"
controller_ip="${controller_ip}"
control_mode="${control_mode}"
consequent_lost_packets="${consequent_lost_packets}"
lost_packets_in_timeframe="${lost_packets_in_timeframe}"
timeframe_ms="${timeframe_ms}"/>
</robot>
<xacro:kuka_lbr_iisy11_r1300_robot prefix="" use_fake_hardware="$(arg use_fake_hardware)"/>
</robot>
9 changes: 2 additions & 7 deletions kuka_lbr_iisy_support/urdf/lbr_iisy11_r1300_macro.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@
<xacro:include filename="$(find kuka_resources)/urdf/common_materials.xacro"/>
<xacro:include filename="$(find kuka_lbr_iisy_support)/urdf/lbr_iisy_transmission.xacro" />

<xacro:macro name="kuka_lbr_iisy11_r1300_robot" params="prefix client_ip controller_ip control_mode consequent_lost_packets lost_packets_in_timeframe timeframe_ms">
<xacro:macro name="kuka_lbr_iisy11_r1300_robot" params="prefix use_fake_hardware:=false">
<!-- ros2 control instance -->
<xacro:kuka_lbr_iisy_ros2_control
name="lbr_iisy11_r1300"
prefix="${prefix}"
client_ip="${client_ip}"
controller_ip="${controller_ip}"
control_mode="${control_mode}"
consequent_lost_packets="${consequent_lost_packets}"
lost_packets_in_timeframe="${lost_packets_in_timeframe}"
timeframe_ms="${timeframe_ms}" />
use_fake_hardware="${use_fake_hardware}" />

<!-- links - main serial chain -->
<!-- links - root element cannot have inertia, therefore a dummy base_link is needed -->
Expand Down
28 changes: 5 additions & 23 deletions kuka_lbr_iisy_support/urdf/lbr_iisy15_r930.urdf.xacro
Original file line number Diff line number Diff line change
@@ -1,28 +1,10 @@
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="lbr_iisy15_r930">
<!-- Import iisy urdf file -->
<xacro:include filename="$(find kuka_lbr_iisy_support)/urdf/lbr_iisy15_r930_macro.xacro"/>
<!-- Import iisy urdf file -->
<xacro:include filename="$(find kuka_lbr_iisy_support)/urdf/lbr_iisy15_r930_macro.xacro"/>

<!-- Read parameters from eci_config -->
<xacro:property name="eci_config" value="$(find kuka_rox_hw_interface)/config/eci_config.yaml" />
<xacro:property name="eci_config_dict" value="${xacro.load_yaml(eci_config)}"/>
<xacro:property name="control_mode" value="${eci_config_dict['robot_manager']['ros__parameters']['control_mode']}" />
<xacro:property name="client_ip" value="${eci_config_dict['robot_manager']['ros__parameters']['client_ip']}" />
<xacro:property name="controller_ip" value="${eci_config_dict['robot_manager']['ros__parameters']['controller_ip']}" />
<!-- Read additional arguments -->
<xacro:arg name="use_fake_hardware" default="false" />

<!-- Read QoS profile parameters -->
<xacro:property name="qos_config" value="$(find kuka_rox_hw_interface)/config/qos_profiles.yaml" />
<xacro:property name="qos_config_dict" value="${xacro.load_yaml(qos_config)}"/>
<xacro:property name="consequent_lost_packets" value="${qos_config_dict['rt_packet_loss_profile']['consequent_lost_packets']}" />
<xacro:property name="lost_packets_in_timeframe" value="${qos_config_dict['rt_packet_loss_profile']['lost_packets_in_timeframe']}" />
<xacro:property name="timeframe_ms" value="${qos_config_dict['rt_packet_loss_profile']['timeframe_ms']}" />


<xacro:kuka_lbr_iisy15_r930_robot prefix=""
client_ip="${client_ip}"
controller_ip="${controller_ip}"
control_mode="${control_mode}"
consequent_lost_packets="${consequent_lost_packets}"
lost_packets_in_timeframe="${lost_packets_in_timeframe}"
timeframe_ms="${timeframe_ms}"/>
<xacro:kuka_lbr_iisy15_r930_robot prefix="" use_fake_hardware="$(arg use_fake_hardware)"/>
</robot>
9 changes: 2 additions & 7 deletions kuka_lbr_iisy_support/urdf/lbr_iisy15_r930_macro.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@
<xacro:include filename="$(find kuka_resources)/urdf/common_materials.xacro"/>
<xacro:include filename="$(find kuka_lbr_iisy_support)/urdf/lbr_iisy_transmission.xacro" />

<xacro:macro name="kuka_lbr_iisy15_r930_robot" params="prefix client_ip controller_ip control_mode consequent_lost_packets lost_packets_in_timeframe timeframe_ms">
<xacro:macro name="kuka_lbr_iisy15_r930_robot" params="prefix use_fake_hardware:=false">
<!-- ros2 control instance -->
<xacro:kuka_lbr_iisy_ros2_control
name="lbr_iisy15_r930"
prefix="${prefix}"
client_ip="${client_ip}"
controller_ip="${controller_ip}"
control_mode="${control_mode}"
consequent_lost_packets="${consequent_lost_packets}"
lost_packets_in_timeframe="${lost_packets_in_timeframe}"
timeframe_ms="${timeframe_ms}" />
use_fake_hardware="${use_fake_hardware}" />

<!-- links - main serial chain -->
<!-- links - root element cannot have inertia, therefore a dummy base_link is needed -->
Expand Down
31 changes: 5 additions & 26 deletions kuka_lbr_iisy_support/urdf/lbr_iisy3_r760.urdf.xacro
Original file line number Diff line number Diff line change
@@ -1,31 +1,10 @@
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="lbr_iisy3_r760">
<!-- Import iisy urdf file -->
<xacro:include filename="$(find kuka_lbr_iisy_support)/urdf/lbr_iisy3_r760_macro.xacro"/>
<!-- Import iisy urdf file -->
<xacro:include filename="$(find kuka_lbr_iisy_support)/urdf/lbr_iisy3_r760_macro.xacro"/>

<!-- Read parameters from eci_config -->
<xacro:property name="eci_config" value="$(find kuka_rox_hw_interface)/config/eci_config.yaml" />
<xacro:property name="eci_config_dict" value="${xacro.load_yaml(eci_config)}"/>
<xacro:property name="control_mode" value="${eci_config_dict['robot_manager']['ros__parameters']['control_mode']}" />
<xacro:property name="client_ip" value="${eci_config_dict['robot_manager']['ros__parameters']['client_ip']}" />
<xacro:property name="controller_ip" value="${eci_config_dict['robot_manager']['ros__parameters']['controller_ip']}" />
<!-- Read additional arguments -->
<xacro:arg name="use_fake_hardware" default="false" />

<!-- Read QoS profile parameters -->
<xacro:property name="qos_config" value="$(find kuka_rox_hw_interface)/config/qos_profiles.yaml" />
<xacro:property name="qos_config_dict" value="${xacro.load_yaml(qos_config)}"/>
<xacro:property name="consequent_lost_packets" value="${qos_config_dict['rt_packet_loss_profile']['consequent_lost_packets']}" />
<xacro:property name="lost_packets_in_timeframe" value="${qos_config_dict['rt_packet_loss_profile']['lost_packets_in_timeframe']}" />
<xacro:property name="timeframe_ms" value="${qos_config_dict['rt_packet_loss_profile']['timeframe_ms']}" />

<!-- Read additional arguments -->
<xacro:arg name="use_fake_hardware" default="false" />

<xacro:kuka_lbr_iisy3_r760_robot prefix=""
client_ip="${client_ip}"
controller_ip="${controller_ip}"
control_mode="${control_mode}"
consequent_lost_packets="${consequent_lost_packets}"
lost_packets_in_timeframe="${lost_packets_in_timeframe}"
timeframe_ms="${timeframe_ms}"
use_fake_hardware="$(arg use_fake_hardware)"/>
<xacro:kuka_lbr_iisy3_r760_robot prefix="" use_fake_hardware="$(arg use_fake_hardware)"/>
</robot>
10 changes: 2 additions & 8 deletions kuka_lbr_iisy_support/urdf/lbr_iisy3_r760_macro.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,11 @@
<xacro:include filename="$(find kuka_resources)/urdf/common_materials.xacro"/>
<xacro:include filename="$(find kuka_lbr_iisy_support)/urdf/lbr_iisy_transmission.xacro" />

<xacro:macro name="kuka_lbr_iisy3_r760_robot" params="prefix client_ip controller_ip control_mode consequent_lost_packets lost_packets_in_timeframe timeframe_ms use_fake_hardware:=false">
<xacro:macro name="kuka_lbr_iisy3_r760_robot" params="prefix use_fake_hardware:=false">
<!-- ros2 control instance -->
<xacro:kuka_lbr_iisy_ros2_control
name="lbr_iisy3_r760"
prefix="${prefix}"
client_ip="${client_ip}"
controller_ip="${controller_ip}"
control_mode="${control_mode}"
consequent_lost_packets="${consequent_lost_packets}"
lost_packets_in_timeframe="${lost_packets_in_timeframe}"
timeframe_ms="${timeframe_ms}"
prefix="${prefix}"
use_fake_hardware="${use_fake_hardware}" />

<!-- links - main serial chain -->
Expand Down
16 changes: 15 additions & 1 deletion kuka_lbr_iisy_support/urdf/lbr_iisy_ros2_control.xacro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:macro name="kuka_lbr_iisy_ros2_control" params="name prefix client_ip controller_ip control_mode consequent_lost_packets lost_packets_in_timeframe timeframe_ms use_fake_hardware:=false">
<xacro:macro name="kuka_lbr_iisy_ros2_control" params="name prefix use_fake_hardware:=false">
<ros2_control name="${name}" type="system">
<hardware>
<xacro:if value="${use_fake_hardware}">
Expand All @@ -9,6 +9,20 @@
<param name="state_following_offset">0.0</param>
</xacro:if>
<xacro:unless value="${use_fake_hardware}">
<!-- Read parameters from eci_config -->
<xacro:property name="eci_config" value="$(find kuka_rox_hw_interface)/config/eci_config.yaml" />
<xacro:property name="eci_config_dict" value="${xacro.load_yaml(eci_config)}"/>
<xacro:property name="control_mode" value="${eci_config_dict['robot_manager']['ros__parameters']['control_mode']}" />
<xacro:property name="client_ip" value="${eci_config_dict['robot_manager']['ros__parameters']['client_ip']}" />
<xacro:property name="controller_ip" value="${eci_config_dict['robot_manager']['ros__parameters']['controller_ip']}" />

<!-- Read QoS profile parameters -->
<xacro:property name="qos_config" value="$(find kuka_rox_hw_interface)/config/qos_profiles.yaml" />
<xacro:property name="qos_config_dict" value="${xacro.load_yaml(qos_config)}"/>
<xacro:property name="consequent_lost_packets" value="${qos_config_dict['rt_packet_loss_profile']['consequent_lost_packets']}" />
<xacro:property name="lost_packets_in_timeframe" value="${qos_config_dict['rt_packet_loss_profile']['lost_packets_in_timeframe']}" />
<xacro:property name="timeframe_ms" value="${qos_config_dict['rt_packet_loss_profile']['timeframe_ms']}" />

<plugin>kuka_rox::KukaRoXHardwareInterface</plugin>
<param name="client_ip">${client_ip}</param>
<param name="controller_ip">${controller_ip}</param>
Expand Down
13 changes: 5 additions & 8 deletions kuka_resources/config/view_6_axis_urdf.rviz
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ Panels:
Name: Displays
Property Tree Widget:
Expanded:
- /Global Options1
- /Status1
- /RobotModel1
- /TF1
Splitter Ratio: 0.5
Tree Height: 1017
Tree Height: 661
- Class: rviz_common/Selection
Name: Selection
- Class: rviz_common/Tool Properties
Expand Down Expand Up @@ -239,16 +236,16 @@ Visualization Manager:
Window Geometry:
Displays:
collapsed: false
Height: 1246
Height: 890
Hide Left Dock: false
Hide Right Dock: false
QMainWindow State: 000000ff00000000fd0000000400000000000002ca00000484fc020000000afb0000001200530065006c0065006300740069006f006e000000003d000003b90000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d00000484000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb000000280020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000000000000000fb00000012004c0069006e006500500061006e0065006c010000003b000002ff0000000000000000000000010000010f000002fffc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003b000002ff000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073d00000044fc0100000002fb0000000800540069006d006501000000000000073d0000000000000000fb0000000800540069006d006501000000000000045000000000000000000000030e0000048400000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
QMainWindow State: 000000ff00000000fd0000000400000000000002ca00000320fc020000000afb0000001200530065006c0065006300740069006f006e000000003d000003b90000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d00000320000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb000000280020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000000000000000fb00000012004c0069006e006500500061006e0065006c010000003b000002ff0000000000000000000000010000010f000002fffc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003b000002ff000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073d00000044fc0100000002fb0000000800540069006d006501000000000000073d0000000000000000fb0000000800540069006d006501000000000000045000000000000000000000046a0000032000000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
Selection:
collapsed: false
Tool Properties:
collapsed: false
Views:
collapsed: false
Width: 1502
X: 74
Width: 1850
X: 70
Y: 27

0 comments on commit 73c410c

Please sign in to comment.