20 using std::placeholders::_1;
21 using std::placeholders::_2;
22 using std::placeholders::_3;
25 : carma_ros2_utils::CarmaLifecycleNode(options),
29 get_node_logging_interface()
31 tfBuffer_(get_clock()),
32 tfListener_(tfBuffer_)
40 this->get_parameter<std::string>(
"map_frame",
map_frame_);
43 this->add_on_set_parameters_callback(
44 [
this](
auto param_vec) {
46 auto error = update_params<std::string>({ {
"map_frame",
map_frame_} }, param_vec);
48 rcl_interfaces::msg::SetParametersResult result;
50 result.successful = !error;
53 result.reason = error.get();
64 autoware_obj_sub_= create_subscription<autoware_auto_msgs::msg::TrackedObjects>(
"detected_objects",10,
68 carma_obj_pub_= create_publisher<carma_perception_msgs::msg::ExternalObjectList>(
"external_objects", 10);
70 return CallbackReturn::SUCCESS;
78 boost::optional<geometry_msgs::msg::TransformStamped>
82 return tfBuffer_.lookupTransform(parent ,child, stamp);
84 }
catch (tf2::TransformException &ex) {
86 RCLCPP_WARN_STREAM(get_logger(),
"Failed to find transform with exception " << ex.what());
95#include "rclcpp_components/register_node_macro.hpp"
tf2_ros::Buffer tfBuffer_
carma_ros2_utils::SubPtr< autoware_auto_msgs::msg::TrackedObjects > autoware_obj_sub_
void publishObject(const carma_perception_msgs::msg::ExternalObjectList &obj_msg)
Callback to publish ObjectList.
carma_ros2_utils::CallbackReturn handle_on_configure(const rclcpp_lifecycle::State &)
boost::optional< geometry_msgs::msg::TransformStamped > lookupTransform(const std::string &parent, const std::string &child, const rclcpp::Time &stamp)
Callback to lookup a transform between two frames.
ObjectDetectionTrackingWorker object_worker_
ObjectDetectionTrackingNode(const rclcpp::NodeOptions &)
ObjectDetectionTrackingNode constructor.
carma_ros2_utils::PubPtr< carma_perception_msgs::msg::ExternalObjectList > carma_obj_pub_
void detectedObjectCallback(autoware_auto_msgs::msg::TrackedObjects::UniquePtr msg)
detectedObjectCallback populates detected object along with its velocity,yaw, yaw_rate and static/dyn...
void setMapFrame(std::string map_frame)