Skip to content

Commit 0ce0997

Browse files
committed
gz_sim対応
1 parent bd9f909 commit 0ce0997

File tree

3 files changed

+72
-59
lines changed

3 files changed

+72
-59
lines changed

crane_x7_gazebo/gui/gui.config

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828

2929
<!-- 3D scene -->
3030
<plugin filename="MinimalScene" name="3D View">
31-
<ignition-gui>
31+
<gz-gui>
3232
<title>3D View</title>
3333
<property type="bool" key="showTitleBar">false</property>
3434
<property type="string" key="state">docked</property>
35-
</ignition-gui>
35+
</gz-gui>
3636

3737
<engine>ogre2</engine>
3838
<scene>scene</scene>
@@ -43,82 +43,82 @@
4343

4444
<!-- Plugins that add functionality to the scene -->
4545
<plugin filename="EntityContextMenuPlugin" name="Entity context menu">
46-
<ignition-gui>
46+
<gz-gui>
4747
<property key="state" type="string">floating</property>
4848
<property key="width" type="double">5</property>
4949
<property key="height" type="double">5</property>
5050
<property key="showTitleBar" type="bool">false</property>
51-
</ignition-gui>
51+
</gz-gui>
5252
</plugin>
5353
<plugin filename="GzSceneManager" name="Scene Manager">
54-
<ignition-gui>
54+
<gz-gui>
5555
<property key="resizable" type="bool">false</property>
5656
<property key="width" type="double">5</property>
5757
<property key="height" type="double">5</property>
5858
<property key="state" type="string">floating</property>
5959
<property key="showTitleBar" type="bool">false</property>
60-
</ignition-gui>
60+
</gz-gui>
6161
</plugin>
6262
<plugin filename="InteractiveViewControl" name="Interactive view control">
63-
<ignition-gui>
63+
<gz-gui>
6464
<property key="resizable" type="bool">false</property>
6565
<property key="width" type="double">5</property>
6666
<property key="height" type="double">5</property>
6767
<property key="state" type="string">floating</property>
6868
<property key="showTitleBar" type="bool">false</property>
69-
</ignition-gui>
69+
</gz-gui>
7070
</plugin>
7171
<plugin filename="CameraTracking" name="Camera Tracking">
72-
<ignition-gui>
72+
<gz-gui>
7373
<property key="resizable" type="bool">false</property>
7474
<property key="width" type="double">5</property>
7575
<property key="height" type="double">5</property>
7676
<property key="state" type="string">floating</property>
7777
<property key="showTitleBar" type="bool">false</property>
78-
</ignition-gui>
78+
</gz-gui>
7979
</plugin>
8080
<plugin filename="MarkerManager" name="Marker manager">
81-
<ignition-gui>
81+
<gz-gui>
8282
<property key="resizable" type="bool">false</property>
8383
<property key="width" type="double">5</property>
8484
<property key="height" type="double">5</property>
8585
<property key="state" type="string">floating</property>
8686
<property key="showTitleBar" type="bool">false</property>
87-
</ignition-gui>
87+
</gz-gui>
8888
</plugin>
8989
<plugin filename="SelectEntities" name="Select Entities">
90-
<ignition-gui>
90+
<gz-gui>
9191
<property key="resizable" type="bool">false</property>
9292
<property key="width" type="double">5</property>
9393
<property key="height" type="double">5</property>
9494
<property key="state" type="string">floating</property>
9595
<property key="showTitleBar" type="bool">false</property>
96-
</ignition-gui>
96+
</gz-gui>
9797
</plugin>
9898

9999
<plugin filename="Spawn" name="Spawn Entities">
100-
<ignition-gui>
100+
<gz-gui>
101101
<property key="resizable" type="bool">false</property>
102102
<property key="width" type="double">5</property>
103103
<property key="height" type="double">5</property>
104104
<property key="state" type="string">floating</property>
105105
<property key="showTitleBar" type="bool">false</property>
106-
</ignition-gui>
106+
</gz-gui>
107107
</plugin>
108108

109109
<plugin filename="VisualizationCapabilities" name="Visualization Capabilities">
110-
<ignition-gui>
110+
<gz-gui>
111111
<property key="resizable" type="bool">false</property>
112112
<property key="width" type="double">5</property>
113113
<property key="height" type="double">5</property>
114114
<property key="state" type="string">floating</property>
115115
<property key="showTitleBar" type="bool">false</property>
116-
</ignition-gui>
116+
</gz-gui>
117117
</plugin>
118118

119119
<!-- World control -->
120120
<plugin filename="WorldControl" name="World control">
121-
<ignition-gui>
121+
<gz-gui>
122122
<title>World control</title>
123123
<property type="bool" key="showTitleBar">false</property>
124124
<property type="bool" key="resizable">false</property>
@@ -131,7 +131,7 @@
131131
<line own="left" target="left"/>
132132
<line own="bottom" target="bottom"/>
133133
</anchors>
134-
</ignition-gui>
134+
</gz-gui>
135135

136136
<play_pause>true</play_pause>
137137
<step>true</step>
@@ -142,7 +142,7 @@
142142

143143
<!-- World statistics -->
144144
<plugin filename="WorldStats" name="World stats">
145-
<ignition-gui>
145+
<gz-gui>
146146
<title>World stats</title>
147147
<property type="bool" key="showTitleBar">false</property>
148148
<property type="bool" key="resizable">false</property>
@@ -155,7 +155,7 @@
155155
<line own="right" target="right"/>
156156
<line own="bottom" target="bottom"/>
157157
</anchors>
158-
</ignition-gui>
158+
</gz-gui>
159159

160160
<sim_time>true</sim_time>
161161
<real_time>true</real_time>
@@ -165,7 +165,7 @@
165165

166166
<!-- Insert simple shapes -->
167167
<plugin filename="Shapes" name="Shapes">
168-
<ignition-gui>
168+
<gz-gui>
169169
<property key="resizable" type="bool">false</property>
170170
<property key="x" type="double">0</property>
171171
<property key="y" type="double">0</property>
@@ -174,12 +174,12 @@
174174
<property key="state" type="string">floating</property>
175175
<property key="showTitleBar" type="bool">false</property>
176176
<property key="cardBackground" type="string">#666666</property>
177-
</ignition-gui>
177+
</gz-gui>
178178
</plugin>
179179

180180
<!-- Insert lights -->
181181
<plugin filename="Lights" name="Lights">
182-
<ignition-gui>
182+
<gz-gui>
183183
<property key="resizable" type="bool">false</property>
184184
<property key="x" type="double">250</property>
185185
<property key="y" type="double">0</property>
@@ -188,12 +188,12 @@
188188
<property key="state" type="string">floating</property>
189189
<property key="showTitleBar" type="bool">false</property>
190190
<property key="cardBackground" type="string">#666666</property>
191-
</ignition-gui>
191+
</gz-gui>
192192
</plugin>
193193

194194
<!-- Translate / rotate -->
195195
<plugin filename="TransformControl" name="Transform control">
196-
<ignition-gui>
196+
<gz-gui>
197197
<property key="resizable" type="bool">false</property>
198198
<property key="x" type="double">0</property>
199199
<property key="y" type="double">50</property>
@@ -202,15 +202,15 @@
202202
<property key="state" type="string">floating</property>
203203
<property key="showTitleBar" type="bool">false</property>
204204
<property key="cardBackground" type="string">#777777</property>
205-
</ignition-gui>
205+
</gz-gui>
206206

207207
<!-- disable legacy features used to connect this plugin to GzScene3D -->
208208
<legacy>false</legacy>
209209
</plugin>
210210

211211
<!-- Screenshot -->
212212
<plugin filename="Screenshot" name="Screenshot">
213-
<ignition-gui>
213+
<gz-gui>
214214
<property key="resizable" type="bool">false</property>
215215
<property key="x" type="double">250</property>
216216
<property key="y" type="double">50</property>
@@ -219,12 +219,12 @@
219219
<property key="state" type="string">floating</property>
220220
<property key="showTitleBar" type="bool">false</property>
221221
<property key="cardBackground" type="string">#777777</property>
222-
</ignition-gui>
222+
</gz-gui>
223223
</plugin>
224224

225225
<!-- Copy/Paste -->
226226
<plugin filename="CopyPaste" name="CopyPaste">
227-
<ignition-gui>
227+
<gz-gui>
228228
<property key="resizable" type="bool">false</property>
229229
<property key="x" type="double">300</property>
230230
<property key="y" type="double">50</property>
@@ -233,21 +233,21 @@
233233
<property key="state" type="string">floating</property>
234234
<property key="showTitleBar" type="bool">false</property>
235235
<property key="cardBackground" type="string">#777777</property>
236-
</ignition-gui>
236+
</gz-gui>
237237
</plugin>
238238

239239
<!-- Inspector -->
240240
<plugin filename="ComponentInspector" name="Component inspector">
241-
<ignition-gui>
241+
<gz-gui>
242242
<property type="bool" key="showTitleBar">false</property>
243243
<property type="string" key="state">docked</property>
244-
</ignition-gui>
244+
</gz-gui>
245245
</plugin>
246246

247247
<!-- Entity tree -->
248248
<plugin filename="EntityTree" name="Entity tree">
249-
<ignition-gui>
249+
<gz-gui>
250250
<property type="bool" key="showTitleBar">false</property>
251251
<property type="string" key="state">docked</property>
252-
</ignition-gui>
252+
</gz-gui>
253253
</plugin>

crane_x7_gazebo/launch/crane_x7_with_table.launch.py

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
import os
1616

1717
from ament_index_python.packages import get_package_share_directory
18-
from crane_x7_description.robot_description_loader import RobotDescriptionLoader
18+
from crane_x7_description.robot_description_loader \
19+
import RobotDescriptionLoader
1920
from launch import LaunchDescription
2021
from launch.actions import ExecuteProcess
2122
from launch.actions import IncludeLaunchDescription
@@ -26,22 +27,22 @@
2627

2728
def generate_launch_description():
2829
# PATHを追加で通さないとSTLファイルが読み込まれない
29-
env = {'IGN_GAZEBO_SYSTEM_PLUGIN_PATH': os.environ['LD_LIBRARY_PATH'],
30-
'IGN_GAZEBO_RESOURCE_PATH': os.path.dirname(
30+
env = {'GZ_SIM_SYSTEM_PLUGIN_PATH': os.environ['LD_LIBRARY_PATH'],
31+
'GZ_SIM_RESOURCE_PATH': os.path.dirname(
3132
get_package_share_directory('crane_x7_description'))}
3233
world_file = os.path.join(
3334
get_package_share_directory('crane_x7_gazebo'), 'worlds', 'table.sdf')
3435
gui_config = os.path.join(
3536
get_package_share_directory('crane_x7_gazebo'), 'gui', 'gui.config')
3637
# -r オプションで起動時にシミュレーションをスタートしないと、コントローラが起動しない
37-
ign_gazebo = ExecuteProcess(
38-
cmd=['ign gazebo -r', world_file, '--gui-config', gui_config],
38+
gz_sim = ExecuteProcess(
39+
cmd=['gz sim -r', world_file, '--gui-config', gui_config],
3940
output='screen',
4041
additional_env=env,
4142
shell=True
4243
)
4344

44-
ignition_spawn_entity = Node(
45+
gazebo_spawn_entity = Node(
4546
package='ros_gz_sim',
4647
executable='create',
4748
output='screen',
@@ -54,7 +55,8 @@ def generate_launch_description():
5455
description_loader = RobotDescriptionLoader()
5556
description_loader.use_gazebo = 'true'
5657
description_loader.gz_control_config_package = 'crane_x7_control'
57-
description_loader.gz_control_config_file_path = 'config/crane_x7_controllers.yaml'
58+
description_loader.gz_control_config_file_path = \
59+
'config/crane_x7_controllers.yaml'
5860
description = description_loader.load()
5961

6062
move_group = IncludeLaunchDescription(
@@ -65,34 +67,45 @@ def generate_launch_description():
6567
)
6668

6769
spawn_joint_state_controller = ExecuteProcess(
68-
cmd=['ros2 run controller_manager spawner joint_state_controller'],
70+
cmd=[
71+
'ros2 run controller_manager spawner '
72+
'joint_state_controller'
73+
],
6974
shell=True,
7075
output='screen',
7176
)
7277

7378
spawn_arm_controller = ExecuteProcess(
74-
cmd=['ros2 run controller_manager spawner crane_x7_arm_controller'],
79+
cmd=[
80+
'ros2 run controller_manager spawner '
81+
'crane_x7_arm_controller'
82+
],
7583
shell=True,
7684
output='screen',
7785
)
7886

7987
spawn_gripper_controller = ExecuteProcess(
80-
cmd=['ros2 run controller_manager spawner crane_x7_gripper_controller'],
88+
cmd=[
89+
'ros2 run controller_manager spawner '
90+
'crane_x7_gripper_controller'
91+
],
8192
shell=True,
8293
output='screen',
8394
)
8495

8596
bridge = Node(
8697
package='ros_gz_bridge',
8798
executable='parameter_bridge',
88-
arguments=['/clock@rosgraph_msgs/msg/Clock[ignition.msgs.Clock'],
99+
arguments=[
100+
'/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock',
101+
],
89102
output='screen'
90103
)
91104

92105
return LaunchDescription([
93106
SetParameter(name='use_sim_time', value=True),
94-
ign_gazebo,
95-
ignition_spawn_entity,
107+
gz_sim,
108+
gazebo_spawn_entity,
96109
move_group,
97110
spawn_joint_state_controller,
98111
spawn_arm_controller,

crane_x7_gazebo/worlds/table.sdf

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,40 @@
66
<real_time_factor>1.0</real_time_factor>
77
</physics>
88
<plugin
9-
filename="ignition-gazebo-physics-system"
10-
name="ignition::gazebo::systems::Physics">
9+
filename="gz-sim-physics-system"
10+
name="gz::sim::systems::Physics">
1111
</plugin>
1212
<plugin
13-
filename="ignition-gazebo-user-commands-system"
14-
name="ignition::gazebo::systems::UserCommands">
13+
filename="gz-sim-user-commands-system"
14+
name="gz::sim::systems::UserCommands">
1515
</plugin>
1616
<plugin
17-
filename="ignition-gazebo-scene-broadcaster-system"
18-
name="ignition::gazebo::systems::SceneBroadcaster">
17+
filename="gz-sim-scene-broadcaster-system"
18+
name="gz::sim::systems::SceneBroadcaster">
1919
</plugin>
2020

2121
<include>
2222
<uri>
23-
https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Sun
23+
https://fuel.gazebosim.org/1.0/OpenRobotics/models/Sun
2424
</uri>
2525
</include>
2626

2727
<include>
2828
<uri>
29-
https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Ground%20Plane
29+
https://fuel.gazebosim.org/1.0/OpenRobotics/models/Ground%20Plane
3030
</uri>
3131
</include>
3232

3333
<include>
3434
<uri>
35-
https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Table
35+
https://fuel.gazebosim.org/1.0/OpenRobotics/models/Table
3636
</uri>
3737
<pose>0.29 0 0 0 0 1.5708</pose>
3838
</include>
3939

4040
<include>
4141
<uri>
42-
https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Wood%20cube%205cm
42+
https://fuel.gazebosim.org/1.0/OpenRobotics/models/Wood%20cube%205cm
4343
</uri>
4444
<pose>0.20 0 1.0 0 0 0</pose>
4545
</include>

0 commit comments

Comments
 (0)