Skip to content

How can I let the vehicle run by my path #6928

Closed Answered by lbyoo
lbyoo asked this question in Q&A
Discussion options

You must be logged in to vote

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())

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by lbyoo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants