Commit ea1d1489 authored by 김하경's avatar 김하경

[#1]Success/전후진 미세하게 조정

parent 2fd472a5
......@@ -13,34 +13,45 @@ pub_msg = CarlaEgoVehicleControl()
def talker():
rate = rospy.Rate(1)
sub = rospy.Subscriber('/carla/ego_vehicle/collision', CarlaCollisionEvent, verify, queue_size=10)
while not rospy.is_shutdown():
ride()
rate.sleep()
def ride():
rate = rospy.Rate(4)
print("riding")
pub_msg.reverse = False
pub_msg.throttle = 1.0
pub_msg.steer = 0.0
pub_msg.gear = 1
pub.publish(pub_msg)
rate.sleep()
def littleride():
rate = rospy.Rate(4)
print("little riding")
pub_msg.reverse = False
pub_msg.throttle = 1.0
pub_msg.steer = 0.3
pub_msg.gear = 1
pub.publish(pub_msg)
def verify(msg):
print("collide")
back()
def back():
rate = rospy.Rate(10)
rate = rospy.Rate(20)
pub_msg = CarlaEgoVehicleControl()
print("execute go back")
#pub_msg.brake = 1.0
pub_msg.reverse = True
pub_msg.throttle = 1.0
pub_msg.steer =-0.6
pub_msg.throttle = 3.0
pub_msg.steer = -0.2
pub_msg.gear = -1
pub.publish(pub_msg)
rate.sleep()
littleride()
if __name__ == '__main__':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment