Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions walk_bot/launch/gazebo.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def generate_launch_description():
name='world',
description='Path to the world file to open.',
default_value=PathJoinSubstitution(
[FindPackageShare('walk_bot'), 'world', 'empty.sdf']))
[FindPackageShare('walk_bot'), 'world', 'empty_walk_bot.sdf']))

gui_config_arg = DeclareLaunchArgument(
name='gui_config',
Expand Down Expand Up @@ -73,8 +73,8 @@ def generate_launch_description():
'gz_args': [
'-r ', # Run simulation on start.
LaunchConfiguration('world'),
' --gui-config ',
LaunchConfiguration('gui_config'),
' --gui-config ', LaunchConfiguration('gui_config'),
' -v', '4', # Increase log level to debug
]
}.items())

Expand All @@ -96,6 +96,9 @@ def generate_launch_description():
'/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock',
# Joint states (GZ -> ROS2)
'joint_states@sensor_msgs/msg/JointState[gz.msgs.Model',
# Contact sensor (GZ -> ROS2)
'l_sole_contact@ros_gz_interfaces/msg/Contacts[gz.msgs.Contacts',
'r_sole_contact@ros_gz_interfaces/msg/Contacts[gz.msgs.Contacts',
],
)

Expand All @@ -108,7 +111,7 @@ def generate_launch_description():
xacro_path_arg,
z_arg,
gazebo,
create_node,
# create_node,
bridge,
joint_command_bridge,
])
34 changes: 34 additions & 0 deletions walk_bot/urdf/walk_bot.urdf
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,41 @@
<limit effort="20.0" lower="-3.14" upper="3.14" velocity="2.0"/>
</joint>

<gazebo reference="l_sole">
<sensor name="sensor_contact" type="contact">
<contact>
<collision>l_sole_collision</collision>
<topic>/l_sole_contact</topic>
</contact>
<always_on>1</always_on>
<update_rate>100</update_rate>
<visualize>true</visualize>
<plugin
filename="ignition-gazebo-contact-system"
name="ignition::gazebo::systems::Contact"/>
</sensor>
</gazebo>

<gazebo reference="r_sole">
<sensor name="sensor_contact" type="contact">
<contact>
<collision>r_sole_collision</collision>
<topic>/r_sole_contact</topic>
</contact>
<always_on>1</always_on>
<update_rate>100</update_rate>
<visualize>true</visualize>
<plugin
filename="ignition-gazebo-contact-system"
name="ignition::gazebo::systems::Contact"/>
</sensor>
</gazebo>

<gazebo>
<plugin
filename="ignition-gazebo-contact-system"
name="ignition::gazebo::systems::Contact"/>

<plugin
filename="libignition-gazebo-joint-state-publisher-system.so"
name="ignition::gazebo::systems::JointStatePublisher">
Expand Down
Loading