Skip to content

Commit 0c49a37

Browse files
committed
added view robot launch sample
1 parent fb53205 commit 0c49a37

File tree

5 files changed

+279
-1
lines changed

5 files changed

+279
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ find_package(ament_cmake REQUIRED)
1010

1111
# install
1212
install(
13-
DIRECTORY config meshes urdf
13+
DIRECTORY config launch meshes rviz urdf
1414
DESTINATION share/${PROJECT_NAME}
1515
)
1616

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# KUKA LBR IIWA 7 Description
2+
Launch an example using
3+
4+
```shell
5+
ros2 launch \
6+
iiwa7_description \
7+
view_robot.launch.py
8+
```

launch/view_robot.launch.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
from launch import LaunchDescription
2+
from launch.actions import DeclareLaunchArgument
3+
from launch.substitutions import (
4+
Command,
5+
FindExecutable,
6+
LaunchConfiguration,
7+
PathSubstitution,
8+
)
9+
from launch_ros.actions import Node
10+
from launch_ros.substitutions import FindPackageShare
11+
12+
13+
def generate_launch_description() -> LaunchDescription:
14+
return LaunchDescription(
15+
[
16+
DeclareLaunchArgument(
17+
name="robot_name",
18+
default_value="lbr",
19+
description="The robot's name. Links in the tf tree will be prefixed as <robot_name>_link. Same applies to joints.",
20+
),
21+
Node(
22+
package="robot_state_publisher",
23+
executable="robot_state_publisher",
24+
name="robot_state_publisher",
25+
output="screen",
26+
parameters=[
27+
{
28+
"robot_description": Command(
29+
[
30+
FindExecutable(name="xacro"),
31+
" ",
32+
PathSubstitution(FindPackageShare("iiwa7_description"))
33+
/ "urdf"
34+
/ "iiwa7.urdf.xacro",
35+
" robot_name:=",
36+
LaunchConfiguration("robot_name"),
37+
]
38+
)
39+
},
40+
],
41+
),
42+
Node(
43+
package="joint_state_publisher_gui",
44+
executable="joint_state_publisher_gui",
45+
name="joint_state_publisher_gui",
46+
output="screen",
47+
),
48+
Node(
49+
package="rviz2",
50+
executable="rviz2",
51+
name="rviz2",
52+
output="screen",
53+
arguments=[
54+
[
55+
"-d",
56+
PathSubstitution(FindPackageShare("iiwa7_description"))
57+
/ "rviz"
58+
/ "view_robot.rviz",
59+
]
60+
],
61+
),
62+
]
63+
)

package.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99

1010
<buildtool_depend>ament_cmake</buildtool_depend>
1111

12+
<exec_depend>joint_state_publisher_gui</exec_depend>
13+
<exec_depend>launch_ros</exec_depend>
14+
<exec_depend>robot_state_publisher</exec_depend>
15+
<exec_depend>rviz2</exec_depend>
16+
1217
<export>
1318
<build_type>ament_cmake</build_type>
1419
</export>

rviz/view_robot.rviz

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
Panels:
2+
- Class: rviz_common/Displays
3+
Help Height: 78
4+
Name: Displays
5+
Property Tree Widget:
6+
Expanded:
7+
- /Global Options1
8+
Splitter Ratio: 0.5
9+
Tree Height: 544
10+
- Class: rviz_common/Selection
11+
Name: Selection
12+
- Class: rviz_common/Tool Properties
13+
Expanded:
14+
- /2D Goal Pose1
15+
- /Publish Point1
16+
Name: Tool Properties
17+
Splitter Ratio: 0.5886790156364441
18+
- Class: rviz_common/Views
19+
Expanded:
20+
- /Current View1
21+
Name: Views
22+
Splitter Ratio: 0.5
23+
- Class: rviz_common/Time
24+
Experimental: false
25+
Name: Time
26+
SyncMode: 0
27+
SyncSource: ""
28+
Visualization Manager:
29+
Class: ""
30+
Displays:
31+
- Alpha: 0.5
32+
Cell Size: 1
33+
Class: rviz_default_plugins/Grid
34+
Color: 160; 160; 164
35+
Enabled: true
36+
Line Style:
37+
Line Width: 0.029999999329447746
38+
Value: Lines
39+
Name: Grid
40+
Normal Cell Count: 0
41+
Offset:
42+
X: 0
43+
Y: 0
44+
Z: 0
45+
Plane: XY
46+
Plane Cell Count: 10
47+
Reference Frame: <Fixed Frame>
48+
Value: true
49+
- Alpha: 1
50+
Class: rviz_default_plugins/RobotModel
51+
Collision Enabled: false
52+
Description File: ""
53+
Description Source: Topic
54+
Description Topic:
55+
Depth: 5
56+
Durability Policy: Volatile
57+
History Policy: Keep Last
58+
Reliability Policy: Reliable
59+
Value: /robot_description
60+
Enabled: true
61+
Links:
62+
All Links Enabled: true
63+
Expand Joint Details: false
64+
Expand Link Details: false
65+
Expand Tree: false
66+
Link Tree Style: Links in Alphabetic Order
67+
lbr_link_0:
68+
Alpha: 1
69+
Show Axes: false
70+
Show Trail: false
71+
Value: true
72+
lbr_link_1:
73+
Alpha: 1
74+
Show Axes: false
75+
Show Trail: false
76+
Value: true
77+
lbr_link_2:
78+
Alpha: 1
79+
Show Axes: false
80+
Show Trail: false
81+
Value: true
82+
lbr_link_3:
83+
Alpha: 1
84+
Show Axes: false
85+
Show Trail: false
86+
Value: true
87+
lbr_link_4:
88+
Alpha: 1
89+
Show Axes: false
90+
Show Trail: false
91+
Value: true
92+
lbr_link_5:
93+
Alpha: 1
94+
Show Axes: false
95+
Show Trail: false
96+
Value: true
97+
lbr_link_6:
98+
Alpha: 1
99+
Show Axes: false
100+
Show Trail: false
101+
Value: true
102+
lbr_link_7:
103+
Alpha: 1
104+
Show Axes: false
105+
Show Trail: false
106+
Value: true
107+
lbr_link_ee:
108+
Alpha: 1
109+
Show Axes: false
110+
Show Trail: false
111+
Mass Properties:
112+
Inertia: false
113+
Mass: false
114+
Name: RobotModel
115+
TF Prefix: ""
116+
Update Interval: 0
117+
Value: true
118+
Visual Enabled: true
119+
Enabled: true
120+
Global Options:
121+
Background Color: 48; 48; 48
122+
Fixed Frame: lbr_link_0
123+
Frame Rate: 30
124+
Name: root
125+
Tools:
126+
- Class: rviz_default_plugins/Interact
127+
Hide Inactive Objects: true
128+
- Class: rviz_default_plugins/MoveCamera
129+
- Class: rviz_default_plugins/Select
130+
- Class: rviz_default_plugins/FocusCamera
131+
- Class: rviz_default_plugins/Measure
132+
Line color: 128; 128; 0
133+
- Class: rviz_default_plugins/SetInitialPose
134+
Covariance x: 0.25
135+
Covariance y: 0.25
136+
Covariance yaw: 0.06853891909122467
137+
Topic:
138+
Depth: 5
139+
Durability Policy: Volatile
140+
History Policy: Keep Last
141+
Reliability Policy: Reliable
142+
Value: /initialpose
143+
- Class: rviz_default_plugins/SetGoal
144+
Topic:
145+
Depth: 5
146+
Durability Policy: Volatile
147+
History Policy: Keep Last
148+
Reliability Policy: Reliable
149+
Value: /goal_pose
150+
- Class: rviz_default_plugins/PublishPoint
151+
Single click: true
152+
Topic:
153+
Depth: 5
154+
Durability Policy: Volatile
155+
History Policy: Keep Last
156+
Reliability Policy: Reliable
157+
Value: /clicked_point
158+
Transformation:
159+
Current:
160+
Class: rviz_default_plugins/TF
161+
Value: true
162+
Views:
163+
Current:
164+
Class: rviz_default_plugins/Orbit
165+
Distance: 3.3154795169830322
166+
Enable Stereo Rendering:
167+
Stereo Eye Separation: 0.05999999865889549
168+
Stereo Focal Distance: 1
169+
Swap Stereo Eyes: false
170+
Value: false
171+
Focal Point:
172+
X: -0.07972976565361023
173+
Y: -0.08040270209312439
174+
Z: 0.30934226512908936
175+
Focal Shape Fixed Size: true
176+
Focal Shape Size: 0.05000000074505806
177+
Invert Z Axis: false
178+
Name: Current View
179+
Near Clip Distance: 0.009999999776482582
180+
Pitch: 0.375398188829422
181+
Target Frame: <Fixed Frame>
182+
Value: Orbit (rviz)
183+
Yaw: 1.0853984355926514
184+
Saved: ~
185+
Window Geometry:
186+
Displays:
187+
collapsed: false
188+
Height: 835
189+
Hide Left Dock: false
190+
Hide Right Dock: false
191+
QMainWindow State: 000000ff00000000fd000000040000000000000163000002bdfc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006200fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000002c000002bd000000e300fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f000002bdfc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000002c000002bd000000c600fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004b00000003efc0100000002fb0000000800540069006d00650100000000000004b00000023f00fffffffb0000000800540069006d006501000000000000045000000000000000000000023c000002bd00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
192+
Selection:
193+
collapsed: false
194+
Time:
195+
collapsed: false
196+
Tool Properties:
197+
collapsed: false
198+
Views:
199+
collapsed: false
200+
Width: 1200
201+
X: 60
202+
Y: 33

0 commit comments

Comments
 (0)