Skip to content

Commit

Permalink
running pano build using the docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
marinagmoreira committed Jun 17, 2024
1 parent a807b20 commit e1f5d47
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
13 changes: 8 additions & 5 deletions pano/docker/pano.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,19 @@ RUN apt-get update \
hugin \
libvips-tools \
python3-pip \
gfortran libopenblas-dev libfftw3-dev \
&& rm -rf /var/lib/apt/lists/*

# pandas: pulled in as pyshtools dependency but install breaks if not mentioned explicitly (?)
# pyshtools: used during Pannellum multires generation
# snakemake: modern build system based on Python, manages stitching workflows
RUN pip3 install --no-cache-dir --upgrade pip \
&& pip3 install --no-cache-dir \
pandas \
pyshtools \
snakemake

# Install Jupyter explicitly first
RUN pip3 install --no-cache-dir --upgrade pip && \
pip3 install --no-cache-dir jupyter

# Install other Python packages
RUN pip3 install --no-cache-dir pandas pyshtools snakemake pulp==2.7 --ignore-installed PyYAML

# pannellum: library for viewing/navigating panorama tours
RUN mkdir -p /opt \
Expand Down
7 changes: 4 additions & 3 deletions pano/pano_stitch/scripts/pano_image_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import rosbag
from tf.transformations import euler_from_quaternion

IMAGE_TOPIC = "/hw/cam_sci/compressed"
IMAGE_TOPIC = ["/hw/cam_sci/compressed", "/hw/cam_sci_info"]
POSE_TOPIC = "/loc/pose"
FIELD_NAMES = (
"timestamp",
Expand All @@ -50,8 +50,9 @@ def get_image_meta(inbag_path, num_images=None):
images = []
with rosbag.Bag(inbag_path) as bag:
img_meta = None
for topic, msg, t in bag.read_messages([IMAGE_TOPIC, POSE_TOPIC]):
if topic == IMAGE_TOPIC:
topics = IMAGE_TOPIC + [POSE_TOPIC]
for topic, msg, t in bag.read_messages(topics):
if topic in IMAGE_TOPIC:
if num_images is not None and len(images) == num_images:
break

Expand Down
16 changes: 14 additions & 2 deletions pano/pano_stitch/scripts/stitch_panorama.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,12 +427,24 @@ def next(self):

def read_pto(pano, pto_path):
print("\nread_pto: %s" % pto_path)
pano.ReadPTOFile(pto_path)
try:
# Attempt the first method
ifs = hsi.ifstream(pto_path)
pano.readData(ifs)
except AttributeError:
# Fallback to the second method if the first method fails
pano.ReadPTOFile(pto_path)


def write_pto(pano, pto_path):
print("\nwrite_pto: %s" % pto_path)
pano.WritePTOFile(pto_path)
try:
# Attempt the first method
ofs = hsi.ofstream(pto_path)
pano.writeData(ofs)
except AttributeError:
# Fallback to the second method if the first method fails
pano.WritePTOFile(pto_path)


def get_timestamp():
Expand Down

0 comments on commit e1f5d47

Please sign in to comment.