From cde197acc14ecb39938fd8127f722c032a5cc59d Mon Sep 17 00:00:00 2001 From: Aaron Brown Date: Fri, 1 Sep 2017 11:44:20 -0700 Subject: [PATCH 1/3] Update server.py adding dbw_enable status change from the simulator's manual control button --- ros/src/styx/server.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ros/src/styx/server.py b/ros/src/styx/server.py index 32d942a139..cd4e23540e 100755 --- a/ros/src/styx/server.py +++ b/ros/src/styx/server.py @@ -14,11 +14,12 @@ bridge = Bridge(conf) msgs = [] +dbw_enable = False @sio.on('connect') def connect(sid, environ): print("connect ", sid) - bridge.publish_dbw_status(True) + bridge.publish_dbw_status(dbw_enable) def send(topic, data): s = 1 @@ -29,6 +30,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) From 7c8233518f1c036907f161a85df21eba60b6e050 Mon Sep 17 00:00:00 2001 From: Aaron Brown Date: Fri, 1 Sep 2017 15:11:07 -0700 Subject: [PATCH 2/3] Update server.py changed to hard coded False when starting, its False because car starts in manual mode and dbw_enable is false at that state. Removed the parenthesis --- ros/src/styx/server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ros/src/styx/server.py b/ros/src/styx/server.py index cd4e23540e..6583d111f1 100755 --- a/ros/src/styx/server.py +++ b/ros/src/styx/server.py @@ -19,7 +19,7 @@ @sio.on('connect') def connect(sid, environ): print("connect ", sid) - bridge.publish_dbw_status(dbw_enable) + bridge.publish_dbw_status(False) def send(topic, data): s = 1 @@ -31,7 +31,7 @@ def send(topic, data): @sio.on('telemetry') def telemetry(sid, data): global dbw_enable - if(data["dbw_enable"] != dbw_enable): + if data["dbw_enable"] != dbw_enable: dbw_enable = data["dbw_enable"] bridge.publish_dbw_status(dbw_enable) bridge.publish_odometry(data) From cfed9b72595f61d7904ed0ae17a6f6d656a9e00e Mon Sep 17 00:00:00 2001 From: Aaron Brown Date: Fri, 1 Sep 2017 15:11:58 -0700 Subject: [PATCH 3/3] Update server.py remove the unneeded line --- ros/src/styx/server.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ros/src/styx/server.py b/ros/src/styx/server.py index 6583d111f1..a356bfbfeb 100755 --- a/ros/src/styx/server.py +++ b/ros/src/styx/server.py @@ -19,7 +19,6 @@ @sio.on('connect') def connect(sid, environ): print("connect ", sid) - bridge.publish_dbw_status(False) def send(topic, data): s = 1