forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tools] Add drake_lcm_cc_library opt-in for new lcm_gen (RobotLocomot…
…ion#20903) Manual testing of flipping the default for this flag pointed out some embarrassing problems with the new tool, which are also fixed here: - Messages with sub-structs must include the headers for those structs. - The getTypeName function is actually required downstream. - Generated filenames must be `*.hpp` not `*.h`. Ideally we would have started a new filename convention with the new tool, but so much old code expects the messages to keep their old names that renaming is intractable in practice.
- Loading branch information
1 parent
b9210ee
commit 2e8e856
Showing
11 changed files
with
137 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include "drake/test_message.hpp" | ||
|
||
#include <gtest/gtest.h> | ||
|
||
#include "drake/lcm/lcm_messages.h" | ||
|
||
namespace drake { | ||
namespace lcm { | ||
namespace { | ||
|
||
GTEST_TEST(LcmTestMessageTest, Smoke) { | ||
test_message foo{.value = 22.0}; | ||
const std::vector<uint8_t> bytes = EncodeLcmMessage(foo); | ||
auto readback = DecodeLcmMessage<test_message>(bytes); | ||
EXPECT_EQ(readback.value, foo.value); | ||
} | ||
|
||
} // namespace | ||
} // namespace lcm | ||
} // namespace drake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters