Skip to content

Commit

Permalink
feat: add custom shell prompt and color settings in dev Dockerfile; a…
Browse files Browse the repository at this point in the history
…dd metadata.yaml for livox MCAP data; update conftest.py for new test fixture
  • Loading branch information
tgoelles committed Dec 3, 2024
1 parent 036cad1 commit cd43a1a
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 31 deletions.
11 changes: 11 additions & 0 deletions .devcontainer/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ RUN apt-get update && \
mesa-utils && \
rm -rf /var/lib/apt/lists/*

# Set up a custom prompt and colored output in the shell
RUN echo '\
RESET="\\[\\e[0m\\]"\n\
BOLD="\\[\\e[1m\\]"\n\
GREEN="\\[\\e[32m\\]"\n\
BLUE="\\[\\e[34m\\]"\n\
export PS1="${BLUE}pointcoudset ${BLUE}${BOLD}\\w${RESET} $ "\n\
export LS_OPTIONS="--color=auto"\n\
eval "$(dircolors -b)"\n\
alias ls="ls $LS_OPTIONS"\n\
' >> /root/.bashrc


# Switch back to dialog for any ad-hoc use of apt-get
Expand Down
47 changes: 16 additions & 31 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
ROS1FILE = Path(__file__).parent.absolute() / "testdata/test.bag"
ROS2FILE = Path(__file__).parent.absolute() / "testdata/ros2"
ROS2MCAPFILE = Path(__file__).parent.absolute() / "testdata/ros2_mcap"
ROS2MCAPFILE_LIVOX = Path(__file__).parent.absolute() / "testdata/ros2_mcap_livox"


@pytest.fixture()
Expand Down Expand Up @@ -37,6 +38,11 @@ def testros2mcap():
return ROS2MCAPFILE


@pytest.fixture()
def testros2mcap_livox():
return ROS2MCAPFILE_LIVOX


@pytest.fixture()
def testlas1():
return Path(__file__).parent.absolute() / "testdata/las_files/diamond.las"
Expand Down Expand Up @@ -103,19 +109,13 @@ def testpointcloud_mini_df():

@pytest.fixture()
def reference_data_with_zero_dataframe():
filename = (
Path(__file__).parent.absolute()
/ "testdata/testpointcloud_withzero_dataframe.pkl"
)
filename = Path(__file__).parent.absolute() / "testdata/testpointcloud_withzero_dataframe.pkl"
return pd.read_pickle(filename)


@pytest.fixture()
def reference_pointcloud_withzero_dataframe():
filename = (
Path(__file__).parent.absolute()
/ "testdata/testpointcloud_withzero_pointcloud.pkl"
)
filename = Path(__file__).parent.absolute() / "testdata/testpointcloud_withzero_pointcloud.pkl"
return pd.read_pickle(filename)


Expand All @@ -130,18 +130,14 @@ def testpointcloud_mini(testpointcloud_mini_df) -> PointCloud:

@pytest.fixture()
def testpointcloud_mini_real(testpointcloud) -> PointCloud:
testpointcloud_mini_real = (
testpointcloud.limit("x", -1, 1).limit("y", -1, 1).limit("intensity", 0, 10)
)
testpointcloud_mini_real = testpointcloud.limit("x", -1, 1).limit("y", -1, 1).limit("intensity", 0, 10)
testpointcloud_mini_real.timestamp = datetime.datetime(2020, 1, 1, 0, 0)
return testpointcloud_mini_real


@pytest.fixture()
def testpointcloud_mini_real_later(testpointcloud) -> PointCloud:
testpointcloud_mini_real_later = (
testpointcloud.limit("x", -1, 1).limit("y", -1, 1).limit("intensity", 0, 10)
)
testpointcloud_mini_real_later = testpointcloud.limit("x", -1, 1).limit("y", -1, 1).limit("intensity", 0, 10)
testpointcloud_mini_real_later.timestamp = datetime.datetime(2020, 1, 1, 0, 1)
return testpointcloud_mini_real_later

Expand All @@ -162,27 +158,20 @@ def testpointcloud_mini_real_other_original_id(testpointcloud_mini_real) -> Poin


@pytest.fixture()
def testdataset_mini_real(
testpointcloud_mini_real, testpointcloud_mini_real_plus1
) -> Dataset:
def testdataset_mini_real(testpointcloud_mini_real, testpointcloud_mini_real_plus1) -> Dataset:
pointclouds = [testpointcloud_mini_real, testpointcloud_mini_real_plus1]
return Dataset.from_instance("POINTCLOUDS", pointclouds)


@pytest.fixture()
def testdataset_mini_same(
testpointcloud_mini_real, testpointcloud_mini_real_later
) -> Dataset:
def testdataset_mini_same(testpointcloud_mini_real, testpointcloud_mini_real_later) -> Dataset:
pointclouds = [testpointcloud_mini_real, testpointcloud_mini_real_later]
return Dataset.from_instance("POINTCLOUDS", pointclouds)


@pytest.fixture()
def test_kitti() -> Dataset:
filename = (
Path(__file__).parent.absolute()
/ "testdata/kitti_velodyne/kitti_2011_09_26_drive_0002_synce"
)
filename = Path(__file__).parent.absolute() / "testdata/kitti_velodyne/kitti_2011_09_26_drive_0002_synce"
return Dataset.from_file(filename)


Expand All @@ -196,16 +185,12 @@ def pipeline(pointcloud: PointCloud) -> PointCloud:

@pytest.fixture()
def testvz6000_1(testlasvz6000_1):
return PointCloud.from_file(
testlasvz6000_1, timestamp=datetime.datetime(2022, 1, 1, 1, 1, 1)
)
return PointCloud.from_file(testlasvz6000_1, timestamp=datetime.datetime(2022, 1, 1, 1, 1, 1))


@pytest.fixture()
def testvz6000_2(testlasvz6000_2):
return PointCloud.from_file(
testlasvz6000_2, timestamp=datetime.datetime(2022, 1, 1, 2, 2, 2)
)
return PointCloud.from_file(testlasvz6000_2, timestamp=datetime.datetime(2022, 1, 1, 2, 2, 2))


@pytest.fixture()
Expand All @@ -219,6 +204,6 @@ def test_sets(request):
return request.getfixturevalue(request.param)


@pytest.fixture(params=[ROS1FILE, ROS2FILE, ROS2MCAPFILE])
@pytest.fixture(params=[ROS1FILE, ROS2FILE, ROS2MCAPFILE, ROS2MCAPFILE_LIVOX])
def ros_files(request):
return request.param
32 changes: 32 additions & 0 deletions tests/testdata/ros2_mcap_livox/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
rosbag2_bagfile_information:
version: 5
storage_identifier: mcap
duration:
nanoseconds: 1341025636
starting_time:
nanoseconds_since_epoch: 1732109033336708255
message_count: 201
topics_with_message_count:
- topic_metadata:
name: /livox/imu
type: sensor_msgs/msg/Imu
serialization_format: cdr
offered_qos_profiles: "- history: 3\n depth: 0\n reliability: 1\n durability: 2\n deadline:\n sec: 9223372036\n nsec: 854775807\n lifespan:\n sec: 9223372036\n nsec: 854775807\n liveliness: 1\n liveliness_lease_duration:\n sec: 9223372036\n nsec: 854775807\n avoid_ros_namespace_conventions: false"
message_count: 186
- topic_metadata:
name: /livox/lidar
type: sensor_msgs/msg/PointCloud2
serialization_format: cdr
offered_qos_profiles: "- history: 3\n depth: 0\n reliability: 1\n durability: 2\n deadline:\n sec: 9223372036\n nsec: 854775807\n lifespan:\n sec: 9223372036\n nsec: 854775807\n liveliness: 1\n liveliness_lease_duration:\n sec: 9223372036\n nsec: 854775807\n avoid_ros_namespace_conventions: false"
message_count: 15
compression_format: ""
compression_mode: ""
relative_file_paths:
- testrecord_mcap_AVIA_5_0.mcap
files:
- path: testrecord_mcap_AVIA_5_0.mcap
starting_time:
nanoseconds_since_epoch: 1732109033336708255
duration:
nanoseconds: 1341025636
message_count: 201
Binary file not shown.

0 comments on commit cd43a1a

Please sign in to comment.