Skip to content

Commit

Permalink
Fix getting domain ID process
Browse files Browse the repository at this point in the history
Reference: ros2/rclcpp#910 (comment)

Signed-off-by: Abrar Rahman Protyasha <[email protected]>
  • Loading branch information
aprotyas committed May 31, 2022
1 parent 0153bf2 commit e29b864
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/domain_bridge/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ std::size_t
get_node_domain_id(
rclcpp::Node & node)
{
const rcl_init_options_t * rcl_init_options =
node.get_node_base_interface()->get_context()->get_init_options().get_rcl_init_options();
const rclcpp::InitOptions init_options =
node.get_node_base_interface()->get_context()->get_init_options();
const rcl_init_options_t * rcl_init_options = init_options.get_rcl_init_options();

std::size_t domain_id;
// const_cast is safe because `rcl_init_options_get_domain_id` only reads the input structure
Expand Down

0 comments on commit e29b864

Please sign in to comment.