提交 972a1cc5 编写于 作者: F freeHackOfJeff 提交者: Xiangquan Xiao

Tools: rtk code consolidation

上级 b8858697
...@@ -60,7 +60,7 @@ class RtkPlayer(object): ...@@ -60,7 +60,7 @@ class RtkPlayer(object):
self.logger.info("Load record file from: %s" % record_file) self.logger.info("Load record file from: %s" % record_file)
try: try:
file_handler = open(record_file, 'r') file_handler = open(record_file, 'r')
except: except IOError:
self.logger.error("Cannot find file: " + record_file) self.logger.error("Cannot find file: " + record_file)
file_handler.close() file_handler.close()
sys.exit(0) sys.exit(0)
...@@ -185,7 +185,7 @@ class RtkPlayer(object): ...@@ -185,7 +185,7 @@ class RtkPlayer(object):
self.sequence_num = self.sequence_num + 1 self.sequence_num = self.sequence_num + 1
self.logger.debug( self.logger.debug(
"publish_planningmsg: before adjust start: self.start = %s, self.end=%s" "publish_planningmsg: before adjust start: self.start=%s, self.end=%s"
% (self.start, self.end)) % (self.start, self.end))
if self.replan or self.sequence_num <= 1 or not self.automode: if self.replan or self.sequence_num <= 1 or not self.automode:
self.logger.info( self.logger.info(
...@@ -209,7 +209,7 @@ class RtkPlayer(object): ...@@ -209,7 +209,7 @@ class RtkPlayer(object):
self.end = len(self.data) - 1 self.end = len(self.data) - 1
self.logger.debug( self.logger.debug(
"publish_planningmsg: after adjust start: self.start = %s, self.end=%s" "publish_planningmsg: after adjust start: self.start=%s, self.end=%s"
% (self.start, self.end)) % (self.start, self.end))
planningdata.total_path_length = self.data['s'][self.end] - \ planningdata.total_path_length = self.data['s'][self.end] - \
......
...@@ -135,13 +135,13 @@ class RtkRecord(object): ...@@ -135,13 +135,13 @@ class RtkRecord(object):
cargear = self.chassis.gear_location cargear = self.chassis.gear_location
if abs(carspeed) >= speed_epsilon: if abs(carspeed) >= speed_epsilon:
if self.startmoving == False: if self.startmoving is False:
self.logger.info( self.logger.info(
"carspeed !=0 and startmoving is False, Start Recording") "carspeed !=0 and startmoving is False, Start Recording")
self.startmoving = True self.startmoving = True
if self.startmoving: if self.startmoving:
self.cars = self.cars + carspeed * 0.01 self.cars += carspeed * 0.01
self.write( self.write(
"%s, %s, %s, %s, %s, %s, %s, %.4f, %s, %s, %s, %s, %s, %s\n" % "%s, %s, %s, %s, %s, %s, %s, %.4f, %s, %s, %s, %s, %s, %s\n" %
(carx, cary, carz, carspeed, caracceleration, self.carcurvature, (carx, cary, carz, carspeed, caracceleration, self.carcurvature,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册