Skip to content

Commit 5197928

Browse files
style(pre-commit): autofix
1 parent 4093875 commit 5197928

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

crane_robot_command_bridge/crane_robot_command_bridge/bridge_node.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@
44
import uvicorn
55
from fastapi import FastAPI, HTTPException
66
from .models import * # Pydanticモデルをインポート
7-
import asyncio
8-
from concurrent.futures import ThreadPoolExecutor
97
import threading
108

119

1210
# ROS 2メッセージの型をインポート
13-
from geometry_msgs.msg import Pose2D
1411
from crane_msgs.msg import (
1512
RobotCommand,
1613
RobotCommands,
17-
LocalPlannerConfig,
1814
PositionTargetMode,
1915
VelocityTargetMode,
2016
SimpleVelocityTargetMode,
@@ -31,7 +27,9 @@ def __init__(self):
3127
)
3228

3329
# パブリッシャーの初期化(ロボットの数に応じて動的に作成)
34-
self.publisher = self.create_publisher(RobotCommands, "/control_targets", qos_profile)
30+
self.publisher = self.create_publisher(
31+
RobotCommands, "/control_targets", qos_profile
32+
)
3533
self.robot_commands = {}
3634

3735
# ステータス更新用のタイマー
@@ -55,7 +53,9 @@ def convert_to_ros_message(self, command_model: RobotCommandModel) -> RobotComma
5553
msg.omega_limit = command_model.omega_limit
5654
msg.theta_tolerance = command_model.theta_tolerance
5755
msg.latency_ms = command_model.latency_ms
58-
msg.elapsed_time_ms_since_last_vision = command_model.elapsed_time_ms_since_last_vision
56+
msg.elapsed_time_ms_since_last_vision = (
57+
command_model.elapsed_time_ms_since_last_vision
58+
)
5959
msg.skill_name = command_model.skill_name
6060

6161
# LocalPlannerConfigの設定
@@ -69,7 +69,9 @@ def convert_to_ros_message(self, command_model: RobotCommandModel) -> RobotComma
6969
msg.local_planner_config.disable_placement_avoidance = (
7070
planner_config.disable_placement_avoidance
7171
)
72-
msg.local_planner_config.disable_ball_avoidance = planner_config.disable_ball_avoidance
72+
msg.local_planner_config.disable_ball_avoidance = (
73+
planner_config.disable_ball_avoidance
74+
)
7375
msg.local_planner_config.disable_rule_area_avoidance = (
7476
planner_config.disable_rule_area_avoidance
7577
)
@@ -94,7 +96,9 @@ def convert_to_ros_message(self, command_model: RobotCommandModel) -> RobotComma
9496
target = PositionTargetMode()
9597
target.target_x = command_model.position_target_mode.target_x
9698
target.target_y = command_model.position_target_mode.target_y
97-
target.position_tolerance = command_model.position_target_mode.position_tolerance
99+
target.position_tolerance = (
100+
command_model.position_target_mode.position_tolerance
101+
)
98102
target.speed_limit_at_target = (
99103
command_model.position_target_mode.speed_limit_at_target
100104
)
@@ -108,8 +112,12 @@ def convert_to_ros_message(self, command_model: RobotCommandModel) -> RobotComma
108112
target.target_vy = command_model.velocity_target_mode.target_vy
109113
target.traj_origin_x = command_model.velocity_target_mode.traj_origin_x
110114
target.traj_origin_y = command_model.velocity_target_mode.traj_origin_y
111-
target.traj_origin_angle = command_model.velocity_target_mode.traj_origin_angle
112-
target.traj_curvature = command_model.velocity_target_mode.traj_curvature
115+
target.traj_origin_angle = (
116+
command_model.velocity_target_mode.traj_origin_angle
117+
)
118+
target.traj_curvature = (
119+
command_model.velocity_target_mode.traj_curvature
120+
)
113121
msg.velocity_target_mode = [target]
114122

115123
elif command_model.control_mode == "SIMPLE_VELOCITY_TARGET_MODE":

0 commit comments

Comments
 (0)