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

fix(nebula_hw_interfaces): add missing iomanip header #196

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

xmfcx
Copy link
Contributor

@xmfcx xmfcx commented Sep 11, 2024

PR Type

  • Bug Fix

Bug

Run colcon build --symlink-install --event-handlers=console_cohesion+ --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo --packages-up-to nebula_sensor_driver in latest autoware workspace.

--- stderr: nebula_hw_interfaces
In file included from /home/mfc/projects/autoware/src/sensor_component/external/nebula/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_hw_interface.hpp:19,
                 from /home/mfc/projects/autoware/src/sensor_component/external/nebula/nebula_hw_interfaces/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp:1:
/home/mfc/projects/autoware/src/sensor_component/external/nebula/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_cmd_response.hpp: In function ‘std::ostream& nebula::operator<<(std::ostream&, const nebula::HesaiInventory&)’:
/home/mfc/projects/autoware/src/sensor_component/external/nebula/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_cmd_response.hpp:200:30: error: ‘setfill’ is not a member of ‘std’; did you mean ‘fill’?
  200 |       ss << std::hex << std::setfill('0') << std::setw(2) << (static_cast<int>(arg.mac[i]) & 0xff)
      |                              ^~~~~~~
      |                              fill
/home/mfc/projects/autoware/src/sensor_component/external/nebula/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_cmd_response.hpp:200:51: error: ‘setw’ is not a member of ‘std’; did you mean ‘set’?
  200 |       ss << std::hex << std::setfill('0') << std::setw(2) << (static_cast<int>(arg.mac[i]) & 0xff)
      |                                                   ^~~~
      |                                                   set
/home/mfc/projects/autoware/src/sensor_component/external/nebula/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_cmd_response.hpp:203:28: error: ‘setfill’ is not a member of ‘std’; did you mean ‘fill’?
  203 |     ss << std::hex << std::setfill('0') << std::setw(2)
      |                            ^~~~~~~
      |                            fill
/home/mfc/projects/autoware/src/sensor_component/external/nebula/nebula_hw_interfaces/include/nebula_hw_interfaces/nebula_hw_interfaces_hesai/hesai_cmd_response.hpp:203:49: error: ‘setw’ is not a member of ‘std’; did you mean ‘set’?
  203 |     ss << std::hex << std::setfill('0') << std::setw(2)
      |                                                 ^~~~
      |                                                 set
gmake[2]: *** [CMakeFiles/nebula_hw_interfaces_hesai.dir/build.make:76: CMakeFiles/nebula_hw_interfaces_hesai.dir/src/nebula_hesai_hw_interfaces/hesai_hw_interface.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:143: CMakeFiles/nebula_hw_interfaces_hesai.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< nebula_hw_interfaces [9.80s, exited with code 2]

Description

See: https://en.cppreference.com/w/cpp/io/manip/setfill for why this missing header should be added.

Review Procedure

Remarks

Pre-Review Checklist for the PR Author

PR Author should check the checkboxes below when creating the PR.

  • Assign PR to reviewer

Checklist for the PR Reviewer

Reviewers should check the checkboxes below before approval.

  • Commits are properly organized and messages are according to the guideline
  • (Optional) Unit tests have been written for new behavior
  • PR title describes the changes

Post-Review Checklist for the PR Author

PR Author should check the checkboxes below before merging.

  • All open points are addressed and tracked via issues or tickets

CI Checks

  • Build and test for PR: Required to pass before the merge.

Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
@xmfcx
Copy link
Contributor Author

xmfcx commented Sep 11, 2024

pinging @drwnz @mojomex @kminoda

@xmfcx
Copy link
Contributor Author

xmfcx commented Sep 11, 2024

@mitsudome-r could you merge this? Autoware isn't compiling without this right now.

@xmfcx
Copy link
Contributor Author

xmfcx commented Sep 11, 2024

@mitsudome-r mitsudome-r merged commit 18af521 into tier4:main Sep 11, 2024
7 of 8 checks passed
@xmfcx xmfcx deleted the fix/add-missing-header branch September 11, 2024 16:01
@mitsudome-r
Copy link
Collaborator

I was wondering why it started to fail and did a little investigation.

I took a look in package.xml of nebula_hw_interfaces, and looked into any package that had modification in the past 24 hours. It seems like the issue was due to this PR being merged in transport_driver repository:
autowarefoundation/transport_drivers#1

The modification in the above PR removes #include "boost_msg_converters/converters.hpp", which includes iomanip further down in the nested include files.

@mojomex
Copy link
Collaborator

mojomex commented Sep 11, 2024

@mitsudome-r @xmfcx That's interesting! We're running cppcheck in pre-commit with include-what-you-use to prevent exactly this kind of issue. Recently we've noticed a lot of headers being missed by this check though...
Sorry for causing trouble with that PR merge 🙇‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants