Skip to content

Commit 4f0c166

Browse files
committed
Aplly black formatter
1 parent 6a2643d commit 4f0c166

4 files changed

Lines changed: 45 additions & 57 deletions

File tree

CustomRobots/tello_phy/tello_ros/tello_gazebo/worlds/build_world.py

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131

3232
def build_world(name, markers):
3333
world_file = open(name, "w")
34-
world_file.write(
35-
"""<?xml version="1.0"?>
34+
world_file.write("""<?xml version="1.0"?>
3635
3736
<sdf version="1.6">
3837
<world name="default">
@@ -54,50 +53,41 @@ def build_world(name, markers):
5453
</include>
5554
5655
<!-- ArUco markers -->
57-
"""
58-
)
56+
""")
5957
for marker in markers:
60-
world_file.write(
61-
f""" <model name="marker{marker[0]}">
58+
world_file.write(f""" <model name="marker{marker[0]}">
6259
<include>
6360
<static>true</static>
6461
<uri>model://marker_{marker[0]}</uri>
6562
</include>
6663
<pose>{marker[1]} {marker[2]} {marker[3]} {marker[4]} {marker[5]} {marker[6]}</pose>
6764
</model>
68-
"""
69-
)
70-
world_file.write(
71-
"""
65+
""")
66+
world_file.write("""
7267
</world>
73-
</sdf>"""
74-
)
68+
</sdf>""")
7569
world_file.close()
7670

7771

7872
def build_map(name, markers):
7973
map_file = open(name, "w")
80-
map_file.write(
81-
"""# Map for orca.world
74+
map_file.write("""# Map for orca.world
8275
# All marker locations are fixed (f: 1)
8376
8477
marker_length: 0.1778
8578
markers:
86-
"""
87-
)
79+
""")
8880
for marker in markers:
8981
t_marker_world = xf.euler_matrix(marker[4], marker[5], marker[6])
9082
t_marker_map = t_marker_world @ t_world_map
9183
r_marker_map = xf.euler_from_matrix(t_marker_map)
9284

93-
map_file.write(
94-
f""" - id: {marker[0]}
85+
map_file.write(f""" - id: {marker[0]}
9586
u: 1
9687
f: 1
9788
xyz: [{marker[1]}, {marker[2]}, {marker[3]}]
9889
rpy: [{r_marker_map[0]}, {r_marker_map[1]}, {r_marker_map[2]}]
99-
"""
100-
)
90+
""")
10191
map_file.close()
10292

10393

Launchers/machine_vision_harmonic/execution.launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def generate_launch_description():
2727
xacro_file = os.path.join(
2828
get_package_share_directory("ros2srrc_ur5_gazebo"),
2929
"urdf",
30-
"ur5_robotiq_2f85_with_cams.urdf.xacro"
30+
"ur5_robotiq_2f85_with_cams.urdf.xacro",
3131
)
3232

3333
pkg_share_dir = get_package_share_directory("ur5_gripper_description")

Launchers/machine_vision_harmonic/robot.launch.py

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,10 @@ def generate_launch_description():
3333
pkg_gazebo = get_package_share_directory("ros2srrc_ur5_gazebo")
3434

3535
xacro_file = os.path.join(
36-
pkg_gazebo,
37-
"urdf",
38-
"ur5_robotiq_2f85_with_cams.urdf.xacro"
36+
pkg_gazebo, "urdf", "ur5_robotiq_2f85_with_cams.urdf.xacro"
3937
)
4038

41-
controllers_file = os.path.join(
42-
pkg_desc,
43-
"config",
44-
"ur5_controllers.yaml"
45-
)
39+
controllers_file = os.path.join(pkg_desc, "config", "ur5_controllers.yaml")
4640

4741
# =========================
4842
# ROBOT DESCRIPTION
@@ -76,9 +70,7 @@ def generate_launch_description():
7670
)
7771
}
7872

79-
kinematics_yaml = load_yaml(
80-
"ur5_gripper_moveit_config", "config/kinematics.yaml"
81-
)
73+
kinematics_yaml = load_yaml("ur5_gripper_moveit_config", "config/kinematics.yaml")
8274
kinematics_yaml = {
8375
"robot_description_kinematics": kinematics_yaml["/**"]["ros__parameters"]
8476
}
@@ -109,9 +101,7 @@ def generate_launch_description():
109101
"ros2srrc_robots", "ur5/config/pilz_cartesian_limits.yaml"
110102
)
111103

112-
joint_limits_yaml = load_yaml(
113-
"ros2srrc_robots", "ur5/config/joint_limits.yaml"
114-
)
104+
joint_limits_yaml = load_yaml("ros2srrc_robots", "ur5/config/joint_limits.yaml")
115105

116106
combined_planning = {
117107
"robot_description_planning": {
@@ -174,7 +164,6 @@ def generate_launch_description():
174164
"/hand_camera/image@sensor_msgs/msg/Image@gz.msgs.Image",
175165
"/hand_camera/depth_image@sensor_msgs/msg/Image@gz.msgs.Image",
176166
"/hand_camera/camera_info@sensor_msgs/msg/CameraInfo@gz.msgs.CameraInfo",
177-
178167
"/base_camera/image@sensor_msgs/msg/Image@gz.msgs.Image",
179168
"/base_camera/depth_image@sensor_msgs/msg/Image@gz.msgs.Image",
180169
"/base_camera/camera_info@sensor_msgs/msg/CameraInfo@gz.msgs.CameraInfo",
@@ -228,14 +217,16 @@ def generate_launch_description():
228217
# LAUNCH
229218
# =========================
230219

231-
return LaunchDescription([
232-
clock_bridge,
233-
camera_bridge,
234-
robot_state_publisher,
235-
static_tf,
236-
spawn_entity,
237-
joint_state_broadcaster,
238-
joint_trajectory_controller,
239-
gripper_controller,
240-
move_group,
241-
])
220+
return LaunchDescription(
221+
[
222+
clock_bridge,
223+
camera_bridge,
224+
robot_state_publisher,
225+
static_tf,
226+
spawn_entity,
227+
joint_state_broadcaster,
228+
joint_trajectory_controller,
229+
gripper_controller,
230+
move_group,
231+
]
232+
)

Launchers/machine_vision_harmonic/world.launch.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def generate_launch_description():
2525
# PATHS
2626
# =========================
2727

28-
world_path = "/opt/jderobot/Worlds/machine_vision_harmonic.world"
28+
world_path = "/opt/jderobot/Worlds/machine_vision_harmonic.world"
2929

3030
gazebo_models_path = os.path.join(package_dir, "models")
3131

@@ -37,10 +37,13 @@ def generate_launch_description():
3737
custom_models_path = "/home/dev_ws/src/IndustrialRobots/ros2_SimRealRobotControl/packages/ur5/ros2srrc_ur5_gazebo/models"
3838

3939
resource_path = (
40-
ur5_share_parent + ":" +
41-
robotiq_share_parent + ":" +
42-
warehouse_models_path + ":" +
43-
custom_models_path
40+
ur5_share_parent
41+
+ ":"
42+
+ robotiq_share_parent
43+
+ ":"
44+
+ warehouse_models_path
45+
+ ":"
46+
+ custom_models_path
4447
)
4548

4649
gazebo = ExecuteProcess(
@@ -57,8 +60,10 @@ def generate_launch_description():
5760
SetEnvironmentVariable(
5861
name="LD_LIBRARY_PATH",
5962
value=(
60-
gz_lib_path + ":"
61-
+ gz_link_attacher_lib + ":"
63+
gz_lib_path
64+
+ ":"
65+
+ gz_link_attacher_lib
66+
+ ":"
6267
+ "/home/ws/install/lib:"
6368
+ "/home/ws/install/linkattacher_msgs/lib:"
6469
+ "/opt/ros/humble/lib:"
@@ -73,8 +78,10 @@ def generate_launch_description():
7378
value=(
7479
"/usr/lib/x86_64-linux-gnu/gz-sim-8/plugins:"
7580
"/usr/lib/x86_64-linux-gnu/gz-sim-8/systems:"
76-
+ gz_lib_path + ":"
77-
+ gz_link_attacher_lib + ":"
81+
+ gz_lib_path
82+
+ ":"
83+
+ gz_link_attacher_lib
84+
+ ":"
7885
+ "/opt/ros/humble/lib"
7986
),
8087
)
@@ -89,4 +96,4 @@ def generate_launch_description():
8996

9097
ld.add_action(gazebo)
9198

92-
return ld
99+
return ld

0 commit comments

Comments
 (0)