-
Notifications
You must be signed in to change notification settings - Fork 1
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
OpenPCDet LiDar Object Detection Node #73
Open
danielrhuynh
wants to merge
78
commits into
main
Choose a base branch
from
openpcdet-dan
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
78 commits
Select commit
Hold shift + click to select a range
aa95f29
base node for openpcdet
danielrhuynh ff4a955
copied dockerfile for openpcdet
danielrhuynh 4455065
working package in ros
danielrhuynh 1af45db
ig we dont need these
danielrhuynh 47b7163
added python package if I want to use that
danielrhuynh a42c5d6
adding ros node
danielrhuynh afddd09
made node and WIP on dockerfile
danielrhuynh 9a072d9
builds with cuda and I can run the setup script :)
danielrhuynh 00eec7b
Adding OpenCV
danielrhuynh 3fad1f7
ROS node runs and makes a single inference on a .bin!
danielrhuynh cab5d52
Foxglove integration and bounding boxes
danielrhuynh 9832d19
aligned lidar data with bounding boxes
danielrhuynh c0aa3e8
changing to work with wato fork of openpcdet
danielrhuynh 424af34
base node for openpcdet
danielrhuynh 46441ba
copied dockerfile for openpcdet
danielrhuynh e966132
working package in ros
danielrhuynh 257407e
ig we dont need these
danielrhuynh f1c47c0
added python package if I want to use that
danielrhuynh db7c638
adding ros node
danielrhuynh cec4f6d
made node and WIP on dockerfile
danielrhuynh 1a7eedf
builds with cuda and I can run the setup script :)
danielrhuynh 0346da7
Adding OpenCV
danielrhuynh 3164865
ROS node runs and makes a single inference on a .bin!
danielrhuynh 6ac0f6d
Foxglove integration and bounding boxes
danielrhuynh 58f0e19
aligned lidar data with bounding boxes
danielrhuynh 2480fd4
changing to work with wato fork of openpcdet
danielrhuynh 128cb63
Merge branch 'openpcdet-dan' of https://github.com/WATonomous/wato_mo…
danielrhuynh 41e1296
updated
danielrhuynh 3071625
we're changing this to copy for now since we want to clone OpenPCDet …
danielrhuynh 9f177c6
renaming package
danielrhuynh 6d08576
WIP
danielrhuynh 41254e2
WIP integrating with watod
danielrhuynh 95fd8cc
integrated with watod :)
danielrhuynh 48c76f1
now runs on same frame
danielrhuynh 2ab5305
working with ros bags
danielrhuynh 0eb740c
removing dependancy on static .bin
danielrhuynh 517fba2
refactoring
danielrhuynh 97676f7
Update watod-config.sh
danielrhuynh 95ec494
re-enabling other services
danielrhuynh 4a0f73a
Working with wato ros bags
danielrhuynh 17797ad
refactored
danielrhuynh bf996be
changing to kitti model and making data loader more flexible
danielrhuynh e208d6a
Merge branch 'main' into openpcdet-dan
danielrhuynh a5dcdfa
Update watod-config.sh
danielrhuynh 775515f
Clean up dockerfile and fix missing config file
Gongsta b3b4948
Update config files and cleanup publisher
Gongsta 257a53b
updates
danielrhuynh 29aefff
Merge branch 'main' into openpcdet-dan
danielrhuynh 3112963
experimenting
danielrhuynh ed1b548
Merge branch 'openpcdet-dan' of https://github.com/WATonomous/wato_mo…
danielrhuynh 4b9b36f
Fix styling
Gongsta ec95c6f
Added thresholding
danielrhuynh 1331dc2
WIP: added timestamps to (x,y,z,intensity) data to make them nuscenes…
danielrhuynh 002f29b
updated data loader + mounted bevfusion pth
danielrhuynh 0f7b407
better data loader :)
danielrhuynh b31e331
fixed bounding box orientation issues
dylanwang0 f15eb0f
implementing simple time syncer for messages
danielrhuynh fc8d18a
messing with confidence
danielrhuynh 0efbca2
Merge branch 'main' into openpcdet-dan
danielrhuynh 92723b6
fixing styling
danielrhuynh 0fd32e0
fixing styling again
danielrhuynh d0c6005
styling
danielrhuynh 06cb03a
removing old modules
danielrhuynh c643b43
skip CI for lidar
danielrhuynh 6a28e25
PR comments
danielrhuynh 08b6b05
Merge branch 'main' into openpcdet-dan
danielrhuynh 8c9f195
setting bounding box to be optional in configs
danielrhuynh a0b046f
fixing pep8
danielrhuynh 824b238
autopep8
danielrhuynh c4f3705
autopep8
danielrhuynh 93edc19
autopep8
danielrhuynh a45626f
fixing docker staging issue
danielrhuynh 43870bb
added label server
danielrhuynh 2055cd3
Merge branch 'main' into openpcdet-dan
danielrhuynh 34e0a21
linter
danielrhuynh 210d3cb
Merge branch 'openpcdet-dan' of https://github.com/WATonomous/wato_mo…
danielrhuynh 43628a4
linter
danielrhuynh d72d2dc
for linter
danielrhuynh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
81 changes: 59 additions & 22 deletions
81
docker/perception/lidar_object_detection/lidar_object_detection.Dockerfile
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,55 +1,92 @@ | ||
ARG BASE_IMAGE=ghcr.io/watonomous/wato_monorepo/base:humble-ubuntu22.04 | ||
|
||
ARG BASE_IMAGE=ghcr.io/watonomous/wato_monorepo/base:cuda11.7-humble-ubuntu22.04-devel | ||
################################ Source ################################ | ||
FROM ${BASE_IMAGE} as source | ||
|
||
WORKDIR ${AMENT_WS}/src | ||
|
||
# Copy in source code | ||
COPY src/perception/lidar_object_detection lidar_object_detection | ||
COPY src/wato_msgs/sample_msgs sample_msgs | ||
|
||
# Scan for rosdeps | ||
RUN apt-get -qq update && rosdep update && \ | ||
rosdep install --from-paths . --ignore-src -r -s \ | ||
| grep 'apt-get install' \ | ||
| awk '{print $3}' \ | ||
| sort > /tmp/colcon_install_list | ||
|
||
| grep 'apt-get install' \ | ||
| awk '{print $3}' \ | ||
| sort > /tmp/colcon_install_list | ||
WORKDIR /home/bolty | ||
RUN git clone https://github.com/WATonomous/OpenPCDet.git && \ | ||
cd OpenPCDet \ | ||
&& git checkout 06fd4f862329625ff9ed850464330816e54531f8 | ||
################################ INSTALL OpenCV with CUDA Support ############## | ||
WORKDIR /opt | ||
RUN git clone -b 4.x https://github.com/opencv/opencv.git && \ | ||
cd opencv && git checkout 4.5.5 | ||
RUN git clone -b 4.x https://github.com/opencv/opencv_contrib.git && \ | ||
cd opencv_contrib && git checkout 4.5.5 | ||
WORKDIR /opt/opencv/build | ||
RUN cmake -D CMAKE_BUILD_TYPE=RELEASE \ | ||
-D CMAKE_INSTALL_PREFIX=/usr/local \ | ||
-D OPENCV_GENERATE_PKGCONFIG=ON \ | ||
-D BUILD_EXAMPLES=OFF \ | ||
-D INSTALL_PYTHON_EXAMPLES=OFF \ | ||
-D INSTALL_C_EXAMPLES=OFF \ | ||
-D PYTHON_EXECUTABLE=$(which python3) \ | ||
-D PYTHON3_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \ | ||
-D PYTHON3_PACKAGES_PATH=$(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \ | ||
-D BUILD_opencv_python3=ON \ | ||
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules/ \ | ||
-D WITH_GSTREAMER=ON \ | ||
-D WITH_CUDA=ON \ | ||
-D ENABLE_PRECOMPILED_HEADERS=OFF \ | ||
.. && make -j$(nproc) && make install && ldconfig | ||
RUN rm -rf /opt/opencv /opt/opencv_contrib | ||
################################# Dependencies ################################ | ||
FROM ${BASE_IMAGE} as dependencies | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
git zip unzip libssl-dev libcairo2-dev lsb-release libgoogle-glog-dev libgflags-dev libatlas-base-dev libeigen3-dev software-properties-common \ | ||
build-essential cmake pkg-config libapr1-dev autoconf automake libtool curl libc6 libboost-all-dev debconf libomp5 libstdc++6 \ | ||
libqt5core5a libqt5xml5 libqt5gui5 libqt5widgets5 libqt5concurrent5 libqt5opengl5 libcap2 libusb-1.0-0 libatk-adaptor neovim \ | ||
python3-pip python3-setuptools \ | ||
&& apt-get -qq autoremove -y && apt-get -qq autoclean && apt-get -qq clean && \ | ||
rm -rf /var/lib/apt/lists/* /root/* /root/.ros /tmp/* /usr/share/doc | ||
# Set environment variables | ||
ENV CUDA_HOME /usr/local/cuda | ||
ENV LD_LIBRARY_PATH /usr/local/cuda/lib64:${LD_LIBRARY_PATH} | ||
ENV PATH /usr/local/cuda/bin:${PATH} | ||
ENV OpenCV_DIR=/usr/share/OpenCV | ||
# Install Python dependencies | ||
RUN pip3 install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu116 | ||
RUN pip3 install torch-scatter -f https://data.pyg.org/whl/torch-1.13.1+cu116.html | ||
ENV TORCH_CUDA_ARCH_LIST="3.5;5.0;6.0;6.1;7.0;7.5;8.0;8.6+PTX" | ||
RUN pip3 install spconv-cu116 pyquaternion numpy==1.23 pillow==8.4 mayavi open3d av2 | ||
# Install Rosdep requirements | ||
COPY --from=source /tmp/colcon_install_list /tmp/colcon_install_list | ||
RUN apt-get update && apt-fast update | ||
RUN apt-fast install -qq -y --no-install-recommends $(cat /tmp/colcon_install_list) | ||
|
||
# Copy in source code from source stage | ||
WORKDIR ${AMENT_WS} | ||
COPY --from=source ${AMENT_WS}/src src | ||
|
||
# Dependency Cleanup | ||
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/* | ||
|
||
################################ Build ################################ | ||
################################ Build ####################################### | ||
FROM dependencies as build | ||
|
||
COPY --from=source /home/bolty/OpenPCDet /home/bolty/OpenPCDet | ||
WORKDIR /home/bolty/OpenPCDet | ||
RUN pip3 install -r requirements.txt | ||
RUN pip3 install kornia==0.6.8 | ||
RUN pip3 install nuscenes-devkit==1.0.5 | ||
WORKDIR /home/bolty/OpenPCDet | ||
RUN python3 setup.py develop | ||
# Build ROS2 packages | ||
WORKDIR ${AMENT_WS} | ||
RUN . /opt/ros/$ROS_DISTRO/setup.sh && \ | ||
colcon build \ | ||
--cmake-args -DCMAKE_BUILD_TYPE=Release | ||
|
||
--cmake-args -DCMAKE_BUILD_TYPE=Release | ||
# Entrypoint will run before any CMD on launch. Sources ~/opt/<ROS_DISTRO>/setup.bash and ~/ament_ws/install/setup.bash | ||
COPY docker/wato_ros_entrypoint.sh ${AMENT_WS}/wato_ros_entrypoint.sh | ||
ENTRYPOINT ["./wato_ros_entrypoint.sh"] | ||
|
||
################################ Prod ################################ | ||
################################ Prod ######################################### | ||
FROM build as deploy | ||
|
||
# Source Cleanup and Security Setup | ||
RUN chown -R $USER:$USER ${AMENT_WS} | ||
RUN rm -rf src/* | ||
|
||
USER ${USER} |
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 was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
src/perception/lidar_object_detection/lidar_object_detection/config/eve_config.yaml
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 @@ | ||
lidar_object_detection_node: | ||
ros__parameters: | ||
lidar_topic: /velodyne_points | ||
model_config_path: /home/bolty/OpenPCDet/tools/cfgs/nuscenes_models/transfusion_lidar.yaml | ||
model_path: /home/bolty/OpenPCDet/models/transfusion_trained_model.pth |
6 changes: 6 additions & 0 deletions
6
src/perception/lidar_object_detection/lidar_object_detection/config/nuscenes_config.yaml
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,6 @@ | ||
lidar_object_detection_node: | ||
ros__parameters: | ||
lidar_topic: /LIDAR_TOP | ||
model_config_path: /home/bolty/OpenPCDet/tools/cfgs/nuscenes_models/transfusion_lidar.yaml | ||
model_path: /home/bolty/OpenPCDet/models/cbgs_transfusion_lidar.pth | ||
enable_detection: true |
27 changes: 27 additions & 0 deletions
27
src/perception/lidar_object_detection/lidar_object_detection/launch/eve_launch.py
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,27 @@ | ||
from launch import LaunchDescription | ||
from launch_ros.actions import Node | ||
from ament_index_python.packages import get_package_share_directory | ||
import os | ||
|
||
|
||
def generate_launch_description(): | ||
ld = LaunchDescription() | ||
config = os.path.join( | ||
get_package_share_directory('lidar_object_detection'), | ||
'config', | ||
'eve_config.yaml' | ||
) | ||
|
||
# nodes | ||
lidar_object_detection = Node( | ||
package='lidar_object_detection', | ||
executable='lidar_object_detection_node', | ||
name='lidar_object_detection_node', | ||
parameters=[config], | ||
arguments=['--ros-args', '--log-level', 'info'] | ||
) | ||
|
||
# finalize | ||
ld.add_action(lidar_object_detection) | ||
|
||
return ld |
27 changes: 27 additions & 0 deletions
27
src/perception/lidar_object_detection/lidar_object_detection/launch/nuscenes_launch.py
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,27 @@ | ||
from launch import LaunchDescription | ||
from launch_ros.actions import Node | ||
from ament_index_python.packages import get_package_share_directory | ||
import os | ||
|
||
|
||
def generate_launch_description(): | ||
ld = LaunchDescription() | ||
config = os.path.join( | ||
get_package_share_directory('lidar_object_detection'), | ||
'config', | ||
'nuscenes_config.yaml' | ||
) | ||
|
||
# nodes | ||
lidar_object_detection = Node( | ||
package='lidar_object_detection', | ||
executable='lidar_object_detection_node', | ||
name='lidar_object_detection_node', | ||
parameters=[config], | ||
arguments=['--ros-args', '--log-level', 'info'] | ||
) | ||
|
||
# finalize | ||
ld.add_action(lidar_object_detection) | ||
|
||
return ld |
Empty file.
37 changes: 37 additions & 0 deletions
37
...tion/lidar_object_detection/lidar_object_detection/lidar_object_detection/label_server.py
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,37 @@ | ||
#!/usr/bin/env python | ||
|
||
import rclpy | ||
from rclpy.node import Node | ||
from vision_msgs.msg import VisionInfo | ||
|
||
|
||
class LabelServer(Node): | ||
def __init__(self): | ||
super().__init__('label_server') | ||
self.publisher_ = self.create_publisher(VisionInfo, 'vision_info', 10) | ||
self.label_mapping = { | ||
1: "car", | ||
2: "pedestrian", | ||
3: "cyclist", | ||
} | ||
self.publish_labels() | ||
|
||
def publish_labels(self): | ||
vision_info_msg = VisionInfo() | ||
vision_info_msg.database_location = "memory" | ||
vision_info_msg.database_version = "1.0" | ||
for label_id, class_name in self.label_mapping.items(): | ||
vision_info_msg.class_map[label_id] = class_name | ||
self.publisher_.publish(vision_info_msg) | ||
|
||
|
||
def main(args=None): | ||
rclpy.init(args=args) | ||
label_server = LabelServer() | ||
rclpy.spin(label_server) | ||
label_server.destroy_node() | ||
rclpy.shutdown() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
wrong package
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.
This is for depth estimation?