-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Can't read byte-array parameters from parameter dump file
https://github.com/ros2/rclcpp/issues/2442 Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
- Loading branch information
1 parent
5d5c0b1
commit 04d3995
Showing
2 changed files
with
27 additions
and
0 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,26 @@ | ||
#include <cstdio> | ||
|
||
#include "rclcpp/rclcpp.hpp" | ||
|
||
static constexpr const uint8_t EXAMPLE_ARR[8]{ 0x00, 0x13, 0xA2, 0x00, 0x41, 0x5C, 0x61, 0x86 }; | ||
|
||
int main(int argc, char ** argv) | ||
{ | ||
rclcpp::init(argc, argv); | ||
|
||
auto node = rclcpp::Node::make_shared("my_node"); | ||
auto param_desc = rcl_interfaces::msg::ParameterDescriptor{}; | ||
|
||
param_desc.description = "XBee Due address"; | ||
auto dueAddrParm = node->declare_parameter( | ||
"byte_arr_param", | ||
std::vector<uint8_t>(EXAMPLE_ARR, | ||
EXAMPLE_ARR + sizeof(EXAMPLE_ARR) / sizeof(EXAMPLE_ARR[0])), | ||
param_desc); | ||
auto p = node->get_parameter("byte_arr_param"); | ||
RCLCPP_INFO_STREAM(node->get_logger(), p.get_name() << ":=" << p.value_to_string() << " (initial)"); | ||
|
||
rclcpp::spin(node); | ||
rclcpp::shutdown(); | ||
return 0; | ||
} |