Skip to content

Commit 8da040e

Browse files
committed
publishing original term and new term
1 parent 440751c commit 8da040e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

rb_ws/src/buggy/scripts/auton/stanley_controller.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ def __init__(self, buggy_name, start_index=0) -> None:
3838
self.debug_yaw_rate_publisher = rospy.Publisher(
3939
buggy_name + "/auton/debug/yaw_rate", Float64, queue_size=1
4040
)
41+
self.debug_yaw_rate2_publisher = rospy.Publisher(
42+
buggy_name + "/auton/debug/yaw_rate2", Float64, queue_size=1
43+
)
4144

4245
def compute_control(
4346
self, state_msg: Odometry, trajectory: Trajectory
@@ -126,7 +129,8 @@ def compute_control(
126129

127130
if (abs(StanleyController.K_D_YAW * (r_meas - r_traj)) > 6.0):
128131
rospy.logwarn(f"spiked yaw_rate: actual: {r_meas}, expected_basic: {r_traj}, expected_analytic: {r_traj_2}")
129-
self.debug_yaw_rate_publisher.publish(StanleyController.K_D_YAW * (r_traj_2 - r_meas))
132+
self.debug_yaw_rate_publisher.publish(StanleyController.K_D_YAW * (r_traj - r_meas))
133+
self.debug_yaw_rate2_publisher.publish(StanleyController.K_D_YAW * (r_traj_2 - r_meas))
130134

131135
steering_cmd = error_heading + cross_track_component + StanleyController.K_D_YAW * (r_traj - r_meas)
132136
steering_cmd = np.clip(steering_cmd, -np.pi / 9, np.pi / 9)

0 commit comments

Comments
 (0)