Skip to content

Commit

Permalink
feat(radar_tracks_msgs_converter): add an error message and prevent t…
Browse files Browse the repository at this point in the history
…he node from crashing. (#5400)

* add an error message and prevent the node from crashing.

Signed-off-by: Shunsuke Miura <[email protected]>

* style(pre-commit): autofix

---------

Signed-off-by: Shunsuke Miura <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
miursh and pre-commit-ci[bot] authored Oct 26, 2023
1 parent 801fd0d commit 98fe02b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ TrackedObjects RadarTracksMsgsConverterNode::convertRadarTrackToTrackedObjects()
std::atan2(compensated_velocity.y, compensated_velocity.x));

geometry_msgs::msg::PoseStamped transformed_pose_stamped{};
if (transform_ == nullptr) {
RCLCPP_ERROR_THROTTLE(
get_logger(), *get_clock(), 5000, "getTransform failed. radar output will be empty.");
return tracked_objects;
}
tf2::doTransform(radar_pose_stamped, transformed_pose_stamped, *transform_);
kinematics.pose_with_covariance.pose = transformed_pose_stamped.pose;
kinematics.pose_with_covariance.pose.orientation =
Expand Down

0 comments on commit 98fe02b

Please sign in to comment.