Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

carla_map.get_waypoint(location) #11

Open
MNikdan opened this issue Aug 28, 2020 · 7 comments
Open

carla_map.get_waypoint(location) #11

MNikdan opened this issue Aug 28, 2020 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@MNikdan
Copy link

MNikdan commented Aug 28, 2020

Hello.

I'm trying to visualize the predictions of DIM agent. I was able to do so by using the carnovel benchmark. But in the output videos, the car does not exactly follow the prediction.

Here's a sample of the generated outputs. As you can see in the video, the car is not following the red line.
dim.zip

Is there a constraint that prevents the car from getting out of lane?

@hzakerynia
Copy link

I have the same problem.

@filangelos
Copy link
Contributor

Hi @MNikdan and @hzakerynia,

There is no constraint that prevents the car from getting out of the lane!

The reason why you observe this behaviour is due to the way predictions are consumed by the SetPointAgent: There are a few key arguments in the initialization of the Agent that you can play with and observe their impact on how the agent behaves with respect to the predictions:

  • setpoint_index: This is the index of the point that the PID controller uses to control the steering and throttle/brake. All the points after this index can be ignored.
  • replan_every_steps: This specifies the frequency that the agent replans (e.g., you can think of that as MPC-like).

For example, by setting setpoint_index=5 and replan_every_steps=1 (the default values), the agent:

  1. generates a prediction with shape [40, 2],
  2. it keeps only the first [5, 2] (as specified by setpoint_index),
  3. it uses these points to calculate the target speed and the steering angle,
  4. it performs a single step in the environment,
  5. repeat...

If you look carefully at the videos you will see that the agent is really following the setpoint_index point at each timestep. An experiment I would recommend you try is setting replan_every_steps=35 (or something close to 40) and see how the agent does consume the whole prediction!

I hope that helps with your question. Let me know if there are any other related questions.

@filangelos filangelos self-assigned this Sep 2, 2020
@filangelos filangelos changed the title car not following the prediction Clarify SetPointAgent's API Sep 2, 2020
@hzakerynia
Copy link

Hi
Thanks for your answer.
I used a dummy agent that predict a constant trajectory that goes north-east with default settings.
as it's shown in this gif.zip it won't follow the prediction until there is a road.
I still think the car doesn't follow predictions if it causes an accident and I think it's because of this part that gets the setpoints from carla.

@filangelos
Copy link
Contributor

Hi @hzakerynia,

Hmm, I think you are right! I hadn't thought that carla_map.get_waypoint(location) would have such an impact! The reason we were using it was that the official CARLA PID controller expects a carla.Waypoint instead of a carla.Location object and that was the easiest way to make the typecasting.

This may require a decent amount of refactoring and we should rerun the suite of experiments and update the numbers accordingly. Let me get back to you when I have this.

At least all the methods use the very same method so there is no bias towards any of the baselines. Nonetheless, that may mean that the final scores may need to be modified.

Anyway, thank you @hzakerynia for spotting that!

@filangelos filangelos changed the title Clarify SetPointAgent's API carla_map.get_waypoint(location) Sep 4, 2020
@filangelos filangelos added the bug Something isn't working label Sep 4, 2020
@Ad4102
Copy link

Ad4102 commented Sep 28, 2020

Hello.

I'm trying to visualize the predictions of DIM agent. I was able to do so by using the carnovel benchmark. But in the output videos, the car does not exactly follow the prediction.

Here's a sample of the generated outputs. As you can see in the video, the car is not following the red line.

dim.zip

Is there a constraint that prevents the car from getting out of lane?

Hello. Can you share some insight on how do you plot the red line the the dim.zip videos. I have tried all the ways to do it but for one or the other reason I can't. I am try to use autopilot at server side.

@MNikdan MNikdan closed this as completed Sep 29, 2020
@MNikdan
Copy link
Author

MNikdan commented Sep 29, 2020

Hello.
I'm trying to visualize the predictions of DIM agent. I was able to do so by using the carnovel benchmark. But in the output videos, the car does not exactly follow the prediction.
Here's a sample of the generated outputs. As you can see in the video, the car is not following the red line.
dim.zip
Is there a constraint that prevents the car from getting out of lane?

Hello. Can you share some insight on how do you plot the red line the the dim.zip videos. I have tried all the ways to do it but for one or the other reason I can't. I am try to use autopilot at server side.

Hello. Sorry I closed the issue by mistake.
Something like this should work. Have you tried this?

import functools
from oatomobile.benchmarks.carnovel.benchmark import carnovel

agent_fn = functools.partial(
    AutopilotAgent,
    proximity_tlight_threshold=5.,
    proximity_vehicle_threshold=10.0,
    noise=0,
)

carnovel.evaluate(agent_fn, log_dir='log_dir/', subtasks_id='AbnormalTurns0-v0', monitor=True, render=False)

@MNikdan MNikdan reopened this Sep 29, 2020
@JaiChandak
Copy link

Hey @MNikdan , I am also trying to play around with testing models on the benchmark but I'm unable to get it running. I even tried running what you suggested

import functools
from oatomobile.benchmarks.carnovel.benchmark import carnovel

agent_fn = functools.partial(
    AutopilotAgent,
    proximity_tlight_threshold=5.,
    proximity_vehicle_threshold=10.0,
    noise=0,
)

carnovel.evaluate(agent_fn, log_dir='log_dir/', subtasks_id='AbnormalTurns0-v0', monitor=True, render=False)

but the script didn't do anything. This is the output at the terminal when I ran it.

pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
0it [00:00, ?it/s]

I wanted to ask if there is another way to test on the benchmark?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants