Updated check for missing PID parameters

This commit is contained in:
Patrick Goebel 2016-04-02 19:50:18 -07:00
parent 4853533400
commit 77a5a9a4d5

View File

@ -39,7 +39,6 @@ class BaseController:
self.timeout = rospy.get_param("~base_controller_timeout", 1.0) self.timeout = rospy.get_param("~base_controller_timeout", 1.0)
self.odom_linear_scale_correction = rospy.get_param("~odom_linear_scale_correction", 1.0) self.odom_linear_scale_correction = rospy.get_param("~odom_linear_scale_correction", 1.0)
self.odom_angular_scale_correction = rospy.get_param("~odom_angular_scale_correction", 1.0) self.odom_angular_scale_correction = rospy.get_param("~odom_angular_scale_correction", 1.0)
self.use_imu_heading = rospy.get_param("~use_imu_heading", False)
self.stopped = False self.stopped = False
pid_params = dict() pid_params = dict()
@ -101,7 +100,7 @@ class BaseController:
# Check to see if any PID parameters are missing # Check to see if any PID parameters are missing
missing_params = False missing_params = False
for param in pid_params: for param in pid_params:
if pid_params[param] == "": if pid_params[param] is None or pid_params[param] == "":
print("*** PID Parameter " + param + " is missing. ***") print("*** PID Parameter " + param + " is missing. ***")
missing_params = True missing_params = True
@ -130,7 +129,7 @@ class BaseController:
self.bad_encoder_count += 1 self.bad_encoder_count += 1
rospy.logerr("Encoder exception count: " + str(self.bad_encoder_count)) rospy.logerr("Encoder exception count: " + str(self.bad_encoder_count))
return return
dt = now - self.then dt = now - self.then
self.then = now self.then = now
dt = dt.to_sec() dt = dt.to_sec()