-
Notifications
You must be signed in to change notification settings - Fork 0
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
631 feature execution check function for planned local trajectory #654
Changes from 25 commits
48ae661
576000a
f0441ad
46ce25f
a674d18
18490b3
c1424e4
1b07c0d
c84dfe3
c8d2cb8
9d463c5
467fca5
3e98b13
b32a303
6fbb236
3a0f48c
118e856
a5d498f
b603b1a
f91c9ac
bcdbbb4
8cb86c3
589ee7c
4a63321
6db0192
b5510aa
7312f34
2cf5796
7b03578
4182c57
aecbab9
2b028c9
4141310
2fa2121
9c6207c
ac8038b
ccac3ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
False | ||
True |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,7 @@ def __init__(self, name, **kwargs): | |
callback=self.lanemarkings_callback, | ||
qos_profile=1, | ||
) | ||
self.lidar_data = None | ||
self.new_subscription( | ||
topic=self.get_param("~hero_speed_topic", "/carla/hero/Speed"), | ||
msg_type=CarlaSpeedometer, | ||
|
@@ -106,6 +107,9 @@ def __init__(self, name, **kwargs): | |
self.rate = self.get_param("~map_publish_rate", 20) | ||
self.new_timer(1.0 / self.rate, self.publish_new_map) | ||
|
||
def callback(self, data: Path): | ||
self.local_trajectory = data | ||
|
||
def hero_speed_callback(self, data: CarlaSpeedometer): | ||
self.hero_speed = data | ||
|
||
|
@@ -146,6 +150,7 @@ def radar_marker_callback(self, data: MarkerArray): | |
def lidar_callback(self, data: PointCloud2): | ||
self.lidar_data = data | ||
|
||
<<<<<<<<< Temporary merge branch 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolve merge conflict. Conflicting marker ( -154 <<<<<<<<< Temporary merge branch 1
+# (Resolve or remove the conflict marker)
🧰 Tools🪛 Ruff (0.8.2)154-154: SyntaxError: Expected a statement 154-154: SyntaxError: Expected a statement 154-154: SyntaxError: Expected a statement 154-154: SyntaxError: Expected a statement 154-154: SyntaxError: Expected a statement 154-154: SyntaxError: Simple statements must be separated by newlines or semicolons 154-154: SyntaxError: Simple statements must be separated by newlines or semicolons 154-154: SyntaxError: Simple statements must be separated by newlines or semicolons |
||
def entities_from_lidar_marker(self) -> List[Entity]: | ||
data = self.lidar_marker_data | ||
if data is None or not hasattr(data, "markers") or data.markers is None: | ||
|
@@ -336,6 +341,7 @@ def publish_new_map(self, timer_event=None): | |
stamp = rospy.get_rostime() | ||
map = Map(timestamp=stamp, entities=entities) | ||
msg = map.to_ros_msg() | ||
|
||
self.map_publisher.publish(msg) | ||
|
||
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is not a "main" node of the car, I would recommend putting this in a test subfolder inside the src directory |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env python | ||
import ros_compatibility as roscomp | ||
import rospy | ||
from geometry_msgs.msg import PoseStamped | ||
from ros_compatibility.node import CompatibleNode | ||
from nav_msgs.msg import Path | ||
import random | ||
|
||
|
||
class TestPath(CompatibleNode): | ||
|
||
def __init__(self): | ||
""" | ||
This node handles the translation from the static main frame to the | ||
moving hero frame. The hero frame always moves and rotates as the | ||
ego vehicle does. The hero frame is used by sensors like the lidar. | ||
Rviz also uses the hero frame. The main frame is used for planning. | ||
""" | ||
super(TestPath, self).__init__("TestPath") | ||
self.loginfo("TestPath node started") | ||
self.local_trajectory = Path() | ||
|
||
self.publisher = self.new_publisher( | ||
msg_type=Path, | ||
topic="test_trajectory", | ||
qos_profile=1, | ||
) | ||
|
||
self.rate = 0.5 | ||
self.new_timer(0.5, self.generate_trajectory) | ||
|
||
def generate_trajectory(self, timer_event=None) -> Path: | ||
path_msg = Path() | ||
path_msg.header = rospy.Header() | ||
path_msg.header.stamp = rospy.Time.now() | ||
path_msg.header.frame_id = "hero" | ||
path_msg.poses = [] | ||
curve = 0 | ||
factor = 1 | ||
if random.uniform(-1, 1) < 0: | ||
factor = -1 | ||
|
||
for i in range(0, 10): | ||
pos = PoseStamped() | ||
pos.header.stamp = rospy.Time.now() | ||
pos.header.frame_id = "hero" | ||
curve = curve + 0.01 * i * random.uniform(0, 1) | ||
pos.pose.position.x = i | ||
pos.pose.position.y = curve * factor | ||
pos.pose.position.z = 0 | ||
pos.pose.orientation.w = 1 | ||
path_msg.poses.append(pos) | ||
|
||
self.local_trajectory = path_msg | ||
self.publisher.publish(path_msg) | ||
|
||
|
||
if __name__ == "__main__": | ||
name = "path_test_node" | ||
roscomp.init(name) | ||
node = TestPath() | ||
node.spin() |
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.
The changes in this file seem unnecessary. (lidar_data is already set to None as part of the class definition)