3 from dataspeed_ulc_can
import Speed
9 rospy.init_node(
'speed_square_wave')
10 super(SpeedSquareWave, self).
__init__()
14 if self.
v1 == 0
and self.
v2 == 0:
15 rospy.logwarn_throttle(1.0,
'both speed targets are zero')
17 if self.
t >= self.period:
20 self.ulc_cmd.linear_velocity = self.
v1 21 elif self.
t >= 0.5 * self.period:
24 self.ulc_cmd.linear_velocity = self.
v2 28 self.ulc_cmd.linear_velocity = self.
v1 30 self.pub_ulc_cmd.publish(self.ulc_cmd)
33 if __name__ ==
'__main__':
37 except rospy.ROSInterruptException:
def timer_callback(self, event)