-
carla version 0.9.14 I hope the car first run 20m in the second lane then change to left lane, back to the second lane after run 40m. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
the following is my simple code to verify the agent, it's still wrong. import sys client = carla.Client('localhost', 2000, worker_threads=1) settings = world.get_settings() try: finally: |
Beta Was this translation helpful? Give feedback.
-
I found the answer, because I create the agent before first tick(), the vehicle's location is still (0,0,0), then leads to the wrong actions. agent = None while True: |
Beta Was this translation helpful? Give feedback.
-
yes, I faced the same problem, carla.TrafficManagement.se_path is not useful, I'll try your solution, Thank you |
Beta Was this translation helpful? Give feedback.
I found the answer, because I create the agent before first tick(), the vehicle's location is still (0,0,0), then leads to the wrong actions.
I move the agent creation after tick() , the question resolved.
just like this:
agent = None
while True:
world.tick()
if agent == None:
agent = Agent(vehicle)
agent.set_destination(dest)
vehicle.apply_control(agent.run_step())