Skip to content

Commit 75585c4

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 526737e commit 75585c4

31 files changed

Lines changed: 190 additions & 199 deletions

File tree

firmware/teleop.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
#!/usr/bin/env python3
22
import curses
3-
import serial
43
import time
54

5+
import serial
6+
67
PORT = "/dev/ttyACM0"
78
BAUD = 115200
89

9-
LINEAR_SPEED = 0.2 # m/s
10+
LINEAR_SPEED = 0.2 # m/s
1011
ANGULAR_SPEED = 0.8 # rad/s
11-
HZ = 20.0 # send frequency
12-
STOP_TIMEOUT = 0.5 # seconds with no key → auto-stop
12+
HZ = 20.0 # send frequency
13+
STOP_TIMEOUT = 0.5 # seconds with no key → auto-stop
14+
1315

1416
def teleop(stdscr):
1517
ser = serial.Serial(PORT, BAUD, timeout=0.01)
@@ -55,9 +57,9 @@ def teleop(stdscr):
5557
vx = 0.0
5658
vy = 0.0
5759
wz = -ANGULAR_SPEED
58-
elif last_key == ord(' '): # space = stop
60+
elif last_key == ord(" "): # space = stop
5961
vx = vy = wz = 0.0
60-
elif last_key == ord('q'):
62+
elif last_key == ord("q"):
6163
vx = vy = wz = 0.0
6264
# send one last stop command
6365
cmd = f"V {vx:.3f} {vy:.3f} {wz:.3f}\n"
@@ -83,5 +85,6 @@ def teleop(stdscr):
8385
finally:
8486
ser.close()
8587

88+
8689
if __name__ == "__main__":
8790
curses.wrapper(teleop)
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-

ros_ws/src/bringup/launch/common.launch.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
"""Launch the shared ROS graph above the sim/real IO boundary."""
33

44
from launch import LaunchDescription
5-
from launch.actions import DeclareLaunchArgument, ExecuteProcess, GroupAction, IncludeLaunchDescription, RegisterEventHandler
5+
from launch.actions import (
6+
DeclareLaunchArgument,
7+
ExecuteProcess,
8+
GroupAction,
9+
IncludeLaunchDescription,
10+
RegisterEventHandler,
11+
)
612
from launch.conditions import IfCondition
713
from launch.event_handlers import OnProcessExit
814
from launch.launch_description_sources import PythonLaunchDescriptionSource
@@ -52,9 +58,7 @@ def generate_launch_description():
5258
gateway_preview_device = LaunchConfiguration("gateway_preview_device")
5359

5460
description_launch = IncludeLaunchDescription(
55-
PythonLaunchDescriptionSource(
56-
[PathJoinSubstitution([pkg_bringup, "launch", "description.launch.py"])]
57-
),
61+
PythonLaunchDescriptionSource([PathJoinSubstitution([pkg_bringup, "launch", "description.launch.py"])]),
5862
launch_arguments={
5963
"use_sim_time": use_sim_time,
6064
"log_level": log_level,
@@ -64,9 +68,7 @@ def generate_launch_description():
6468
)
6569

6670
perception_launch = IncludeLaunchDescription(
67-
PythonLaunchDescriptionSource(
68-
[PathJoinSubstitution([pkg_bringup, "launch", "perception.launch.py"])]
69-
),
71+
PythonLaunchDescriptionSource([PathJoinSubstitution([pkg_bringup, "launch", "perception.launch.py"])]),
7072
launch_arguments={
7173
"use_sim_time": use_sim_time,
7274
"log_level": log_level,

ros_ws/src/bringup/launch/real_io.launch.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ def generate_launch_description():
3939
lidar_angle_compensate = LaunchConfiguration("lidar_angle_compensate")
4040
encoder_odometry_params_file = LaunchConfiguration("encoder_odometry_params_file")
4141

42-
encoder_odometry_params_path = PathJoinSubstitution(
43-
[pkg_bringup, "config", encoder_odometry_params_file]
44-
)
42+
encoder_odometry_params_path = PathJoinSubstitution([pkg_bringup, "config", encoder_odometry_params_file])
4543

4644
micro_ros_agent_node = Node(
4745
package="micro_ros_agent",

ros_ws/src/bringup/launch/sim.launch.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ def generate_launch_description():
101101
)
102102

103103
launch_group = GroupAction(actions=[sim_io_launch, common_launch, rviz_launch])
104-
after_cleanup = RegisterEventHandler(
105-
OnProcessExit(target_action=cleanup, on_exit=[launch_group])
106-
)
104+
after_cleanup = RegisterEventHandler(OnProcessExit(target_action=cleanup, on_exit=[launch_group]))
107105

108106
return LaunchDescription([*declared_arguments, cleanup, after_cleanup])
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-

ros_ws/src/omniseer_description/test/test_goals_rank.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ namespace
6464
{
6565
double lo = std::numeric_limits<double>::infinity(),
6666
hi = -std::numeric_limits<double>::infinity();
67-
void observe(double v)
67+
void observe(double v)
6868
{
6969
if (std::isfinite(v))
7070
{

ros_ws/src/robot_diag_control/robot_diag_control/monitor_gui.py

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030

3131

3232
def _build_parser() -> argparse.ArgumentParser:
33-
parser = argparse.ArgumentParser(
34-
description="Minimal Tk monitor GUI for the robot gateway"
35-
)
33+
parser = argparse.ArgumentParser(description="Minimal Tk monitor GUI for the robot gateway")
3634
parser.add_argument("--host", default="127.0.0.1", help="gRPC gateway host")
3735
parser.add_argument("--port", type=int, default=50051, help="gRPC gateway port")
3836
parser.add_argument(
@@ -153,18 +151,10 @@ def _build_layout(self) -> None:
153151
self._add_labeled_entry(connection_frame, "Host", self._host_var, 0, 0)
154152
self._add_labeled_entry(connection_frame, "Port", self._port_var, 0, 2, width=10)
155153
self._add_labeled_entry(connection_frame, "Preview Host", self._preview_host_var, 1, 0)
156-
self._add_labeled_entry(
157-
connection_frame, "Preview Port", self._preview_port_var, 1, 2, width=10
158-
)
159-
self._add_labeled_entry(
160-
connection_frame, "Latency ms", self._preview_latency_var, 2, 0, width=10
161-
)
162-
self._add_labeled_entry(
163-
connection_frame, "gst-launch", self._gst_launch_path_var, 2, 2
164-
)
165-
self._add_labeled_entry(
166-
connection_frame, "Poll Interval (s)", self._poll_interval_var, 3, 0, width=10
167-
)
154+
self._add_labeled_entry(connection_frame, "Preview Port", self._preview_port_var, 1, 2, width=10)
155+
self._add_labeled_entry(connection_frame, "Latency ms", self._preview_latency_var, 2, 0, width=10)
156+
self._add_labeled_entry(connection_frame, "gst-launch", self._gst_launch_path_var, 2, 2)
157+
self._add_labeled_entry(connection_frame, "Poll Interval (s)", self._poll_interval_var, 3, 0, width=10)
168158
ttk.Label(connection_frame, text="Profile").grid(row=3, column=2, sticky=tk.W, pady=(8, 0))
169159
profile_box = ttk.Combobox(
170160
connection_frame,
@@ -181,21 +171,11 @@ def _build_layout(self) -> None:
181171
controls = ttk.Frame(container)
182172
controls.pack(fill=tk.X, pady=(0, 10))
183173
ttk.Button(controls, text="Refresh", command=self.refresh_status).pack(side=tk.LEFT)
184-
ttk.Button(controls, text="Start Watch", command=self.start_watch).pack(
185-
side=tk.LEFT, padx=(8, 0)
186-
)
187-
ttk.Button(controls, text="Stop Watch", command=self.stop_watch).pack(
188-
side=tk.LEFT, padx=(8, 0)
189-
)
190-
ttk.Button(controls, text="Preview On", command=self.preview_on).pack(
191-
side=tk.LEFT, padx=(24, 0)
192-
)
193-
ttk.Button(controls, text="Preview Off", command=self.preview_off).pack(
194-
side=tk.LEFT, padx=(8, 0)
195-
)
196-
ttk.Button(controls, text="Open Viewer", command=self.open_viewer).pack(
197-
side=tk.LEFT, padx=(24, 0)
198-
)
174+
ttk.Button(controls, text="Start Watch", command=self.start_watch).pack(side=tk.LEFT, padx=(8, 0))
175+
ttk.Button(controls, text="Stop Watch", command=self.stop_watch).pack(side=tk.LEFT, padx=(8, 0))
176+
ttk.Button(controls, text="Preview On", command=self.preview_on).pack(side=tk.LEFT, padx=(24, 0))
177+
ttk.Button(controls, text="Preview Off", command=self.preview_off).pack(side=tk.LEFT, padx=(8, 0))
178+
ttk.Button(controls, text="Open Viewer", command=self.open_viewer).pack(side=tk.LEFT, padx=(24, 0))
199179

200180
body = ttk.Panedwindow(container, orient=tk.VERTICAL)
201181
body.pack(fill=tk.BOTH, expand=True)

ros_ws/src/robot_diag_control/robot_diag_control/monitor_shell.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222

2323

2424
def _build_parser() -> argparse.ArgumentParser:
25-
parser = argparse.ArgumentParser(
26-
description="Minimal host-side monitor shell for the robot gateway"
27-
)
25+
parser = argparse.ArgumentParser(description="Minimal host-side monitor shell for the robot gateway")
2826
parser.add_argument("--host", default="127.0.0.1", help="gRPC gateway host")
2927
parser.add_argument("--port", type=int, default=50051, help="gRPC gateway port")
3028
parser.add_argument(

ros_ws/src/robot_diag_control/robot_diag_control/preview_viewer.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828

2929

3030
def _build_parser() -> argparse.ArgumentParser:
31-
parser = argparse.ArgumentParser(
32-
description="Minimal host-side preview helper for the robot gateway"
33-
)
31+
parser = argparse.ArgumentParser(description="Minimal host-side preview helper for the robot gateway")
3432
parser.add_argument("--host", default="127.0.0.1", help="gRPC gateway host")
3533
parser.add_argument("--port", type=int, default=50051, help="gRPC gateway port")
3634
parser.add_argument(
@@ -115,8 +113,7 @@ def _validate_gstreamer_support(parsed: argparse.Namespace) -> str:
115113
gst_inspect_path = _resolve_gst_inspect_path(parsed.gst_launch_path)
116114
if not _gst_element_available(gst_inspect_path, "srtsrc"):
117115
raise RuntimeError(
118-
"GStreamer element 'srtsrc' is unavailable; install the SRT plugin "
119-
"(for Ubuntu: gstreamer1.0-plugins-bad)"
116+
"GStreamer element 'srtsrc' is unavailable; install the SRT plugin (for Ubuntu: gstreamer1.0-plugins-bad)"
120117
)
121118

122119
decoder_element = _select_h264_decoder_element(gst_inspect_path)

0 commit comments

Comments
 (0)