Skip to content

Commit

Permalink
refactor(behavior_planning): replace generateUUID() with tier4_autowa…
Browse files Browse the repository at this point in the history
…re_utils's function (#2924)

* fix(behavior_path_planner): replace generateUUID() with util function in tier4 autoware utils

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>

* fix(behavior_velocity_planner): replace generateUUID() with util function in tier4 autoware utils

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>

---------

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
  • Loading branch information
satoshi-ota authored Feb 22, 2023
1 parent 46e6315 commit 902d3f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ using autoware_adapi_v1_msgs::msg::SteeringFactor;
using autoware_auto_planning_msgs::msg::PathWithLaneId;
using rtc_interface::RTCInterface;
using steering_factor_interface::SteeringFactorInterface;
using tier4_autoware_utils::generateUUID;
using tier4_planning_msgs::msg::AvoidanceDebugMsgArray;
using unique_identifier_msgs::msg::UUID;
using visualization_msgs::msg::MarkerArray;
Expand Down Expand Up @@ -267,17 +268,6 @@ class SceneModuleInterface

void clearWaitingApproval() { is_waiting_approval_ = false; }

static UUID generateUUID()
{
// Generate random number
UUID uuid;
std::mt19937 gen(std::random_device{}());
std::independent_bits_engine<std::mt19937, 8, uint8_t> bit_eng(gen);
std::generate(uuid.uuid.begin(), uuid.uuid.end(), bit_eng);

return uuid;
}

public:
BT::NodeStatus current_state_;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,7 @@ class SceneModuleManagerInterfaceWithRTC : public SceneModuleManagerInterface

void generateUUID(const int64_t & module_id)
{
// Generate random number
UUID uuid;
std::mt19937 gen(std::random_device{}());
std::independent_bits_engine<std::mt19937, 8, uint8_t> bit_eng(gen);
std::generate(uuid.uuid.begin(), uuid.uuid.end(), bit_eng);
map_uuid_.insert({module_id, uuid});
map_uuid_.insert({module_id, tier4_autoware_utils::generateUUID()});
}

void removeUUID(const int64_t & module_id)
Expand Down

0 comments on commit 902d3f9

Please sign in to comment.