Skip to content

Commit

Permalink
Added new message types Trajectory and Navigation Point.
Browse files Browse the repository at this point in the history
Added Behaviour Enum in localplanning/utils.py
  • Loading branch information
seefelke committed Nov 21, 2024
1 parent 58b266f commit cfbd170
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 7 deletions.
23 changes: 16 additions & 7 deletions code/planning/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ project(planning)
find_package(catkin REQUIRED COMPONENTS
perception
rospy
rosout
roslaunch
std_msgs
geometry_msgs
message_generation
)

roslaunch_add_file_check(launch)
Expand Down Expand Up @@ -48,9 +51,11 @@ catkin_python_setup()
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)

## Generate messages in the 'msg' folder
# add_message_files(
# MinDistance.msg
# )
add_message_files(
FILES
NavigationPoint.msg
Trajectory.msg
)

## Generate services in the 'srv' folder
# add_service_files(
Expand All @@ -67,9 +72,12 @@ catkin_python_setup()
# )

## Generate added messages and services with any dependencies listed here
# generate_messages(
# perception
# )
generate_messages(
DEPENDENCIES
std_msgs
perception
geometry_msgs
)

################################################
## Declare ROS dynamic reconfigure parameters ##
Expand Down Expand Up @@ -105,7 +113,8 @@ catkin_package(
# LIBRARIES planning
# CATKIN_DEPENDS other_catkin_pkg
# DEPENDS system_lib
CATKIN_DEPENDS perception rospy
# CATKIN_DEPENDS perception rospy
CATKIN_DEPENDS message_runtime
)

###########
Expand Down
3 changes: 3 additions & 0 deletions code/planning/msg/NavigationPoint.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
geometry_msgs/Point position
float32 speed
uint8 behaviour
2 changes: 2 additions & 0 deletions code/planning/msg/Trajectory.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Header header
planning/NavigationPoint[] navigationPoints
4 changes: 4 additions & 0 deletions code/planning/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
<!-- <test_depend>gtest</test_depend> -->
<!-- Use doc_depend for packages you need only for building documentation: -->
<!-- <doc_depend>doxygen</doc_depend> -->
<build_depend>message_generation</build_depend>
<exec_depend>message_runtime</exec_depend>

<build_depend>rospy</build_depend>
<build_depend>roslaunch</build_depend>

Expand All @@ -57,6 +60,7 @@
<exec_depend>carla_msgs</exec_depend>
<exec_depend>sensor_msgs</exec_depend>
<exec_depend>std_msgs</exec_depend>
<exec_depend>geometry_msgs</exec_depend>
<exec_depend>perception</exec_depend>

<build_depend>perception</build_depend>
Expand Down
7 changes: 7 additions & 0 deletions code/planning/src/local_planner/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import math
import carla
import os
from enum import IntEnum

# import rospy

Expand All @@ -23,6 +24,12 @@
EARTH_RADIUS_EQUA = 6378137.0


# getattr(Behaviour, "name").value returns the ID
# Behaviour(id) returns Behaviour.NAME
class Behaviour(IntEnum):
CRUISING = 0


def get_distance(pos_1, pos_2):
"""Calculate the distance between two positions
Expand Down

0 comments on commit cfbd170

Please sign in to comment.