Skip to content

Commit

Permalink
Merge branch 'main' into 500-general-add-an-overview-of-the-perceptio…
Browse files Browse the repository at this point in the history
…n-in-the-documentation
  • Loading branch information
asamluka authored Dec 15, 2024
2 parents b506f0e + 727f1d5 commit 0286e81
Show file tree
Hide file tree
Showing 84 changed files with 3,238 additions and 539 deletions.
28 changes: 15 additions & 13 deletions .github/ISSUE_TEMPLATE/BUG.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ body:
- The car detects traffic lights on Map1 correctly.
- The issue no longer occurs in similar scenarios.
- type: input
id: effort_estimate
attributes:
label: Effort Estimate
description: Approximate effort required (e.g., hours).
placeholder: Enter effort estimate.

- type: textarea
id: testability
attributes:
Expand All @@ -59,16 +52,25 @@ body:
- type: markdown
attributes:
value: |
**Add Priority Label**:
- p1: Immediate attention
- p2: High priority
- p3: Standard priority
- p4: Low priority
**Add Group Label**:
- perception: Related to sensor processing and scene understanding
- planning: Related to path planning and decision making
- acting: Related to vehicle control and actuation
- system: Related to the general behavior of the system
- research: Related to research and experimentation
- infrastructure: Related to system infrastructure and setup
**Add Labels on the Project Board**:
**Priority:**
- `Urgent`: Critical bug causing system crash, needs immediate fix.
- `High`: Major feature request or significant bug affecting many users.
- `Medium`: Minor feature request or bug with a workaround.
- `Low`: Cosmetic changes or minor improvements.
**Size:**
- `Tiny`: Small typo fix or minor code refactor. Estimated time: 30 minutes.
- `Small`: Simple bug fix or small feature addition. Estimated time: 1-2 hours.
- `Medium`: Moderate feature addition or multiple bug fixes. Estimated time: 1-2 days.
- `Large`: Major feature implementation or significant refactor. Estimated time: 1-2 weeks.
- `X-Large`: Large-scale feature or complete module overhaul. Estimated time: 2-4 weeks. Especially `EPIC` issues should
be tagged with this size.
27 changes: 15 additions & 12 deletions .github/ISSUE_TEMPLATE/FEATURE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ body:
- Detects 90% of traffic lights.
- Correctly identifies 90% of traffic light states.
- type: input
id: effort_estimate
attributes:
label: Effort Estimate
description: Approximate effort required (e.g., hours).
placeholder: Enter effort estimate.

- type: textarea
id: testability
attributes:
Expand All @@ -43,11 +36,6 @@ body:
- type: markdown
attributes:
value: |
**Add Priority Label**:
- p1: Immediate attention
- p2: High priority
- p3: Standard priority
- p4: Low priority
**Add Group Label**:
- perception: Related to sensor processing and scene understanding
Expand All @@ -56,3 +44,18 @@ body:
- system: Related to the general behavior of the system
- research: Related to research and experimentation
- infrastructure: Related to system infrastructure and setup
**Add Labels on the Project Board**:
**Priority:**
- `Urgent`: Critical bug causing system crash, needs immediate fix.
- `High`: Major feature request or significant bug affecting many users.
- `Medium`: Minor feature request or bug with a workaround.
- `Low`: Cosmetic changes or minor improvements.
**Size:**
- `Tiny`: Small typo fix or minor code refactor. Estimated time: 30 minutes.
- `Small`: Simple bug fix or small feature addition. Estimated time: 1-2 hours.
- `Medium`: Moderate feature addition or multiple bug fixes. Estimated time: 1-2 days.
- `Large`: Major feature implementation or significant refactor. Estimated time: 1-2 weeks.
- `X-Large`: Large-scale feature or complete module overhaul. Estimated time: 2-4 weeks. Especially `EPIC` issues should
be tagged with this size.
28 changes: 15 additions & 13 deletions .github/ISSUE_TEMPLATE/ISSUE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ body:
- Code review passed
- All tests passing
- type: input
id: effort_estimate
attributes:
label: Effort Estimate
description: Approximate effort required (e.g., hours).
placeholder: Enter effort estimate.

- type: textarea
id: testability
attributes:
Expand All @@ -58,16 +51,25 @@ body:
- question: Further information is requested
- wontfix: This will not be worked on
**Add Priority Label**:
- p1: Immediate attention
- p2: High priority
- p3: Standard priority
- p4: Low priority
**Add Group Label**:
- perception: Related to sensor processing and scene understanding
- planning: Related to path planning and decision making
- acting: Related to vehicle control and actuation
- system: Related to the general behavior of the system
- research: Related to research and experimentation
- infrastructure: Related to system infrastructure and setup
**Add Labels on the Project Board**:
**Priority:**
- `Urgent`: Critical bug causing system crash, needs immediate fix.
- `High`: Major feature request or significant bug affecting many users.
- `Medium`: Minor feature request or bug with a workaround.
- `Low`: Cosmetic changes or minor improvements.
**Size:**
- `Tiny`: Small typo fix or minor code refactor. Estimated time: 30 minutes.
- `Small`: Simple bug fix or small feature addition. Estimated time: 1-2 hours.
- `Medium`: Moderate feature addition or multiple bug fixes. Estimated time: 1-2 days.
- `Large`: Major feature implementation or significant refactor. Estimated time: 1-2 weeks.
- `X-Large`: Large-scale feature or complete module overhaul. Estimated time: 2-4 weeks. Especially `EPIC` issues should
be tagged with this size.
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"richardkotze.git-mob",
"ms-vscode-remote.remote-containers",
"valentjn.vscode-ltex",
"ms-python.black-formatter"
"ms-python.black-formatter",
"augustocdias.tasks-shell-input"
]
}
23 changes: 23 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "53000 leaderboard attach",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "localhost",
"port": 53000
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}/code",
"remoteRoot": "${env:PAF_CATKIN_CODE_ROOT}"
}
]
}
],
}
22 changes: 22 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Run 'catkin_make' in docker container. Choose container from list of running containers.",
"type": "shell",
"command": "docker exec -it ${input:container_name} bash -c 'cd ../../catkin_ws && source /opt/ros/noetic/setup.bash && bash devel/setup.bash && catkin_make'",
"problemMatcher": [],
"detail": "Executes 'catkin_make' selected container. Requires Tasks Shell Input Extension, in order to generate the list of containers.",
}
],
"inputs": [
{
"id": "container_name",
"type": "command",
"command": "shellCommand.execute",
"args": {
"command": "docker ps --format '{{.Names}}'",
}
}
]
}
1 change: 1 addition & 0 deletions build/agent_service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ services:
- ROS_HOSTNAME=agent
- XDG_RUNTIME_DIR=/tmp/runtime-carla
- ROUTE=/opt/leaderboard/data/routes_devtest.xml
- DEBUG_WRAPPER_DEFAULT_HOST=0.0.0.0
# Simple route without special scenarios
# - ROUTE=/workspace/code/routes/routes_simple.xml
volumes:
Expand Down
9 changes: 8 additions & 1 deletion build/docker-compose.leaderboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,11 @@ services:
extends:
file: agent_service.yaml
service: agent
command: bash -c "sleep 10 && sudo chown -R ${USER_UID}:${USER_GID} ../ && sudo chmod -R a+w ../ && python3 /opt/leaderboard/leaderboard/leaderboard_evaluator.py --debug=0 --routes=$${ROUTE} --agent=/workspace/code/agent/src/agent/agent.py --host=$${CARLA_SIM_HOST} --track=MAP"
ports:
# Reserved ports for the debugger
- "53000-53100:53000-53100"
command: |-
bash -c "sleep 10 && sudo chown -R ${USER_UID}:${USER_GID} ../ && \
sudo chmod -R a+w ../ && sudo mkdir -p $${XDG_RUNTIME_DIR} && sudo chmod 0700 $${XDG_RUNTIME_DIR} && sudo chown -R ${USER_UID}:${USER_GID} $${XDG_RUNTIME_DIR} && \
(rqt_console &) && disown -a && \
python3 /opt/leaderboard/leaderboard/leaderboard_evaluator.py --debug=0 --routes=$${ROUTE} --agent=/workspace/code/agent/src/agent/agent.py --host=$${CARLA_SIM_HOST} --track=MAP"
4 changes: 3 additions & 1 deletion build/docker/agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,10 @@ RUN source ~/.bashrc && pip install -r /workspace/requirements.txt
# Add agent code
COPY --chown=$USERNAME:$USERNAME ./code /workspace/code/

# For debugger
ENV PAF_CATKIN_CODE_ROOT=/catkin_ws/src/code
# Link code into catkin workspace
RUN ln -s /workspace/code /catkin_ws/src
RUN ln -s -T /workspace/code ${PAF_CATKIN_CODE_ROOT}

# re-make the catkin workspace
RUN source /opt/ros/noetic/setup.bash && catkin_make
Expand Down
38 changes: 9 additions & 29 deletions code/acting/launch/acting.launch
Original file line number Diff line number Diff line change
@@ -1,41 +1,21 @@
<!---->
<launch>
<arg name="role_name" default="hero" />
<arg name="control_loop_rate" default="0.05" />
<arg name="control_loop_rate" default="0.05" />

<node pkg="acting" type="velocity_controller.py" name="velocity_controller" output="screen">
<param name="control_loop_rate" value="$(arg control_loop_rate)" />
<param name="role_name" value="$(arg role_name)" />
</node>

<node pkg="acting" type="stanley_controller.py" name="stanley_controller" output="screen">
<param name="control_loop_rate" value="$(arg control_loop_rate)" />
<!--Passthrough
all messages the control package needs-->
<node pkg="acting" type="passthrough.py" name="passthrough" output="screen">
<param name="role_name" value="$(arg role_name)" />
</node>

<node pkg="acting" type="pure_pursuit_controller.py" name="pure_pursuit_controller" output="screen">
<param name="control_loop_rate" value="$(arg control_loop_rate)" />
<param name="role_name" value="$(arg role_name)" />
</node>

<node pkg="acting" type="vehicle_controller.py" name="vehicle_controller" output="screen">
<param name="control_loop_rate" value="$(arg control_loop_rate)" /> <!-- leaderboard expects commands every 0.05 seconds OTHERWISE IT LAGS REALLY BADLY-->
<param name="role_name" value="$(arg role_name)" />
</node>

<node pkg="acting" type="MainFramePublisher.py" name="MainFramePublisher" output="screen">
<param name="control_loop_rate" value="$(arg control_loop_rate)" />
<param name="role_name" value="$(arg role_name)" />
</node>

<!-- UNCOMMENT THIS TO USE THE DEBUG_NODE FOR ACTING-TESTING -->
<!-- <node pkg="acting" type="Acting_Debug_Node.py" name="Acting_Debug_Node" output="screen">
<param name="control_loop_rate" value="$(arg control_loop_rate)" />
<param name="control_loop_rate" value="$(arg control_loop_rate)" />
<param name="role_name" value="$(arg role_name)" />
</node>
-->

<!-- If you want a live rqt_plots to show up automatically, include them like following example-plot for Velocity-Controller-Testing -->
<!--node pkg="rqt_plot" type="rqt_plot" output="screen" name="velocity_test" args="/carla/hero/Speed /paf/hero/target_velocity /paf/hero/throttle /paf/hero/brake"/-->

</launch>
<include file="$(find control)/launch/control.launch">
<arg name="control_loop_rate" value="$(arg control_loop_rate)" />
</include>
</launch>
41 changes: 21 additions & 20 deletions code/acting/src/acting/MainFramePublisher.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env python

from math import pi, cos, sin
import ros_compatibility as roscomp
import rospy
from geometry_msgs.msg import PoseStamped
Expand All @@ -9,6 +7,8 @@
from scipy.spatial.transform import Rotation as R
from std_msgs.msg import Float32

import numpy as np


class MainFramePublisher(CompatibleNode):

Expand Down Expand Up @@ -49,27 +49,28 @@ def loop(timer_event=None):
if self.current_pos is None:
# conversion only works if pos is known
return
rot = -self.current_heading
pos = [0, 0, 0]
pos[0] = (
cos(rot) * self.current_pos.pose.position.x
- sin(rot) * self.current_pos.pose.position.y
)
pos[1] = (
sin(rot) * self.current_pos.pose.position.x
+ cos(rot) * self.current_pos.pose.position.y

# The following converts the current_pos as well as the current_heading
# messages we receive into tf transforms.

position = np.array(
[
self.current_pos.pose.position.x,
self.current_pos.pose.position.y,
self.current_pos.pose.position.z,
]
)
pos[2] = -self.current_pos.pose.position.z
rot_quat = R.from_euler(
"xyz", [0, 0, -self.current_heading + pi], degrees=False
).as_quat()

rotation = R.from_euler("z", self.current_heading, degrees=False).as_quat()

# The position and rotation are "the hero frame in global coordinates"
# Therefore we publish the child hero with respect to the parent global
br.sendTransform(
pos,
rot_quat,
rospy.Time.now(),
"global",
"hero",
translation=position,
rotation=rotation,
time=rospy.Time.now(),
child="hero",
parent="global",
)

self.new_timer(self.control_loop_rate, loop)
Expand Down
Loading

0 comments on commit 0286e81

Please sign in to comment.