Skip to content

Commit

Permalink
gz_sim対応(crane_plus_gazeboパッケージ)
Browse files Browse the repository at this point in the history
  • Loading branch information
mizonon committed Nov 26, 2024
1 parent d6a4e16 commit d0fa64a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 32 deletions.
32 changes: 16 additions & 16 deletions crane_plus_gazebo/gui/gui.config
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@

<!-- 3D scene -->
<plugin filename="GzScene3D" name="3D View">
<ignition-gui>
<gz-gui>
<title>3D View</title>
<property type="bool" key="showTitleBar">false</property>
<property type="string" key="state">docked</property>
</ignition-gui>
</gz-gui>

<engine>ogre2</engine>
<scene>scene</scene>
Expand All @@ -43,7 +43,7 @@

<!-- Play / pause / step -->
<plugin filename="WorldControl" name="World control">
<ignition-gui>
<gz-gui>
<title>World control</title>
<property type="bool" key="showTitleBar">false</property>
<property type="bool" key="resizable">false</property>
Expand All @@ -56,7 +56,7 @@
<line own="left" target="left"/>
<line own="bottom" target="bottom"/>
</anchors>
</ignition-gui>
</gz-gui>

<play_pause>true</play_pause>
<step>true</step>
Expand All @@ -66,7 +66,7 @@

<!-- Time / RTF -->
<plugin filename="WorldStats" name="World stats">
<ignition-gui>
<gz-gui>
<title>World stats</title>
<property type="bool" key="showTitleBar">false</property>
<property type="bool" key="resizable">false</property>
Expand All @@ -79,7 +79,7 @@
<line own="right" target="right"/>
<line own="bottom" target="bottom"/>
</anchors>
</ignition-gui>
</gz-gui>

<sim_time>true</sim_time>
<real_time>true</real_time>
Expand All @@ -90,7 +90,7 @@

<!-- Translate / rotate -->
<plugin filename="TransformControl" name="Transform control">
<ignition-gui>
<gz-gui>
<property key="resizable" type="bool">false</property>
<property key="x" type="double">0</property>
<property key="y" type="double">0</property>
Expand All @@ -99,12 +99,12 @@
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
<property key="cardBackground" type="string">#666666</property>
</ignition-gui>
</gz-gui>
</plugin>

<!-- Insert simple shapes -->
<plugin filename="Shapes" name="Shapes">
<ignition-gui>
<gz-gui>
<property key="resizable" type="bool">false</property>
<property key="x" type="double">250</property>
<property key="y" type="double">0</property>
Expand All @@ -113,12 +113,12 @@
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
<property key="cardBackground" type="string">#666666</property>
</ignition-gui>
</gz-gui>
</plugin>

<!-- Screenshot -->
<plugin filename="Screenshot" name="Screenshot">
<ignition-gui>
<gz-gui>
<property key="resizable" type="bool">false</property>
<property key="x" type="double">400</property>
<property key="y" type="double">0</property>
Expand All @@ -127,21 +127,21 @@
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
<property key="cardBackground" type="string">#666666</property>
</ignition-gui>
</gz-gui>
</plugin>

<!-- Inspector -->
<plugin filename="ComponentInspector" name="Component inspector">
<ignition-gui>
<gz-gui>
<property type="bool" key="showTitleBar">false</property>
<property type="string" key="state">docked</property>
</ignition-gui>
</gz-gui>
</plugin>

<!-- Entity tree -->
<plugin filename="EntityTree" name="Entity tree">
<ignition-gui>
<gz-gui>
<property type="bool" key="showTitleBar">false</property>
<property type="string" key="state">docked</property>
</ignition-gui>
</gz-gui>
</plugin>
12 changes: 6 additions & 6 deletions crane_plus_gazebo/launch/crane_plus_with_table.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@

def generate_launch_description():
# PATHを追加で通さないとSTLファイルが読み込まれない
env = {'IGN_GAZEBO_SYSTEM_PLUGIN_PATH': os.environ['LD_LIBRARY_PATH'],
'IGN_GAZEBO_RESOURCE_PATH': os.path.dirname(
env = {'GZ_SIM_SYSTEM_PLUGIN_PATH': os.environ['LD_LIBRARY_PATH'],
'GZ_SIM_RESOURCE_PATH': os.path.dirname(
get_package_share_directory('crane_plus_description'))}
world_file = os.path.join(
get_package_share_directory('crane_plus_gazebo'), 'worlds', 'table.sdf')
gui_config = os.path.join(
get_package_share_directory('crane_plus_gazebo'), 'gui', 'gui.config')
# -r オプションで起動時にシミュレーションをスタートしないと、コントローラが起動しない
ign_gazebo = ExecuteProcess(
cmd=['ign gazebo -r', world_file, '--gui-config', gui_config],
gz_sim = ExecuteProcess(
cmd=['gz sim -r', world_file, '--gui-config', gui_config],
output='screen',
additional_env=env,
shell=True
Expand Down Expand Up @@ -86,13 +86,13 @@ def generate_launch_description():
bridge = Node(
package='ros_gz_bridge',
executable='parameter_bridge',
arguments=['/clock@rosgraph_msgs/msg/Clock[ignition.msgs.Clock'],
arguments=['/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock'],
output='screen'
)

return LaunchDescription([
SetParameter(name='use_sim_time', value=True),
ign_gazebo,
gz_sim,
gazebo_spawn_entity,
move_group,
spawn_joint_state_controller,
Expand Down
20 changes: 10 additions & 10 deletions crane_plus_gazebo/worlds/table.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,40 @@
<real_time_factor>1.0</real_time_factor>
</physics>
<plugin
filename="ignition-gazebo-physics-system"
name="ignition::gazebo::systems::Physics">
filename="gz-sim-physics-system"
name="gz::sim::systems::Physics">
</plugin>
<plugin
filename="ignition-gazebo-user-commands-system"
name="ignition::gazebo::systems::UserCommands">
filename="gz-sim-user-commands-system"
name="gz::sim::systems::UserCommands">
</plugin>
<plugin
filename="ignition-gazebo-scene-broadcaster-system"
name="ignition::gazebo::systems::SceneBroadcaster">
filename="gz-sim-scene-broadcaster-system"
name="gz::sim::systems::SceneBroadcaster">
</plugin>

<include>
<uri>
https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Sun
https://fuel.gazebosim.org/1.0/OpenRobotics/models/Sun
</uri>
</include>

<include>
<uri>
https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Ground%20Plane
https://fuel.gazebosim.org/1.0/OpenRobotics/models/Ground%20Plane
</uri>
</include>

<include>
<uri>
https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Table
https://fuel.gazebosim.org/1.0/OpenRobotics/models/Table
</uri>
<pose>0.29 0 0 0 0 1.5708</pose>
</include>

<include>
<uri>
https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Wood%20cube%205cm
https://fuel.gazebosim.org/1.0/OpenRobotics/models/Wood%20cube%205cm
</uri>
<pose>0 -0.1 1.0 0 0 0</pose>
</include>
Expand Down

0 comments on commit d0fa64a

Please sign in to comment.