Skip to content

Commit 79fe08c

Browse files
authored
Merge pull request #675 from JdeRobot/fix-drone-worlds-names
Fix drone worlds names
2 parents b6edd07 + 94d3b20 commit 79fe08c

68 files changed

Lines changed: 690 additions & 550 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CustomRobots/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ install(
113113
autopark_harmonic/params
114114
# DRONE_ASSETS
115115
drone_assets/models
116-
drone_assets/worlds
117116
drone_assets/bridges
118117
# GLOBAL_NAVIGATION
119118
taxi_navigator/models

CustomRobots/drone_assets/bridges/rescue_people.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
# gz topic published by IMU plugin
99
- ros_topic_name: "sensor_measurements/imu"
10-
gz_topic_name: "/world/empty/model/drone0/model/imu/link/internal/sensor/imu/imu"
10+
gz_topic_name: "/world/default/model/drone0/model/imu/link/internal/sensor/imu/imu"
1111
ros_type_name: "sensor_msgs/msg/Imu"
1212
gz_type_name: "gz.msgs.IMU"
1313
direction: GZ_TO_ROS
@@ -20,7 +20,7 @@
2020
direction: GZ_TO_ROS
2121

2222
- ros_topic_name: "/tf"
23-
gz_topic_name: "/world/empty/model/drone0/pose"
23+
gz_topic_name: "/world/default/model/drone0/pose"
2424
ros_type_name: "tf2_msgs/msg/TFMessage"
2525
gz_type_name: "gz.msgs.Pose_V"
2626
direction: GZ_TO_ROS
@@ -32,7 +32,7 @@
3232
direction: GZ_TO_ROS
3333

3434
- ros_topic_name: "/tf"
35-
gz_topic_name: "/world/empty/model/drone0/pose_static"
35+
gz_topic_name: "/world/default/model/drone0/pose_static"
3636
ros_type_name: "tf2_msgs/msg/TFMessage"
3737
gz_type_name: "gz.msgs.Pose_V"
3838
direction: GZ_TO_ROS
@@ -59,25 +59,25 @@
5959

6060
# Payload plugin
6161
- ros_topic_name: "sensor_measurements/frontal_camera/image_raw"
62-
gz_topic_name: "/world/empty/model/drone0/model/frontal_cam/link/hd_camera/sensor/camera/image"
62+
gz_topic_name: "/world/default/model/drone0/model/frontal_cam/link/hd_camera/sensor/camera/image"
6363
ros_type_name: "sensor_msgs/msg/Image"
6464
gz_type_name: "gz.msgs.Image"
6565
direction: GZ_TO_ROS
6666

6767
- ros_topic_name: "sensor_measurements/frontal_camera/camera_info"
68-
gz_topic_name: "/world/empty/model/drone0/model/frontal_cam/link/hd_camera/sensor/camera/camera_info"
68+
gz_topic_name: "/world/default/model/drone0/model/frontal_cam/link/hd_camera/sensor/camera/camera_info"
6969
ros_type_name: "sensor_msgs/msg/CameraInfo"
7070
gz_type_name: "gz.msgs.CameraInfo"
7171
direction: GZ_TO_ROS
7272

7373
- ros_topic_name: "sensor_measurements/ventral_camera/image_raw"
74-
gz_topic_name: "/world/empty/model/drone0/model/ventral_cam/link/hd_camera/sensor/camera/image"
74+
gz_topic_name: "/world/default/model/drone0/model/ventral_cam/link/hd_camera/sensor/camera/image"
7575
ros_type_name: "sensor_msgs/msg/Image"
7676
gz_type_name: "gz.msgs.Image"
7777
direction: GZ_TO_ROS
7878

7979
- ros_topic_name: "sensor_measurements/ventral_camera/camera_info"
80-
gz_topic_name: "/world/empty/model/drone0/model/ventral_cam/link/hd_camera/sensor/camera/camera_info"
80+
gz_topic_name: "/world/default/model/drone0/model/ventral_cam/link/hd_camera/sensor/camera/camera_info"
8181
ros_type_name: "sensor_msgs/msg/CameraInfo"
8282
gz_type_name: "gz.msgs.CameraInfo"
83-
direction: GZ_TO_ROS
83+
direction: GZ_TO_ROS

CustomRobots/drone_assets/worlds/rescue_people_harmonic.world

Lines changed: 0 additions & 92 deletions
This file was deleted.

Industrial/ur5_gripper_description/launch/gazebo.launch.py

Lines changed: 55 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,22 @@
33

44
import os
55
from launch import LaunchDescription
6-
from launch.actions import DeclareLaunchArgument, ExecuteProcess, IncludeLaunchDescription, RegisterEventHandler, SetEnvironmentVariable
6+
from launch.actions import (
7+
DeclareLaunchArgument,
8+
ExecuteProcess,
9+
IncludeLaunchDescription,
10+
RegisterEventHandler,
11+
SetEnvironmentVariable,
12+
)
713
from launch.conditions import IfCondition
814
from launch.event_handlers import OnProcessExit
915
from launch.launch_description_sources import PythonLaunchDescriptionSource
10-
from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution
16+
from launch.substitutions import (
17+
Command,
18+
FindExecutable,
19+
LaunchConfiguration,
20+
PathJoinSubstitution,
21+
)
1122
from launch_ros.actions import Node
1223
from launch_ros.substitutions import FindPackageShare
1324
from ament_index_python.packages import get_package_share_directory
@@ -19,20 +30,20 @@ def generate_launch_description():
1930
pkg_share_dir = get_package_share_directory("ur5_gripper_description")
2031
# Go up from install/ur5_gripper_description/share/ur5_gripper_description to install/
2132
workspace_dir = os.path.dirname(os.path.dirname(os.path.dirname(pkg_share_dir)))
22-
33+
2334
# Prepare environment variables for Gazebo
24-
gz_lib_path = os.path.join(workspace_dir, 'gz_ros2_control', 'lib')
25-
ur_share = os.path.join(workspace_dir, 'ur5_gripper_description', 'share')
26-
robotiq_share = os.path.join(workspace_dir, 'robotiq_description', 'share')
27-
35+
gz_lib_path = os.path.join(workspace_dir, "gz_ros2_control", "lib")
36+
ur_share = os.path.join(workspace_dir, "ur5_gripper_description", "share")
37+
robotiq_share = os.path.join(workspace_dir, "robotiq_description", "share")
38+
2839
gz_env = {
29-
'GZ_SIM_RESOURCE_PATH': f"{ur_share}:{robotiq_share}:{os.environ.get('GZ_SIM_RESOURCE_PATH', '')}",
30-
'GZ_SIM_SYSTEM_PLUGIN_PATH': f"{gz_lib_path}:{os.environ.get('GZ_SIM_SYSTEM_PLUGIN_PATH', '')}",
31-
'LD_LIBRARY_PATH': f"{gz_lib_path}:{os.environ.get('LD_LIBRARY_PATH', '')}"
40+
"GZ_SIM_RESOURCE_PATH": f"{ur_share}:{robotiq_share}:{os.environ.get('GZ_SIM_RESOURCE_PATH', '')}",
41+
"GZ_SIM_SYSTEM_PLUGIN_PATH": f"{gz_lib_path}:{os.environ.get('GZ_SIM_SYSTEM_PLUGIN_PATH', '')}",
42+
"LD_LIBRARY_PATH": f"{gz_lib_path}:{os.environ.get('LD_LIBRARY_PATH', '')}",
3243
}
3344
# Declare arguments
3445
declared_arguments = []
35-
46+
3647
declared_arguments.append(
3748
DeclareLaunchArgument(
3849
"ur_type",
@@ -41,23 +52,23 @@ def generate_launch_description():
4152
choices=["ur3", "ur3e", "ur5", "ur5e", "ur10", "ur10e", "ur16e"],
4253
)
4354
)
44-
55+
4556
declared_arguments.append(
4657
DeclareLaunchArgument(
4758
"prefix",
4859
default_value='""',
4960
description="Prefix of the joint names",
5061
)
5162
)
52-
63+
5364
declared_arguments.append(
5465
DeclareLaunchArgument(
5566
"launch_rviz",
5667
default_value="false",
5768
description="Launch RViz?",
5869
)
5970
)
60-
71+
6172
declared_arguments.append(
6273
DeclareLaunchArgument(
6374
"gz_args",
@@ -76,15 +87,15 @@ def generate_launch_description():
7687
xacro_file = os.path.join(
7788
get_package_share_directory("ur5_gripper_description"),
7889
"urdf",
79-
"ur5_robotiq85_gripper.urdf.xacro"
90+
"ur5_robotiq85_gripper.urdf.xacro",
8091
)
81-
92+
8293
controllers_file = os.path.join(
8394
get_package_share_directory("ur5_gripper_description"),
8495
"config",
85-
"ur5_controllers.yaml"
96+
"ur5_controllers.yaml",
8697
)
87-
98+
8899
# Process xacro directly to avoid Command() stderr issues
89100
robot_description_content = xacro.process_file(
90101
xacro_file,
@@ -96,20 +107,17 @@ def generate_launch_description():
96107
"sim_gazebo": "false",
97108
"sim_gz": "true",
98109
"simulation_controllers": controllers_file,
99-
}
110+
},
100111
).toxml()
101-
112+
102113
robot_description = {"robot_description": robot_description_content}
103114

104115
# Node for robot state publisher
105116
node_robot_state_publisher = Node(
106117
package="robot_state_publisher",
107118
executable="robot_state_publisher",
108119
output="screen",
109-
parameters=[
110-
robot_description,
111-
{"use_sim_time": True}
112-
],
120+
parameters=[robot_description, {"use_sim_time": True}],
113121
)
114122

115123
# Gazebo Sim (Harmonic) - with environment variables
@@ -118,23 +126,22 @@ def generate_launch_description():
118126
f'export GZ_SIM_SYSTEM_PLUGIN_PATH="{gz_env["GZ_SIM_SYSTEM_PLUGIN_PATH"]}" && '
119127
f'export GZ_SIM_RESOURCE_PATH="{gz_env["GZ_SIM_RESOURCE_PATH"]}" && '
120128
f'export LD_LIBRARY_PATH="{gz_env["LD_LIBRARY_PATH"]}" && '
121-
'gz sim -r -v 4 empty.sdf'
122-
)
123-
124-
gazebo = ExecuteProcess(
125-
cmd=['bash', '-c', gz_cmd],
126-
output='screen',
127-
shell=False
129+
"gz sim -r -v 4 empty.sdf"
128130
)
129131

132+
gazebo = ExecuteProcess(cmd=["bash", "-c", gz_cmd], output="screen", shell=False)
133+
130134
# Spawn robot
131135
spawn_entity = Node(
132136
package="ros_gz_sim",
133137
executable="create",
134138
arguments=[
135-
"-topic", "robot_description",
136-
"-name", "ur5_robotiq",
137-
"-allow_renaming", "true",
139+
"-topic",
140+
"robot_description",
141+
"-name",
142+
"ur5_robotiq",
143+
"-allow_renaming",
144+
"true",
138145
],
139146
output="screen",
140147
)
@@ -152,7 +159,11 @@ def generate_launch_description():
152159
load_joint_state_broadcaster = Node(
153160
package="controller_manager",
154161
executable="spawner",
155-
arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
162+
arguments=[
163+
"joint_state_broadcaster",
164+
"--controller-manager",
165+
"/controller_manager",
166+
],
156167
output="screen",
157168
parameters=[{"use_sim_time": True}],
158169
)
@@ -165,7 +176,7 @@ def generate_launch_description():
165176
output="screen",
166177
parameters=[{"use_sim_time": True}],
167178
)
168-
179+
169180
# Load gripper controller
170181
load_gripper_controller = Node(
171182
package="controller_manager",
@@ -179,7 +190,7 @@ def generate_launch_description():
179190
rviz_config_file = PathJoinSubstitution(
180191
[FindPackageShare("ur5_gripper_description"), "rviz", "view_robot.rviz"]
181192
)
182-
193+
183194
rviz_node = Node(
184195
package="rviz2",
185196
executable="rviz2",
@@ -198,13 +209,15 @@ def generate_launch_description():
198209
)
199210
)
200211

201-
delay_joint_trajectory_controller_after_joint_state_broadcaster = RegisterEventHandler(
202-
event_handler=OnProcessExit(
203-
target_action=load_joint_state_broadcaster,
204-
on_exit=[load_joint_trajectory_controller],
212+
delay_joint_trajectory_controller_after_joint_state_broadcaster = (
213+
RegisterEventHandler(
214+
event_handler=OnProcessExit(
215+
target_action=load_joint_state_broadcaster,
216+
on_exit=[load_joint_trajectory_controller],
217+
)
205218
)
206219
)
207-
220+
208221
delay_gripper_controller_after_joint_trajectory = RegisterEventHandler(
209222
event_handler=OnProcessExit(
210223
target_action=load_joint_trajectory_controller,

0 commit comments

Comments
 (0)