-
Notifications
You must be signed in to change notification settings - Fork 0
/
view_robot.launch.py
55 lines (47 loc) · 1.65 KB
/
view_robot.launch.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from launch import LaunchDescription
from launch.substitutions import Command, FindExecutable, PathJoinSubstitution
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
from launch_ros.descriptions import ParameterValue
def generate_launch_description():
# Get robot description via xacro
daVinciCore_description = {
"robot_description": ParameterValue(
Command([
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution(
[FindPackageShare("davinci_core_description"), "urdf", "daVinci.urdf.xacro"]),
]),
value_type=str
)
}
# For robot_state_publisher Node
robot_state_publisher_node = Node(
package="robot_state_publisher",
executable="robot_state_publisher",
parameters=[daVinciCore_description]
)
# For joint_state_publisher_gui Node
joint_state_publisher_gui_node = Node(
package="joint_state_publisher_gui",
executable="joint_state_publisher_gui",
name="joint_state_publisher_gui",
parameters=[daVinciCore_description]
)
# For rviz2 Node
davinci_core_rviz_file = PathJoinSubstitution(
[FindPackageShare("davinci_core_description"), "rviz", "davinci_core_description.rviz"]
)
# For rviz2 Node
rviz_node = Node(
package="rviz2",
executable="rviz2",
name="rviz2",
arguments=["-d", davinci_core_rviz_file],
)
return LaunchDescription([
robot_state_publisher_node,
joint_state_publisher_gui_node,
rviz_node
])