Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion modules/hmi/utils/hmi_status_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################

"""Helper to report status to HMI."""

import gflags
Expand Down
1 change: 0 additions & 1 deletion modules/hmi/web/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################

"""Global config access."""

import os
Expand Down
1 change: 0 additions & 1 deletion modules/hmi/web/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################

"""HTTP request handlers."""

import datetime
Expand Down
1 change: 0 additions & 1 deletion modules/hmi/web/hardware_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################

"""Hardware restful Api."""

import httplib
Expand Down
1 change: 0 additions & 1 deletion modules/hmi/web/hmi_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################

"""Entry point of the server."""

import gflags
Expand Down
1 change: 0 additions & 1 deletion modules/hmi/web/module_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################

"""Module restful Api."""

import httplib
Expand Down
4 changes: 2 additions & 2 deletions modules/hmi/web/ros_service_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################

"""HMI ros node service restful Api."""

import httplib
Expand Down Expand Up @@ -72,5 +71,6 @@ def execute_cmd(cmd_name):
return error_msg, httplib.BAD_REQUEST

status.broadcast_status_if_changed()
glog.info('Processed command "{}", and get response:{}'.format(cmd_name, response))
glog.info('Processed command "{}", and get response:{}'.format(
cmd_name, response))
return 'OK', httplib.OK
6 changes: 2 additions & 4 deletions modules/hmi/web/runtime_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################

"""Global runtime status."""

import os
Expand Down Expand Up @@ -187,9 +186,8 @@ def _calculate_playing_status(cls, modules_and_hardware_ready):
glog.info(
'RuntimeStatus::_calculate_playing_status: No file to play'
)
elif (playing_status == ToolStatus.PLAYING_CHECKING
and modules_and_hardware_ready
and tool_status.planning_ready):
elif (playing_status == ToolStatus.PLAYING_CHECKING and
modules_and_hardware_ready and tool_status.planning_ready):
tool_status.playing_status = ToolStatus.PLAYING_READY_TO_START
glog.info(
'RuntimeStatus::_calculate_playing_status: All modules/hardware are ready'
Expand Down
1 change: 0 additions & 1 deletion modules/hmi/web/runtime_status_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################

"""Runtime status restful Api."""

import httplib
Expand Down
1 change: 0 additions & 1 deletion modules/hmi/web/system_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################

"""System command utils."""

import subprocess
Expand Down
1 change: 0 additions & 1 deletion modules/hmi/web/tool_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################

"""Tools restful Api."""

import httplib
Expand Down
15 changes: 4 additions & 11 deletions modules/tools/control_info/control_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################

"""
Control Planning Analyzer
"""
Expand Down Expand Up @@ -164,10 +163,8 @@ def callback_control(self, entity):
entity.debug.simple_lon_debug.preview_acceleration_reference)
self.acc_close.append(
entity.debug.simple_lon_debug.acceleration_cmd_closeloop)
self.station_error.append(
entity.debug.simple_lon_debug.station_error)
self.speed_error.append(
entity.debug.simple_lon_debug.speed_error)
self.station_error.append(entity.debug.simple_lon_debug.station_error)
self.speed_error.append(entity.debug.simple_lon_debug.speed_error)

self.curvature.append(entity.debug.simple_lat_debug.curvature)
self.heading_error.append(entity.debug.simple_lat_debug.heading_error)
Expand Down Expand Up @@ -240,13 +237,9 @@ def long(self):
self.ax[1, 1].plot(self.controltime, self.acc_open, label='Acc Open')
self.ax[1, 1].plot(self.controltime, self.acc_close, label='Acc Close')
self.ax[1, 1].plot(
self.controltime,
self.station_error,
label='station_error')
self.controltime, self.station_error, label='station_error')
self.ax[1, 1].plot(
self.controltime,
self.speed_error,
label='speed_error')
self.controltime, self.speed_error, label='speed_error')
self.ax[1, 1].legend(fontsize='medium')
self.ax[1, 1].grid(True)
self.ax[1, 1].set_title('IMU Info')
Expand Down
1 change: 0 additions & 1 deletion modules/tools/diagnostics/Message.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################

"""
Message Handle
"""
Expand Down
1 change: 0 additions & 1 deletion modules/tools/diagnostics/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################

"""
Real Time Plotting of planning and control
"""
Expand Down
3 changes: 1 addition & 2 deletions modules/tools/dump_rosbag/dumpbag.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ def dump_bag(in_bag, out_dir, filter_topic):
"--topic",
action="store",
help="""the topic that you want to dump. If this option is not provided,
the tool will dump all the messages regardless of the message topic."""
)
the tool will dump all the messages regardless of the message topic.""")
args = parser.parse_args()

if os.path.exists(args.out_dir):
Expand Down
1 change: 1 addition & 0 deletions modules/tools/planning_traj_plot/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import gflags
from gflags import FLAGS


def find_closest_t(points_t, current_t):
if len(points_t) == 0:
return -1
Expand Down
1 change: 0 additions & 1 deletion modules/tools/realtime_plot/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################

"""
Time Value Item
"""
Expand Down
1 change: 0 additions & 1 deletion modules/tools/realtime_plot/realtime_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################

"""
Real Time Plotting of planning and control
"""
Expand Down
1 change: 0 additions & 1 deletion modules/tools/realtime_plot/stitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################

"""
S T Item
"""
Expand Down
1 change: 0 additions & 1 deletion modules/tools/realtime_plot/xyitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################

"""
X Y Item
"""
Expand Down
3 changes: 1 addition & 2 deletions modules/tools/record_play/rtk_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class RtkPlayer(object):
rtk player class
"""


def __init__(self, record_file, speedmultiplier, completepath, replan):
"""Init player."""
self.firstvalid = False
Expand Down Expand Up @@ -81,7 +80,7 @@ def __init__(self, record_file, speedmultiplier, completepath, replan):

b, a = signal.butter(6, 0.05, 'low')
self.data['acceleration'] = signal.filtfilt(b, a,
self.data['acceleration'])
self.data['acceleration'])

self.start = 0
self.end = 0
Expand Down
14 changes: 6 additions & 8 deletions modules/tools/record_play/rtk_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self, record_file):
self.file_handler = open(record_file, 'w')
except:
self.logger.error("open file %s failed" % (record_file))
self.file_handler.close();
self.file_handler.close()
sys.exit()

self.write("x,y,z,speed,acceleration,curvature,"\
Expand Down Expand Up @@ -117,7 +117,7 @@ def localization_callback(self, data):
carspeed = self.chassis.speed_mps
caracceleration = self.localization.pose.linear_acceleration_vrf.y

speed_epsilon = 1e-9;
speed_epsilon = 1e-9
if abs(self.prev_carspeed) < speed_epsilon \
and abs(carspeed) < speed_epsilon:
caracceleration = 0.0
Expand All @@ -143,10 +143,9 @@ def localization_callback(self, data):
self.cars = self.cars + carspeed * 0.01
self.write(
"%s, %s, %s, %s, %s, %s, %s, %.4f, %s, %s, %s, %s, %s, %s\n" %
(carx, cary, carz, carspeed, caracceleration,
self.carcurvature, carcurvature_change_rate, cartime,
cartheta, cargear, self.cars,
self.chassis.throttle_percentage,
(carx, cary, carz, carspeed, caracceleration, self.carcurvature,
carcurvature_change_rate, cartime, cartheta, cargear,
self.cars, self.chassis.throttle_percentage,
self.chassis.brake_percentage,
self.chassis.steering_percentage))
self.logger.debug(
Expand Down Expand Up @@ -174,8 +173,7 @@ def main(argv):
rospy.init_node('rtk_recorder', anonymous=True)

argv = FLAGS(argv)
log_dir = os.path.dirname(
os.path.abspath(__file__)) + "/../../../data/log/"
log_dir = os.path.dirname(os.path.abspath(__file__)) + "/../../../data/log/"
if not os.path.exists(log_dir):
os.makedirs(log_dir)
Logger.config(
Expand Down