-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '106-feature-extended-kalman-filter-for-more-precise-loc…
…ation-measurements' of https://github.com/una-auxme/paf23 into 106-feature-extended-kalman-filter-for-more-precise-location-measurements
- Loading branch information
Showing
61 changed files
with
302 additions
and
886 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,5 @@ code/output | |
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
|
||
*.tsv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<launch> | ||
<arg name="role_name" default="hero" /> | ||
<arg name="control_loop_rate" default="0.05" /> | ||
|
||
<!-- perception --> | ||
<include file="$(find perception)/launch/perception.launch"> | ||
</include> | ||
|
||
<!-- | ||
<include file="$(find planning_runner)/launch/planning_runner.launch"> | ||
</include> | ||
<include file="$(find mock)/launch/mock.launch"> | ||
<arg name="control_loop_rate" value="$(arg control_loop_rate)"/> | ||
<arg name="role_name" value="$(arg role_name)"/> | ||
</include> | ||
<include file="$(find acting)/launch/acting.launch"> | ||
<arg name="control_loop_rate" value="$(arg control_loop_rate)"/> | ||
<arg name="role_name" value="$(arg role_name)"/> | ||
</include> | ||
--> | ||
|
||
<node pkg="carla_manual_control" type="carla_manual_control.py" name="carla_manual_control_$(arg role_name)" output="screen"> | ||
<param name="role_name" value="$(arg role_name)"/> | ||
</node> | ||
|
||
|
||
<node pkg="rqt_gui" type="rqt_gui" name="rqt_gui"/> | ||
<node type="rviz" name="rviz" pkg="rviz" args="-d $(find agent)/config/rviz_config.rviz" /> | ||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,7 @@ add_message_files( | |
FILES | ||
Waypoint.msg | ||
LaneChange.msg | ||
TrafficLightState.msg | ||
MinDistance.msg | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
int8 state | ||
int8 GREEN=1 | ||
int8 YELLOW=4 | ||
int8 RED=2 | ||
int8 UNKNOWN=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
/dataset | ||
/models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
code/perception/src/traffic_light_detection/dvclive/metrics.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"train": { | ||
"accuracy": 92.26495726495727, | ||
"loss": 0.03128106306251298 | ||
}, | ||
"validation": { | ||
"accuracy": 91.36125654450262, | ||
"loss": 0.031184170882739323 | ||
}, | ||
"step": 99 | ||
} |
Binary file added
BIN
+10.8 KB
code/perception/src/traffic_light_detection/models/model_acc_92.48_val_91.88.pt
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
train: | ||
epochs: 100 | ||
epochs: 20 | ||
batch_size: 32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from ros_compatibility.node import CompatibleNode | ||
import ros_compatibility as roscomp | ||
from rospy.numpy_msg import numpy_msg | ||
from sensor_msgs.msg import Image as ImageMsg | ||
from perception.msg import TrafficLightState | ||
from cv_bridge import CvBridge | ||
from traffic_light_detection.src.traffic_light_detection.traffic_light_inference \ | ||
import TrafficLightInference # noqa: E501 | ||
|
||
|
||
class TrafficLightNode(CompatibleNode): | ||
def __init__(self, name, **kwargs): | ||
super().__init__(name, **kwargs) | ||
# general setup | ||
self.bridge = CvBridge() | ||
self.role_name = self.get_param("role_name", "hero") | ||
self.side = self.get_param("side", "Center") | ||
self.classifier = TrafficLightInference(self.get_param("model", "")) | ||
|
||
# publish / subscribe setup | ||
self.setup_camera_subscriptions() | ||
self.setup_traffic_light_publishers() | ||
|
||
def setup_camera_subscriptions(self): | ||
self.new_subscription( | ||
msg_type=numpy_msg(ImageMsg), | ||
callback=self.handle_camera_image, | ||
topic=f"/paf/{self.role_name}/{self.side}/segmented_traffic_light", | ||
qos_profile=1 | ||
) | ||
|
||
def setup_traffic_light_publishers(self): | ||
self.traffic_light_publisher = self.new_publisher( | ||
msg_type=TrafficLightState, | ||
topic=f"/paf/{self.role_name}/{self.side}/traffic_light_state", | ||
qos_profile=1 | ||
) | ||
|
||
def handle_camera_image(self, image): | ||
result = self.classifier(self.bridge.imgmsg_to_cv2(image)) | ||
|
||
# 1: Green, 2: Red, 4: Yellow, 0: Unknown | ||
msg = TrafficLightState() | ||
msg.state = result if result in [1, 2, 4] else 0 | ||
|
||
self.traffic_light_publisher.publish(msg) | ||
|
||
def run(self): | ||
self.spin() | ||
|
||
|
||
if __name__ == "__main__": | ||
roscomp.init("TrafficLightNode") | ||
node = TrafficLightNode("TrafficLightNode") | ||
node.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.