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

lag in v2x_manager #220

Open
wbw20000 opened this issue Nov 7, 2023 · 0 comments
Open

lag in v2x_manager #220

wbw20000 opened this issue Nov 7, 2023 · 0 comments

Comments

@wbw20000
Copy link

wbw20000 commented Nov 7, 2023

HI i am new to reading OpenCDA code. I may found the logic of v2x_manager add lag have improvement space !!

So i want to verfiy it with you .

The v2x_manager logic to add lag depends on the ego car pos list longer or shorter than self.lag . But in real world the comuncaiton lag mainly depends on the distance between two CAVs.Or the lag come from other issues like network congestion and so on .

the code in core/common/v2x_manager.py

** def get_ego_pos(self):
"""
Add noise and lag to the current ego position and send to other CAVs.
This is for simulate noise and lagging during communication.

    Returns
    -------
    processed_ego_pos : carla.Transform
        The ego position after adding noise and lagging.
    """
    if not self.ego_pos:
        return None

    # add lag
    ego_pos = self.ego_pos[0] if len(self.ego_pos) < self.lag else \
        self.ego_pos[np.random.randint(-1 - int(abs(self.lag)), 0)]**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant