diff --git a/pcl_recorder/CMakeLists.txt b/pcl_recorder/CMakeLists.txt index 3310bbbf..546f863c 100644 --- a/pcl_recorder/CMakeLists.txt +++ b/pcl_recorder/CMakeLists.txt @@ -50,6 +50,7 @@ elseif(${ROS_VERSION} EQUAL 2) find_package(rclcpp_components REQUIRED) find_package(sensor_msgs COMPONENTS) find_package(tf2 REQUIRED) + find_package(tf2_eigen REQUIRED) find_package(tf2_geometry_msgs REQUIRED) find_package(tf2_ros REQUIRED) find_package(pcl_conversions REQUIRED) @@ -65,7 +66,7 @@ elseif(${ROS_VERSION} EQUAL 2) add_executable(${PROJECT_NAME}_node src/PclRecorderROS2.cpp src/mainROS2.cpp) ament_target_dependencies(${PROJECT_NAME}_node rclcpp sensor_msgs - pcl_conversions tf2_ros tf2) + pcl_conversions tf2 tf2_ros) target_link_libraries(${PROJECT_NAME}_node ${Boost_SYSTEM_LIBRARY} ${PCL_LIBRARIES}) diff --git a/pcl_recorder/src/PclRecorderROS2.cpp b/pcl_recorder/src/PclRecorderROS2.cpp index ce18a59c..62f6864e 100644 --- a/pcl_recorder/src/PclRecorderROS2.cpp +++ b/pcl_recorder/src/PclRecorderROS2.cpp @@ -27,7 +27,7 @@ PclRecorderROS2::PclRecorderROS2() : Node("pcl_recorder") roleName = "ego_vehicle"; } auto sub_opt = rclcpp::SubscriptionOptions(); - sub_opt.callback_group = this->create_callback_group(rclcpp::callback_group::CallbackGroupType::MutuallyExclusive); + sub_opt.callback_group = this->create_callback_group(rclcpp::CallbackGroupType::MutuallyExclusive); sub = this->create_subscription("/carla/" + roleName + "/lidar", 10, std::bind(&PclRecorderROS2::callback, this, std::placeholders::_1), sub_opt); } @@ -47,7 +47,7 @@ void PclRecorderROS2::callback(const sensor_msgs::msg::PointCloud2::SharedPtr cl Eigen::Affine3d transform; try { - transform = tf2::transformToEigen (tf_buffer_->lookupTransform(fixed_frame_, cloud->header.frame_id, cloud->header.stamp, rclcpp::Duration(1))); + transform = tf2::transformToEigen (tf_buffer_->lookupTransform(fixed_frame_, cloud->header.frame_id, cloud->header.stamp, rclcpp::Duration::from_seconds(1))); pcl::PointCloud pclCloud; pcl::fromROSMsg(*cloud, pclCloud); diff --git a/rviz_carla_plugin/CMakeLists.txt b/rviz_carla_plugin/CMakeLists.txt index 48c1e54f..83904edb 100644 --- a/rviz_carla_plugin/CMakeLists.txt +++ b/rviz_carla_plugin/CMakeLists.txt @@ -74,7 +74,7 @@ elseif(${ROS_VERSION} EQUAL 2) plugin_description_ros2.xml) ament_target_dependencies(rviz_carla_plugin rclcpp carla_msgs nav_msgs - carla_ros_scenario_runner_types) + carla_ros_scenario_runner_types rviz_common) ament_export_libraries(${PROJECT_NAME})