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

Add ego traffic light sensor #2

Open
wants to merge 11 commits into
base: windows
Choose a base branch
from

Conversation

hieu-nguyen-tri
Copy link
Collaborator

  • Add EgoTrafficLight passive sensor
  • This sensor publish distance to stop line and inside_intersection info

.gitmodules Outdated
@@ -1,4 +1,4 @@
[submodule "carla_msgs"]
path = carla_msgs
url = https://github.com/carla-simulator/ros-carla-msgs
branch = master
url = https://github.com/hieu-nguyen-tri/ros-carla-msgs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change this to the one hosted by ToyotaResearchInstitute plz

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

.gitmodules Outdated
url = https://github.com/carla-simulator/ros-carla-msgs
branch = master
url = https://github.com/hieu-nguyen-tri/ros-carla-msgs
branch = hieu/add-ego-traffic-light-message
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge the changes and we can just use main (or master, whichever is correct)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

return results


def get_stop_line_info(stop_line_infos: Dict[int,Dict[int, StoplineInfo]], road_id: int, lane_id: int):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no s on infos here

@hieu-nguyen-tri hieu-nguyen-tri force-pushed the hieu/add-ego-traffic-light-sensor branch from b2ff295 to 69ba3fe Compare August 31, 2022 05:04
…ResearchInstitute/ros-bridge into hieu/add-ego-traffic-light-sensor
parent=parent,
node=self.node,
actor_list=self.actors,
carla_map=self.world.get_map()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since get map is expensive, does it cause lag here? Can we pre-load the map?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you arent seeing lag we can consider not doing that, just curious.

Copy link
Collaborator Author

@hieu-nguyen-tri hieu-nguyen-tri Aug 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't notice any lag. Now when reading Carla APi documentation, it looks like this call to get the current XODR map. I think if we store it, then when a new map is loaded, I don't think the reference will have latest map. I will check it.

self. map = world.get_map() /// When a map is changed, self.map will have the old value

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I expected, when call world.load_world(), the old self.map is not updated. We need to call self.world.get_map() again.

That means the logic I have for checking if the map has been changed won't work.

Is there a way to detect map change? I tried listen to this topic: /carla/world_info but I don't see it outputs anything when the map changes either.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get map is really expensive but get map name i think is cheap. Call that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need the map object to get the waypoints that ego is currently on. Get map is called once at beginning or when a new map is loaded so I think it should be fine.

Regarding detecting if the map has changed. It will require passing the CarlaClient to ActorFactory, then pass it to whatever sensors we want to detect the map change. The reason are:

  • carla_world.id. This one doesn't change when load a new map
  • carla_client.get_world().id. This one does.

I think if we want to load a new map maybe it's better to rerun the motion sim with the new map at this point. That will make sure the rosbag correct and clean; especially, other sensors in carla rosbridge don't detect loading a new map.

Maybe hold off on merging this and let's try it on the motion platform to see if there are any delay then?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi @anrp-tri

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

Successfully merging this pull request may close these issues.

2 participants