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

ROS2: Add samples and other fixups #109

Merged
merged 33 commits into from
Jul 19, 2024
Merged

Conversation

micragz
Copy link
Contributor

@micragz micragz commented Jul 17, 2024

Please see individual commits.

Change `sample_capture` to capture from yaml settings
Extract methods and cleanup formatting. Remove some less important error checks for readability.

Make 2d capture samples loop, like the capture samples. Better align behavior of C++ and Python samples.
Replace `ament_lint_common` with individual linters. Added each linter
from common except: `ament_cmake_copyright`.

The full list for `ament_lint_common` is found here:
https://github.com/ament/ament_lint/blob/master/ament_lint_common/package.xml

Add a `pyproject.toml` so that the Black formatting is compatible with
the `ament_flake8` linter.
For consistency with our public `zivid-cpp-samples`.
In particular, clang-format provides a lot more stable output for some
given input, and typically works better with IDEs.

Replace `ament_lint_common` with the same individual linters, with the
following exceptions:

- Replace `ament_cmake_uncrustify` with `ament_cmake_clang_format`.
- Remove `cament_cpp_lint` with the intention of later adding `ament_clang_tidy`.

Additionally, run clang-format during code analysis instead of during
testing.
This version is not available on the Ubuntu toolchain test apt
repository, and will cause failures when trying to build with it.
The flag `CMAKE_CXX_COMPILER` was not previously passed to CMake due
to the double quotes in the `build.sh` script.

This implies that we didn't previously build with clang. Building
with clang started emitting some warnings, causing errors. These
warnings have been addressed here as well.

Also removed warning `return-std-move-in-c++11` as this was removed in
Clang 13 and now causing a compile error:
https://releases.llvm.org/13.0.0/tools/clang/docs/ReleaseNotes.html
Only run clang-tidy on Jazzy, as earlier versions cause issues.
@micragz micragz requested a review from apartridge July 17, 2024 11:36
Copy link
Collaborator

@apartridge apartridge left a comment

Choose a reason for hiding this comment

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

Overall changes looking good, I will do some testing tomorrow.

zivid_samples/CMakeLists.txt Outdated Show resolved Hide resolved
zivid_camera/src/zivid_camera.cpp Outdated Show resolved Hide resolved
zivid_camera/src/zivid_camera.cpp Show resolved Hide resolved
zivid_samples/src/sample_capture.cpp Show resolved Hide resolved
@micragz
Copy link
Contributor Author

micragz commented Jul 18, 2024

RFNR @apartridge

…ting parameters in all samples

AsyncParameterClient appears not to be available on ROS2 Humble.
README.md Outdated Show resolved Hide resolved
micragz and others added 3 commits July 19, 2024 11:54
also changes logging from INFO to DEBUG, since setParametersCallback is
invoked for a lot of different parameters, not just the ones defined by
zivid (coming from ros image_transport etc).
@micragz micragz merged commit a428dec into ros2-preview Jul 19, 2024
40 checks passed
@micragz micragz deleted the MISC-2024-06-19-ros2-testing branch July 19, 2024 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants