|
@@ -195,12 +195,12 @@ class BaseController:
|
|
|
vb = dist_B/dt
|
|
|
|
|
|
#forward kinemation
|
|
|
- vx = (va + vb)/2.0
|
|
|
+ vx = (-va + vb)/2.0
|
|
|
vy = 0
|
|
|
- vth = (vb - va)/(self.wheel_track)
|
|
|
+ vth = (-va - vb)/(self.wheel_track)
|
|
|
|
|
|
- delta_x = (vx*cos(self.th) - vy*sin(self.th))*dt
|
|
|
- delta_y = (vx*sin(self.th) + vy*cos(self.th))*dt
|
|
|
+ delta_x = (vx*cos(self.th))*dt
|
|
|
+ delta_y = (vx*sin(self.th))*dt
|
|
|
delta_th = vth*dt
|
|
|
|
|
|
self.x += delta_x
|
|
@@ -325,8 +325,8 @@ class BaseController:
|
|
|
th = req.angular.z # rad/s
|
|
|
|
|
|
#Inverse Kinematic
|
|
|
- vA = (-x + 0.5*self.wheel_track*th)
|
|
|
- vB = (x + 0.5*self.wheel_track*th)
|
|
|
+ vA = -(x + 0.5*self.wheel_track*th)
|
|
|
+ vB = (x - 0.5*self.wheel_track*th)
|
|
|
|
|
|
self.v_des_AWheel = int(vA * self.ticks_per_meter / self.arduino.PID_RATE)
|
|
|
self.v_des_BWheel = int(vB * self.ticks_per_meter / self.arduino.PID_RATE)
|