Skip to content
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

Radar driver #138

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ WORKDIR ${AMENT_WS}/src

# Copy in source code
COPY src/interfacing/sensor_interfacing sensor_interfacing
COPY src/wato_msgs/sample_msgs sample_msgs
COPY src/wato_msgs/perception_msgs/radar_msgs radar_msgs

# Scan for rosdeps
RUN apt-get -qq update && rosdep update && \
Expand All @@ -21,6 +21,7 @@ FROM ${BASE_IMAGE} as dependencies

# Install Rosdep requirements
COPY --from=source /tmp/colcon_install_list /tmp/colcon_install_list
RUN apt-get update
RUN apt-fast install -qq -y --no-install-recommends $(cat /tmp/colcon_install_list)

# Copy in source code from source stage
Expand All @@ -32,6 +33,14 @@ WORKDIR /
RUN apt-get -qq autoremove -y && apt-get -qq autoclean && apt-get -qq clean && \
rm -rf /root/* /root/.ros /tmp/* /var/lib/apt/lists/* /usr/share/doc/*

RUN apt update &&\
apt install software-properties-common -y &&\
add-apt-repository ppa:lely/ppa -y &&\
apt update &&\
apt install net-tools iproute2 can-utils kmod liblely-coapp-dev liblely-co-tools python3-dcf-tools -y

RUN apt install -y ros-$ROS_DISTRO-ros2-socketcan

################################ Build ################################
FROM dependencies as build

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ FROM ${BASE_IMAGE} as dependencies

# Install Rosdep requirements
COPY --from=source /tmp/colcon_install_list /tmp/colcon_install_list
RUN apt-get update
RUN apt-fast install -qq -y --no-install-recommends $(cat /tmp/colcon_install_list)

# Copy in source code from source stage
Expand Down
2 changes: 1 addition & 1 deletion modules/dev_overrides/docker-compose.interfacing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
image: "${INTERFACING_SENSOR_IMAGE}:build_${TAG}"
command: tail -F anything
volumes:
- ${MONO_DIR}/src/sensor_interfacing:/home/bolty/ament_ws/src/sensor_interfacing
- ${MONO_DIR}/src/interfacing/sensor_interfacing:/home/bolty/ament_ws/src/sensor_interfacing

can_interfacing:
<<: *fixuid
Expand Down
6 changes: 6 additions & 0 deletions modules/docker-compose.interfacing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ services:
- "${INTERFACING_SENSOR_IMAGE}:build_${TAG}"
- "${INTERFACING_SENSOR_IMAGE}:build_main"
target: deploy
environment:
VCAN_TARGET_PORT: 6002
ports:
- 6001:6000/udp
cap_add:
- NET_ADMIN
image: "${INTERFACING_SENSOR_IMAGE}:${TAG}"
command: /bin/bash -c "ros2 launch sensor_interfacing sensor_interfacing.launch.py"

Expand Down
14 changes: 0 additions & 14 deletions src/interfacing/sensor_interfacing/CMakeLists.txt

This file was deleted.

16 changes: 0 additions & 16 deletions src/interfacing/sensor_interfacing/package.xml

This file was deleted.

156 changes: 156 additions & 0 deletions src/interfacing/sensor_interfacing/radar_conti_ars408/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
cmake_minimum_required(VERSION 3.5)

project(radar_conti_ars408)

# Default to C++14
if(NOT "${CMAKE_CXX_STANDARD}")
set(CMAKE_CXX_STANDARD 14)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# if CMAKE_BUILD_TYPE is not specified, take 'Release' as default
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release)
ENDIF(NOT CMAKE_BUILD_TYPE)

##########################################################
####### INCLUDES AND LIBS #########
##########################################################
find_package(ament_cmake REQUIRED)
find_package(ament_index_cpp REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(example_interfaces REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(rcutils REQUIRED)
find_package(std_msgs REQUIRED)
find_package(rclcpp_lifecycle REQUIRED)
find_package(lifecycle_msgs REQUIRED)
find_package(class_loader REQUIRED)
find_package(rmw_implementation REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(can_msgs REQUIRED)
find_package(visualization_msgs REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(ament_index_cpp REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(radar_msgs REQUIRED)
find_package(bondcpp REQUIRED)
find_package(bond REQUIRED)
find_package(radar_conti_ars408_msgs REQUIRED)
find_package(ros2_socketcan REQUIRED)
##########################################################


##########################################################
####### INCLUDES AND LIBS #########
##########################################################
include_directories(
include
src
include
${rclcpp_lifecycle_INCLUDE_DIRS}
${lifecycle_msgs_INCLUDE_DIRS}
${rclcpp_INCLUDE_DIRS}
${class_loader_INCLUDE_DIRS}
${rmw_implementation_INCLUDE_DIRS}
${std_msgs_INCLUDE_DIRS}
${geometry_msgs_INCLUDE_DIRS}
${ros2_socketcan_INCLUDE_DIRS}
)
##########################################################

##########################################################
####### Component and Executable #########
##########################################################
# create ament index resource which references the libraries in the binary dir
set(node_plugins "")

add_library(radar_conti_ars408_component SHARED src/radar_conti_ars_408_component.cpp)
target_compile_definitions(radar_conti_ars408_component PRIVATE "RADAR_CONTI_ARS408_BUILDING_DLL")
target_link_libraries(radar_conti_ars408_component dl -lboost_system
${rclcpp_lifecycle_LIBRARIES}
${ament_index_cpp_LIBRARIES}
)

ament_target_dependencies(
radar_conti_ars408_component
can_msgs
radar_msgs
visualization_msgs
tf2_ros
bondcpp
bond
"rclcpp_lifecycle"
"rclcpp"
"std_msgs"
"class_loader"
"rclcpp_components"
"geometry_msgs"
ament_index_cpp
radar_conti_ars408_msgs
ros2_socketcan
)

rclcpp_components_register_nodes(radar_conti_ars408_component "watonomous::radar_conti_ars408")
set(node_plugins "${node_plugins}watonomous::radar_conti_ars408;$<TARGET_FILE:radar_conti_ars408_component>\n")

# since the package installs libraries without exporting them
# it needs to make sure that the library path is being exported
if(NOT WIN32)
ament_environment_hooks(
"${ament_cmake_package_templates_ENVIRONMENT_HOOK_LIBRARY_PATH}")
endif()


add_executable(radar_conti_ars408_composition src/radar_conti_ars_408_composition.cpp)
target_link_libraries(
radar_conti_ars408_composition
radar_conti_ars408_component
)

ament_target_dependencies(radar_conti_ars408_composition
"rclcpp"
)
##########################################################


##########################################################
############## INSTALLS ##################
##########################################################
#install executable
install(
TARGETS radar_conti_ars408_composition
DESTINATION lib/${PROJECT_NAME})

# install plugins
install(
TARGETS radar_conti_ars408_component
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)

# install header files
install(
DIRECTORY include/
DESTINATION include/${PROJECT_NAME}/
)

# Install launch files.
install(DIRECTORY
config
launch
DESTINATION share/${PROJECT_NAME}
)

##########################################################


##########################################################
########### Register package ##################
##########################################################
ament_package()
##########################################################
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
radar_node:
ros__parameters:
can_channel: "can0"
#topic name of list of objects detected
object_list_topic_name: "object_list"
#topic name of array of markers used to visualize objects detected
marker_array_topic_name: "marker_array"
#topic name of array of radar tracks detected
radar_tracks_topic_name: "radar_tracks"
#topic name of array of obstacle detected, corresponds with radar tracks
obstacle_array_topic_name: "obstacle_array"

radar_0:
#link of radar, should be relative to base_link
link_name: "front_radar_link"
#set filter active flag on filter config index
active: [true, false, false, false, false, true, false, false, true, false, false, false, false, false, false]
#set filter valid flag on filter config index
valid: [true, false, false, false, false, true, false, false, true, false, false, false, false, false, false]
filtercfg_min_nofobj: 0
filtercfg_max_nofobj: 5
filtercfg_min_distance: 0.0
filtercfg_max_distance: 409.0
filtercfg_min_azimuth: 0.0
filtercfg_max_azimuth: 100.0
filtercfg_min_vreloncome: 0.0
filtercfg_max_vreloncome: 128.0
filtercfg_min_vreldepart: 0.0
filtercfg_max_vreldepart: 128.0
filtercfg_min_rcs: 50.0
filtercfg_max_rcs: 80.0
filtercfg_min_lifetime: 0.0
filtercfg_max_lifetime: 409.0
filtercfg_min_size: 0.0
filtercfg_max_size: 102.0
filtercfg_min_probexists: 5
filtercfg_max_probexists: 7
filtercfg_min_y: 0.0
filtercfg_max_y: 818.0
filtercfg_min_x: 0.0
filtercfg_max_x: 0.0
filtercfg_min_vyrightleft: 0.0
filtercfg_max_vyrightleft: 128.0
filtercfg_min_vxoncome: 0.0
filtercfg_max_vxoncome: 128.0
filtercfg_min_vyleftright: 0.0
filtercfg_max_vyleftright: 128.0
filtercfg_min_vxdepart: 0.0
filtercfg_max_vxdepart: 128.0
Loading