Skip to content
This repository was archived by the owner on Sep 15, 2022. It is now read-only.

Commit 00f57c5

Browse files
author
Aaron Brown
authored
Merge pull request #8 from udacity/awbrown90-dbw_patch-1
Update server.py
2 parents c7f0aed + cfed9b7 commit 00f57c5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

ros/src/styx/server.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
bridge = Bridge(conf)
1515
msgs = []
1616

17+
dbw_enable = False
1718

1819
@sio.on('connect')
1920
def connect(sid, environ):
2021
print("connect ", sid)
21-
bridge.publish_dbw_status(True)
2222

2323
def send(topic, data):
2424
s = 1
@@ -29,6 +29,10 @@ def send(topic, data):
2929

3030
@sio.on('telemetry')
3131
def telemetry(sid, data):
32+
global dbw_enable
33+
if data["dbw_enable"] != dbw_enable:
34+
dbw_enable = data["dbw_enable"]
35+
bridge.publish_dbw_status(dbw_enable)
3236
bridge.publish_odometry(data)
3337
for i in range(len(msgs)):
3438
topic, data = msgs.pop(0)

0 commit comments

Comments
 (0)