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

Update CI #47

Merged
merged 3 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .github/workflows/ros2-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ jobs:
fail-fast: false
matrix:
include:
- docker-image: "ubuntu:22.04"
- docker-image: "ubuntu:24.04"
ros-distro: "rolling"
container:
image: ${{ matrix.docker-image }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Build and Test
run: .github/workflows/build-and-test.sh
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,54 +167,54 @@ void copyChannelData(
* Points for which FILTER is true are part of the final pointcloud.
*/
#define CREATE_FILTERED_CLOUD(IN, OUT, KEEP_ORGANIZED, FILTER) { \
const auto inputIsOrganized = (IN).height > 1; \
const auto outIsOrganized = (KEEP_ORGANIZED) && inputIsOrganized; \
const auto inputIsOrganized = (IN).height > 1; \
const auto outIsOrganized = (KEEP_ORGANIZED) && inputIsOrganized; \
\
(OUT).header = (IN).header; \
(OUT).fields = (IN).fields; \
(OUT).point_step = (IN).point_step; \
(OUT).height = outIsOrganized ? (IN).height : 1; \
(OUT).width = outIsOrganized ? (IN).width : 0; \
(OUT).header = (IN).header; \
(OUT).fields = (IN).fields; \
(OUT).point_step = (IN).point_step; \
(OUT).height = outIsOrganized ? (IN).height : 1; \
(OUT).width = outIsOrganized ? (IN).width : 0; \
\
(OUT).data.resize(0); \
(OUT).data.reserve((IN).data.size()); \
(OUT).data.resize(0); \
(OUT).data.reserve((IN).data.size()); \
\
::cras::CloudConstIter x_it((IN), "x"); \
::cras::CloudConstIter y_it((IN), "y"); \
::cras::CloudConstIter z_it((IN), "z"); \
::cras::CloudConstIter x_it((IN), "x"); \
::cras::CloudConstIter y_it((IN), "y"); \
::cras::CloudConstIter z_it((IN), "z"); \
\
const auto numPoints = ::cras::numPoints(IN); \
const auto numPoints = ::cras::numPoints(IN); \
\
if (!outIsOrganized) { \
for (size_t i = 0; i < numPoints; ++i, ++x_it, ++y_it, ++z_it) { \
if (FILTER) { \
size_t from = (i / (IN).width) * (IN).row_step + (i % (IN).width) * (IN).point_step; \
size_t to = from + (IN).point_step; \
(OUT).data.insert( \
(OUT).data.end(), (IN).data.begin() + from, \
(IN).data.begin() + to); \
(OUT).width++; \
} \
} \
(OUT).is_dense = true; \
} else { \
(OUT).data.insert((OUT).data.end(), (IN).data.begin(), (IN).data.end()); \
if (!outIsOrganized) { \
for (size_t i = 0; i < numPoints; ++i, ++x_it, ++y_it, ++z_it) { \
if (FILTER) { \
size_t from = (i / (IN).width) * (IN).row_step + (i % (IN).width) * (IN).point_step; \
size_t to = from + (IN).point_step; \
(OUT).data.insert( \
(OUT).data.end(), (IN).data.begin() + from, \
(IN).data.begin() + to); \
(OUT).width++; \
} \
} \
(OUT).is_dense = true; \
} else { \
(OUT).data.insert((OUT).data.end(), (IN).data.begin(), (IN).data.end()); \
\
::cras::CloudIter x_out_it((OUT), "x"); \
::cras::CloudIter y_out_it((OUT), "y"); \
::cras::CloudIter z_out_it((OUT), "z"); \
const auto invalidValue = std::numeric_limits<float>::quiet_NaN(); \
::cras::CloudIter x_out_it((OUT), "x"); \
::cras::CloudIter y_out_it((OUT), "y"); \
::cras::CloudIter z_out_it((OUT), "z"); \
const auto invalidValue = std::numeric_limits<float>::quiet_NaN(); \
\
for (size_t i = 0; i < numPoints; \
++i, ++x_it, ++y_it, ++z_it, ++x_out_it, ++y_out_it, ++z_out_it) { \
if (!(FILTER)) { \
*x_out_it = *y_out_it = *z_out_it = invalidValue; \
(OUT).is_dense = false; \
} \
} \
for (size_t i = 0; i < numPoints; \
++i, ++x_it, ++y_it, ++z_it, ++x_out_it, ++y_out_it, ++z_out_it) { \
if (!(FILTER)) { \
*x_out_it = *y_out_it = *z_out_it = invalidValue; \
(OUT).is_dense = false; \
} \
} \
} \
\
(OUT).row_step = (OUT).width * (OUT).point_step; \
(OUT).row_step = (OUT).width * (OUT).point_step; \
}
} // namespace cras

Expand Down
4 changes: 2 additions & 2 deletions draco_point_cloud_transport/src/cloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ void GenericCloudIterator<T>::copyData(const GenericCloudIterator<T> & otherIter

// explicitly instantiate
template class GenericCloudIteratorBase<unsigned char, unsigned char, unsigned char,
sensor_msgs::msg::PointCloud2, GenericCloudIterator>;
sensor_msgs::msg::PointCloud2, GenericCloudIterator>;
template class GenericCloudIteratorBase<unsigned char, const unsigned char, const unsigned char,
const sensor_msgs::msg::PointCloud2, GenericCloudConstIterator>;
const sensor_msgs::msg::PointCloud2, GenericCloudConstIterator>;

template class GenericCloudIterator<>;
template class GenericCloudConstIterator<>;
Expand Down
2 changes: 1 addition & 1 deletion zstd_point_cloud_transport/src/zstd_subscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ZstdSubscriber::DecodeResult ZstdSubscriber::decodeTyped(
auto result = std::make_shared<sensor_msgs::msg::PointCloud2>();

auto const est_decomp_size =
ZSTD_getDecompressedSize(&msg.compressed_data[0], msg.compressed_data.size());
ZSTD_getFrameContentSize(&msg.compressed_data[0], msg.compressed_data.size());
Copy link
Collaborator

Choose a reason for hiding this comment

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

For posterity, just calling out this change

unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize);
  NOTE: This function is now obsolete, in favor of ZSTD_getFrameContentSize().
  Both functions work the same way, but ZSTD_getDecompressedSize() blends
  "empty", "unknown" and "error" results to the same return value (0),
  while ZSTD_getFrameContentSize() gives them separate return values.
 @return : decompressed size of `src` frame content _if known and not empty_, 0 otherwise. 


result->data.resize(est_decomp_size);

Expand Down