Skip to content

Commit 222e954

Browse files
committed
fix
1 parent fc6d1ba commit 222e954

File tree

2 files changed

+28
-29
lines changed

2 files changed

+28
-29
lines changed

src/autonomous_state_display/package.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
<license>Apache License 2.0</license>
1010
<exec_depend>ament_index_python</exec_depend>
11-
<exec_depend>signage_version</exec_depend>
1211

1312
<depend>autoware_auto_system_msgs</depend>
1413
<depend>diagnostic_updater</depend>

src/autonomous_state_display/src/autonomous_state_display/autonomous_state_display_core.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from dataclasses import dataclass
22
import datetime
33
import time
4-
import serial
54
import json
65
import os
76
import uuid
@@ -84,32 +83,33 @@ def pub_mode_status(self, status):
8483
self.mode_status_pub_.publish(msg)
8584

8685
def send_data(self, data_key):
87-
command_data = []
88-
self.node.get_logger().info(str(data_key))
89-
if data_key == "auto":
90-
command_data = ["sudo", "i2cset", "-y", "0", "0x40", "0x01", "0x07"]
91-
elif data_key == "mrm":
92-
command_data = ["sudo", "i2cset", "-y", "0", "0x40", "0x01", "0x01"]
93-
elif data_key == "experiment":
94-
command_data = ["sudo", "i2cset", "-y", "0", "0x40", "0x01", "0x03"]
95-
elif data_key == "null":
96-
command_data = ["sudo", "i2cset", "-y", "0", "0x40", "0x01", "0x00"]
97-
98-
self.node.get_logger().info(str(command_data))
99-
command_data = ["sudo", "ls", "/home/makotoyabuta"]
100-
101-
if len(command_data) == 0:
102-
return
103-
result = subprocess.run(
104-
command_data,
105-
capture_output=True,
106-
text=True
107-
)
108-
109-
self.node.get_logger().info(str(result.stdout))
110-
self.node.get_logger().info(str(result.stderr))
111-
self.node.get_logger().info(str(result.returncode))
112-
86+
try:
87+
command_data = []
88+
if data_key == "auto":
89+
command_data = ["sudo", "i2cset", "-y", "0", "0x40", "0x01", "0x07"]
90+
elif data_key == "mrm":
91+
command_data = ["sudo", "i2cset", "-y", "0", "0x40", "0x01", "0x01"]
92+
elif data_key == "experiment":
93+
command_data = ["sudo", "i2cset", "-y", "0", "0x40", "0x01", "0x03"]
94+
elif data_key == "null":
95+
command_data = ["sudo", "i2cset", "-y", "0", "0x40", "0x01", "0x00"]
96+
97+
self.node.get_logger().info(str(command_data))
98+
command_data = ["sudo", "ls", "/home/makotoyabuta"]
99+
100+
if len(command_data) == 0:
101+
return
102+
result = subprocess.run(
103+
command_data,
104+
capture_output=True,
105+
text=True
106+
)
107+
108+
self.node.get_logger().info(str(result.stdout))
109+
self.node.get_logger().info(str(result.stderr))
110+
self.node.get_logger().info(str(result.returncode))
111+
except Exception as e:
112+
self.node.get_logger().error(str(e))
113113

114114
# 出力コマンド一覧
115115
# sudo i2cset -y 0 0x40 0x01 0x00 #空欄
@@ -171,7 +171,7 @@ def sub_operation_mode_callback(self, msg):
171171
try:
172172
# operation modeが変わったときにautowareが起動したと判断する
173173
self.is_autoware_launch = True
174-
self.node.get_logger().info(str(msg.data))
174+
self.node.get_logger().info(str(msg.mode))
175175
except Exception as e:
176176
self.node.get_logger().error("Unable to get the operation mode, ERROR: " + str(e))
177177

0 commit comments

Comments
 (0)