mirror of
https://github.com/YikeStone/ros_arduino_bridge.git
synced 2025-08-03 19:24:09 +05:30
Updated check for missing PID parameters
This commit is contained in:
parent
4853533400
commit
77a5a9a4d5
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user