Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions docker/workspace-build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,31 +55,31 @@ RUN echo "source /etc/bash_completion" >> ~/.bashrc \

## Acquire and install NVIDIA CUDA 12.5
## * This is required for the ZED SDK installation.
#RUN --mount=type=cache,target=/root/nvidia,sharing=locked \
# wget https://developer.download.nvidia.com/compute/cuda/12.5.0/local_installers/cuda_12.5.0_555.42.02_linux.run \
# --no-verbose -c -O /root/nvidia/cuda_12.5.0_555.42.02_linux.run \
# && chmod +x /root/nvidia/cuda_12.5.0_555.42.02_linux.run \
# && /root/nvidia/cuda_12.5.0_555.42.02_linux.run --silent --toolkit
#ENV PATH=/usr/local/cuda-12.5/bin:${PATH}
#ENV LD_LIBRARY_PATH=/usr/local/cuda-12.5/lib64:${LD_LIBRARY_PATH}
#
RUN --mount=type=cache,target=/root/nvidia,sharing=locked \
wget https://developer.download.nvidia.com/compute/cuda/12.5.0/local_installers/cuda_12.5.0_555.42.02_linux.run \
--no-verbose -c -O /root/nvidia/cuda_12.5.0_555.42.02_linux.run \
&& chmod +x /root/nvidia/cuda_12.5.0_555.42.02_linux.run \
&& /root/nvidia/cuda_12.5.0_555.42.02_linux.run --silent --toolkit
ENV PATH=/usr/local/cuda-12.5/bin:${PATH}
ENV LD_LIBRARY_PATH=/usr/local/cuda-12.5/lib64:${LD_LIBRARY_PATH}

## Install ZED SDK and dependencies.
## We are skipping the python installation here as the pacakge version has been
## manually deduced and added to our poetry configuration to allow for its
## depedencies to be resolved along side everything else we use.
#RUN --mount=type=cache,target=/root/zed,sharing=locked \
# --mount=type=cache,target=/var/cache/apt,sharing=locked \
# --mount=type=cache,target=/var/lib/apt,sharing=locked \
# apt install zstd \
# && wget https://download.stereolabs.com/zedsdk/4.1/cu121/ubuntu20 \
# --no-verbose -c -O /root/zed/ZED_SDK_Ubuntu20_cuda12.1_v4.1.2.zstd.run \
# && chmod +x /root/zed/ZED_SDK_Ubuntu20_cuda12.1_v4.1.2.zstd.run \
# && /root/zed/ZED_SDK_Ubuntu20_cuda12.1_v4.1.2.zstd.run \
# --quiet \
# --target /root/zed/install \
# -- \
# --silent \
# --skip_python
RUN --mount=type=cache,target=/root/zed,sharing=locked \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt install zstd \
&& wget https://download.stereolabs.com/zedsdk/4.1/cu121/ubuntu20 \
--no-verbose -c -O /root/zed/ZED_SDK_Ubuntu20_cuda12.1_v4.1.2.zstd.run \
&& chmod +x /root/zed/ZED_SDK_Ubuntu20_cuda12.1_v4.1.2.zstd.run \
&& /root/zed/ZED_SDK_Ubuntu20_cuda12.1_v4.1.2.zstd.run \
--quiet \
--target /root/zed/install \
-- \
--silent \
--skip_python

# For the demo-ui
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
Expand Down
17 changes: 12 additions & 5 deletions ros/angel_utils/scripts/bag_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def __init__(self):
.string_value
)
self.pv_image_frame_id = (
self.declare_parameter("pv_image_frame_id", "PVFramesBGR")
self.declare_parameter("pv_image_frame_id", "/kitware/pv_image_detections_2d")#"PVFramesBGR")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have expected this to just need to be "pv_image_detections_2d", and the namespace under which the bag play happens does appropriate namespace prepending to messages emitted?

.get_parameter_value()
.string_value
)
Expand All @@ -146,8 +146,11 @@ def __init__(self):
self.msg_type_to_handler_map = {}
if self.extract_audio:
self.msg_type_to_handler_map[HeadsetAudioData] = self.handle_audio_msg
if self.extract_images or self.extract_depth_images:
self.msg_type_to_handler_map[Image] = self.handle_image_msg
self.log.info(f"---------- images: {self.extract_images}")
#if self.extract_images or self.extract_depth_images:

self.msg_type_to_handler_map[Image] = self.handle_image_msg

if self.extract_eye_gaze_data:
self.msg_type_to_handler_map[EyeGazeData] = self.handle_eye_gaze_msg
if self.extract_head_pose_data or self.extract_depth_head_pose_data:
Expand Down Expand Up @@ -259,7 +262,7 @@ def parse_bag(self) -> None:
self.num_total_msgs += 1

if (self.num_total_msgs % 100) == 0:
self.log.info(f"Parsing message: {self.num_total_msgs}")
self.log.info(f"Parsing message: {self.num_total_msgs} type: {type(msg)}")

# Attempt to call the message handler for this message type
try:
Expand Down Expand Up @@ -561,7 +564,8 @@ def handle_image_msg(self, msg: Image) -> None:
Converts the PV images to RGB and saves them to disk.
Converts the depth images to 16-bit grayscale and saves them to disk.
"""
if msg.encoding in ["nv12", "rgb8", "bgr8"] and self.extract_images:
print(f"Image message received: {msg.encoding}")
if msg.encoding in ["nv12", "rgb8", "rgba8", "bgr8"]: # and self.extract_images:
self.num_image_msgs += 1

if msg.encoding == "nv12":
Expand All @@ -570,6 +574,9 @@ def handle_image_msg(self, msg: Image) -> None:
else:
rgb_image = bridge.imgmsg_to_cv2(msg, msg.encoding)

if "rgb" in msg.encoding:
rgb_image = cv2.cvtColor(rgb_image, cv2.COLOR_BGRA2RGBA)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is L575 not outputting an RGB image already when the msg.encoding is "rgb"? It looks like you're converting form "BGR" to "RGB" here, but I would have expected rgb_image to already be in RGB at this point (its just maybe missing the alpha channel?).


# Save image to disk
timestamp_str = (
f"{msg.header.stamp.sec:011d}_{msg.header.stamp.nanosec:09d}"
Expand Down
1 change: 1 addition & 0 deletions tmux/demos/medical/Kitware-R18.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ windows:
-p act_topic:=activity_topic
-p pose_repeat_rate:=7.5
-p window_leads_with_objects:=true
-p output_predictions_kwcoco:=${ANGEL_WORKSPACE_DIR}/stuff/activity_predictions.kwcoco
-p model_device:=0

- task_monitor:
Expand Down
Loading