-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: windows
Are you sure you want to change the base?
Conversation
hieu-nguyen-tri
commented
Aug 29, 2022
- 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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
carla_ros_bridge/src/carla_ros_bridge/ego_traffic_light_sensor.py
Outdated
Show resolved
Hide resolved
b2ff295
to
69ba3fe
Compare
…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() |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi @anrp-tri
58c01e0
to
272ede7
Compare