Skip to content

Commit a468bde

Browse files
combofox display fixed
1 parent d5d6dc9 commit a468bde

5 files changed

Lines changed: 163 additions & 55 deletions

File tree

launch/combofox_display.launch.py

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# @brief Launch file for visualizing the models of the combofox robot
2+
#
3+
# @author Mattia Dei Rossi <mattia.deirossi@innobotics.it>
4+
# @copyright (C) IBT
5+
6+
7+
import os
8+
9+
from ament_index_python.packages import get_package_share_directory
10+
from launch import LaunchDescription
11+
from launch.substitutions import Command, FindExecutable, LaunchConfiguration
12+
from launch_ros.actions import Node
13+
from launch.actions import DeclareLaunchArgument
14+
15+
def generate_launch_description():
16+
declared_arguments = []
17+
declared_arguments.append(
18+
DeclareLaunchArgument(
19+
"arm_type",
20+
description="Type/series of used IBT robot.",
21+
choices=["robofox_61814v3"],
22+
default_value="robofox_61814v3",
23+
)
24+
)
25+
declared_arguments.append(
26+
DeclareLaunchArgument(
27+
"arm_prefix",
28+
default_value='robofox',
29+
description="Prefix of the joint names, useful for multi-robot setup."
30+
)
31+
)
32+
33+
arm_type = LaunchConfiguration("arm_type")
34+
arm_prefix = LaunchConfiguration("arm_prefix")
35+
36+
pkg_dir = get_package_share_directory('ibt_ros2_description')
37+
38+
# Configuration files
39+
xacro_file = os.path.join(pkg_dir, 'xacro', 'combofox/combofox.urdf.xacro')
40+
robot_description = Command([FindExecutable(name='xacro'),
41+
' ', xacro_file,
42+
' ', 'arm_type:=', arm_type,
43+
' ', 'arm_prefix:=', arm_prefix
44+
])
45+
rviz_config_path = os.path.join(pkg_dir, 'config', 'config.rviz')
46+
47+
# Nodes
48+
robot_state_publisher_node = Node(
49+
name='robot_state_publisher',
50+
package='robot_state_publisher',
51+
executable='robot_state_publisher',
52+
output='screen',
53+
parameters=[
54+
{'robot_description': robot_description}
55+
]
56+
)
57+
58+
joint_state_publisher_gui_node = Node(
59+
package='joint_state_publisher_gui',
60+
executable='joint_state_publisher_gui'
61+
)
62+
rviz_node = Node(
63+
package='rviz2',
64+
executable='rviz2',
65+
name='rviz2',
66+
output='screen',
67+
arguments=[
68+
'-d', rviz_config_path
69+
]
70+
)
71+
nodes = [
72+
robot_state_publisher_node,
73+
joint_state_publisher_gui_node,
74+
rviz_node
75+
]
76+
77+
return LaunchDescription(declared_arguments + nodes)

launch/robofox_display.launch.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,31 @@ def generate_launch_description():
1616
declared_arguments = []
1717
declared_arguments.append(
1818
DeclareLaunchArgument(
19-
"robofox_type",
19+
"arm_type",
2020
description="Type/series of used IBT robot.",
2121
choices=["robofox_61814v3"],
2222
default_value="robofox_61814v3",
2323
)
2424
)
2525
declared_arguments.append(
2626
DeclareLaunchArgument(
27-
"prefix",
27+
"arm_prefix",
2828
default_value='robofox',
2929
description="Prefix of the joint names, useful for multi-robot setup."
3030
)
3131
)
3232

33-
robofox_type = LaunchConfiguration("robofox_type")
34-
prefix = LaunchConfiguration("prefix")
33+
arm_type = LaunchConfiguration("arm_type")
34+
arm_prefix = LaunchConfiguration("arm_prefix")
3535

3636
pkg_dir = get_package_share_directory('ibt_ros2_description')
3737

3838
# Configuration files
3939
xacro_file = os.path.join(pkg_dir, 'xacro', 'robofox/robofox.urdf.xacro')
4040
robot_description = Command([FindExecutable(name='xacro'),
4141
' ', xacro_file,
42-
' ', 'name:=robofox',
43-
' ', 'robofox_type:=', robofox_type,
44-
' ', 'prefix:=', prefix
42+
' ', 'arm_type:=', arm_type,
43+
' ', 'arm_prefix:=', arm_prefix
4544
])
4645
rviz_config_path = os.path.join(pkg_dir, 'config', 'config.rviz')
4746

xacro/combofox/combofox.urdf.xacro

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="amr">
3+
4+
<!-- Arguments for robofox -->
5+
<xacro:arg name="arm_prefix" default="robofox" />
6+
<xacro:arg name="arm_type" default="robofox_61814v3" />
7+
<xacro:arg name="physical_params_file"
8+
default="$(find ibt_ros2_description)/config/$(arg arm_type)/physical_parameters.yaml" />
9+
<xacro:arg name="joint_limits_file"
10+
default="$(find ibt_ros2_description)/config/$(arg arm_type)/joint_limits.yaml" />
11+
12+
<!-- Amr combo base -->
13+
<xacro:include filename="$(find ibt_ros2_description)/xacro/amr/amr.xacro" />
14+
<!-- Robotic arm -->
15+
<xacro:include filename="$(find ibt_ros2_description)/xacro/robofox/robofox.xacro" />
16+
17+
<!-- Instances -->
18+
<xacro:amr name="base_footprint" parent="base_link">
19+
<origin xyz="0 0 0" rpy="0 0 0" />
20+
</xacro:amr>
21+
22+
<xacro:robofox
23+
arm_prefix="robofox"
24+
physical_params_file="$(arg physical_params_file)"
25+
joint_limits_file="$(arg joint_limits_file)"
26+
arm_type="$(arg arm_type)"
27+
connected_to="agv_link1"
28+
>
29+
<origin xyz="0 0 0" rpy="0 0 ${pi/2}" />
30+
</xacro:robofox>
31+
32+
</robot>

xacro/robofox/robofox.urdf.xacro

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<?xml version="1.0"?>
22
<robot xmlns:xacro="http://wiki.ros.org/xacro" name="robofox">
33

4-
<xacro:arg name="prefix" default="robofox" />
5-
<xacro:arg name="robofox_type" default="robofox_61814v3" />
4+
<xacro:arg name="arm_prefix" default="robofox" />
5+
<xacro:arg name="arm_type" default="robofox_61814v3" />
66
<xacro:arg name="physical_params_file"
7-
default="$(find ibt_ros2_description)/config/$(arg robofox_type)/physical_parameters.yaml" />
7+
default="$(find ibt_ros2_description)/config/$(arg arm_type)/physical_parameters.yaml" />
88
<xacro:arg name="joint_limits_file"
9-
default="$(find ibt_ros2_description)/config/$(arg robofox_type)/joint_limits.yaml" />
9+
default="$(find ibt_ros2_description)/config/$(arg arm_type)/joint_limits.yaml" />
1010

1111
<xacro:include filename="$(find ibt_ros2_description)/xacro/robofox/robofox.xacro" />
1212

1313
<xacro:robofox
14-
prefix="$(arg prefix)"
14+
arm_prefix="$(arg arm_prefix)"
1515
physical_params_file="$(arg physical_params_file)"
1616
joint_limits_file="$(arg joint_limits_file)"
17-
robofox_type="$(arg robofox_type)"
17+
arm_type="$(arg arm_type)"
1818
>
1919
<origin xyz="0 0 0" rpy="0 0 0" />
2020
</xacro:robofox>

0 commit comments

Comments
 (0)