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

Commit

Permalink
Merge pull request #8 from udacity/awbrown90-dbw_patch-1
Browse files Browse the repository at this point in the history
Update server.py
  • Loading branch information
awbrown90 authored Sep 1, 2017
2 parents c7f0aed + cfed9b7 commit 00f57c5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ros/src/styx/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
bridge = Bridge(conf)
msgs = []

dbw_enable = False

@sio.on('connect')
def connect(sid, environ):
print("connect ", sid)
bridge.publish_dbw_status(True)

def send(topic, data):
s = 1
Expand All @@ -29,6 +29,10 @@ def send(topic, data):

@sio.on('telemetry')
def telemetry(sid, data):
global dbw_enable
if data["dbw_enable"] != dbw_enable:
dbw_enable = data["dbw_enable"]
bridge.publish_dbw_status(dbw_enable)
bridge.publish_odometry(data)
for i in range(len(msgs)):
topic, data = msgs.pop(0)
Expand Down

0 comments on commit 00f57c5

Please sign in to comment.